Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cookbook/agent_os/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
agent=basic_agent,
)
],
add_workflow_history_to_steps=True,
)

# Setup our AgentOS app
Expand Down
6 changes: 4 additions & 2 deletions cookbook/agents/session/02_persistent_session_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
agent = Agent(
model=OpenAIChat(id="gpt-4o-mini"),
db=db,
session_id="session_storage",
add_history_to_context=True,
num_history_runs=2,
num_history_runs=3,
)

agent.print_response("Tell me a new interesting fact about space")
agent.print_response("Tell me a new interesting fact about oceans")

agent.print_response("What have we been talking about?")
5 changes: 4 additions & 1 deletion cookbook/db/json_db/json_for_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
agent = Agent(
model=OpenAIChat(id="gpt-4o-mini"),
db=db,
session_id="session_storage",
tools=[DuckDuckGoTools()],
add_history_to_context=True,
num_history_runs=3,
)
agent.print_response("How many people live in Canada?")
agent.print_response("How many people live in France?")
agent.print_response("What is their national anthem called?")
agent.print_response("What have we been talking about?")
8 changes: 4 additions & 4 deletions libs/agno/agno/db/mongo/async_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ async def _get_or_create_collection(
return None
# Note: Motor doesn't have sync create_index, so we use it as-is
# The indexes are created in the background
create_collection_indexes(collection, collection_type)
create_collection_indexes(collection, collection_type) # type: ignore
setattr(self, f"_{collection_name}_initialized", True)
log_debug(f"Initialized collection '{collection_name}'")
else:
Expand Down Expand Up @@ -1088,8 +1088,8 @@ async def get_user_memory_stats(
# Apply pagination
if limit is not None:
if page is not None:
pipeline.append({"$skip": (page - 1) * limit})
pipeline.append({"$limit": limit})
pipeline.append({"$skip": (page - 1) * limit}) # type: ignore
pipeline.append({"$limit": limit}) # type: ignore

results = await collection.aggregate(pipeline).to_list(length=None)

Expand Down Expand Up @@ -1584,7 +1584,7 @@ async def calculate_metrics(self) -> Optional[list[dict]]:
metrics_records.append(metrics_record)

if metrics_records:
results = bulk_upsert_metrics(collection, metrics_records)
results = bulk_upsert_metrics(collection, metrics_records) # type: ignore

return results

Expand Down
1 change: 0 additions & 1 deletion libs/agno/agno/os/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ def filter_meaningful_config(d: Dict[str, Any], defaults: Dict[str, Any]) -> Opt
team_run_context={},
check_mcp_tools=False,
)
print(team.tools, _tools)
team_tools = _tools
formatted_tools = format_team_tools(team_tools) if team_tools else None

Expand Down
10 changes: 8 additions & 2 deletions libs/agno/agno/team/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -8501,7 +8501,7 @@ async def aget_relevant_docs_from_knowledge(
log_warning("No valid filters remain after validation. Search will proceed without filters.")

if self.knowledge_retriever is not None and callable(self.knowledge_retriever):
from inspect import signature
from inspect import isawaitable, signature

try:
sig = signature(self.knowledge_retriever)
Expand All @@ -8511,7 +8511,13 @@ async def aget_relevant_docs_from_knowledge(
if "filters" in sig.parameters:
knowledge_retriever_kwargs["filters"] = filters
knowledge_retriever_kwargs.update({"query": query, "num_documents": num_documents, **kwargs})
return self.knowledge_retriever(**knowledge_retriever_kwargs)

result = self.knowledge_retriever(**knowledge_retriever_kwargs)

if isawaitable(result):
result = await result

return result
except Exception as e:
log_warning(f"Knowledge retriever failed: {e}")
raise e
Expand Down
2 changes: 1 addition & 1 deletion libs/agno/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "agno"
version = "2.2.2"
version = "2.2.3"
description = "Agno: a lightweight library for building Multi-Agent Systems"
requires-python = ">=3.7,<4"
readme = "README.md"
Expand Down
Loading