agno 2.3.26__py3-none-any.whl → 2.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agno/agent/__init__.py +4 -0
- agno/agent/agent.py +1368 -541
- agno/agent/remote.py +13 -0
- agno/db/base.py +339 -0
- agno/db/postgres/async_postgres.py +116 -12
- agno/db/postgres/postgres.py +1242 -25
- agno/db/postgres/schemas.py +48 -1
- agno/db/sqlite/async_sqlite.py +119 -4
- agno/db/sqlite/schemas.py +51 -0
- agno/db/sqlite/sqlite.py +1186 -13
- agno/db/utils.py +37 -1
- agno/integrations/discord/client.py +12 -1
- agno/knowledge/__init__.py +4 -0
- agno/knowledge/chunking/code.py +1 -1
- agno/knowledge/chunking/semantic.py +1 -1
- agno/knowledge/chunking/strategy.py +4 -0
- agno/knowledge/filesystem.py +412 -0
- agno/knowledge/knowledge.py +3722 -2182
- agno/knowledge/protocol.py +134 -0
- agno/knowledge/reader/arxiv_reader.py +2 -2
- agno/knowledge/reader/base.py +9 -7
- agno/knowledge/reader/csv_reader.py +236 -13
- agno/knowledge/reader/docx_reader.py +2 -2
- agno/knowledge/reader/field_labeled_csv_reader.py +169 -5
- agno/knowledge/reader/firecrawl_reader.py +2 -2
- agno/knowledge/reader/json_reader.py +2 -2
- agno/knowledge/reader/markdown_reader.py +2 -2
- agno/knowledge/reader/pdf_reader.py +5 -4
- agno/knowledge/reader/pptx_reader.py +2 -2
- agno/knowledge/reader/reader_factory.py +118 -1
- agno/knowledge/reader/s3_reader.py +2 -2
- agno/knowledge/reader/tavily_reader.py +2 -2
- agno/knowledge/reader/text_reader.py +2 -2
- agno/knowledge/reader/web_search_reader.py +2 -2
- agno/knowledge/reader/website_reader.py +5 -3
- agno/knowledge/reader/wikipedia_reader.py +2 -2
- agno/knowledge/reader/youtube_reader.py +2 -2
- agno/knowledge/remote_content/__init__.py +29 -0
- agno/knowledge/remote_content/config.py +204 -0
- agno/knowledge/remote_content/remote_content.py +74 -17
- agno/knowledge/utils.py +37 -29
- agno/learn/__init__.py +6 -0
- agno/learn/machine.py +35 -0
- agno/learn/schemas.py +82 -11
- agno/learn/stores/__init__.py +3 -0
- agno/learn/stores/decision_log.py +1156 -0
- agno/learn/stores/learned_knowledge.py +6 -6
- agno/models/anthropic/claude.py +24 -0
- agno/models/aws/bedrock.py +20 -0
- agno/models/base.py +60 -6
- agno/models/cerebras/cerebras.py +34 -2
- agno/models/cohere/chat.py +25 -0
- agno/models/google/gemini.py +50 -5
- agno/models/litellm/chat.py +38 -0
- agno/models/n1n/__init__.py +3 -0
- agno/models/n1n/n1n.py +57 -0
- agno/models/openai/chat.py +25 -1
- agno/models/openrouter/openrouter.py +46 -0
- agno/models/perplexity/perplexity.py +2 -0
- agno/models/response.py +16 -0
- agno/os/app.py +83 -44
- agno/os/interfaces/slack/router.py +10 -1
- agno/os/interfaces/whatsapp/router.py +6 -0
- agno/os/middleware/__init__.py +2 -0
- agno/os/middleware/trailing_slash.py +27 -0
- agno/os/router.py +1 -0
- agno/os/routers/agents/router.py +29 -16
- agno/os/routers/agents/schema.py +6 -4
- agno/os/routers/components/__init__.py +3 -0
- agno/os/routers/components/components.py +475 -0
- agno/os/routers/evals/schemas.py +4 -3
- agno/os/routers/health.py +3 -3
- agno/os/routers/knowledge/knowledge.py +128 -3
- agno/os/routers/knowledge/schemas.py +12 -0
- agno/os/routers/memory/schemas.py +4 -2
- agno/os/routers/metrics/metrics.py +9 -11
- agno/os/routers/metrics/schemas.py +10 -6
- agno/os/routers/registry/__init__.py +3 -0
- agno/os/routers/registry/registry.py +337 -0
- agno/os/routers/teams/router.py +20 -8
- agno/os/routers/teams/schema.py +6 -4
- agno/os/routers/traces/traces.py +5 -5
- agno/os/routers/workflows/router.py +38 -11
- agno/os/routers/workflows/schema.py +1 -1
- agno/os/schema.py +92 -26
- agno/os/utils.py +84 -19
- agno/reasoning/anthropic.py +2 -2
- agno/reasoning/azure_ai_foundry.py +2 -2
- agno/reasoning/deepseek.py +2 -2
- agno/reasoning/default.py +6 -7
- agno/reasoning/gemini.py +2 -2
- agno/reasoning/helpers.py +6 -7
- agno/reasoning/manager.py +4 -10
- agno/reasoning/ollama.py +2 -2
- agno/reasoning/openai.py +2 -2
- agno/reasoning/vertexai.py +2 -2
- agno/registry/__init__.py +3 -0
- agno/registry/registry.py +68 -0
- agno/run/agent.py +59 -0
- agno/run/base.py +7 -0
- agno/run/team.py +57 -0
- agno/skills/agent_skills.py +10 -3
- agno/team/__init__.py +3 -1
- agno/team/team.py +1165 -330
- agno/tools/duckduckgo.py +25 -71
- agno/tools/exa.py +0 -21
- agno/tools/function.py +35 -83
- agno/tools/knowledge.py +9 -4
- agno/tools/mem0.py +11 -10
- agno/tools/memory.py +47 -46
- agno/tools/parallel.py +0 -7
- agno/tools/reasoning.py +30 -23
- agno/tools/tavily.py +4 -1
- agno/tools/websearch.py +93 -0
- agno/tools/website.py +1 -1
- agno/tools/wikipedia.py +1 -1
- agno/tools/workflow.py +48 -47
- agno/utils/agent.py +42 -5
- agno/utils/events.py +160 -2
- agno/utils/print_response/agent.py +0 -31
- agno/utils/print_response/team.py +0 -2
- agno/utils/print_response/workflow.py +0 -2
- agno/utils/team.py +61 -11
- agno/vectordb/lancedb/lance_db.py +4 -1
- agno/vectordb/mongodb/mongodb.py +1 -1
- agno/vectordb/pgvector/pgvector.py +3 -3
- agno/vectordb/qdrant/qdrant.py +4 -4
- agno/workflow/__init__.py +3 -1
- agno/workflow/condition.py +0 -21
- agno/workflow/loop.py +0 -21
- agno/workflow/parallel.py +0 -21
- agno/workflow/router.py +0 -21
- agno/workflow/step.py +117 -24
- agno/workflow/steps.py +0 -21
- agno/workflow/workflow.py +427 -63
- {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/METADATA +49 -76
- {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/RECORD +140 -126
- {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/WHEEL +1 -1
- {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/licenses/LICENSE +0 -0
- {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/top_level.txt +0 -0
agno/learn/schemas.py
CHANGED
|
@@ -893,22 +893,72 @@ class SessionPlanningExtractionResponse:
|
|
|
893
893
|
|
|
894
894
|
|
|
895
895
|
@dataclass
|
|
896
|
-
class
|
|
897
|
-
"""Schema for Decision Logs.
|
|
896
|
+
class DecisionLog:
|
|
897
|
+
"""Schema for Decision Logs.
|
|
898
898
|
|
|
899
899
|
Records decisions made by the agent with reasoning and context.
|
|
900
|
+
Useful for:
|
|
901
|
+
- Auditing agent behavior
|
|
902
|
+
- Learning from past decisions
|
|
903
|
+
- Debugging unexpected outcomes
|
|
904
|
+
- Building feedback loops
|
|
905
|
+
|
|
906
|
+
Example:
|
|
907
|
+
DecisionLog(
|
|
908
|
+
id="dec_abc123",
|
|
909
|
+
decision="Used web search instead of knowledge base",
|
|
910
|
+
reasoning="User asked about current events which require fresh data",
|
|
911
|
+
decision_type="tool_selection",
|
|
912
|
+
context="User query: 'What happened in the news today?'",
|
|
913
|
+
alternatives=["search_knowledge_base", "ask_for_clarification"],
|
|
914
|
+
confidence=0.85,
|
|
915
|
+
)
|
|
916
|
+
|
|
917
|
+
Attributes:
|
|
918
|
+
id: Unique identifier for this decision.
|
|
919
|
+
decision: What was decided (the choice made).
|
|
920
|
+
reasoning: Why this decision was made.
|
|
921
|
+
decision_type: Category of decision (tool_selection, response_style, etc).
|
|
922
|
+
context: The situation that required a decision.
|
|
923
|
+
alternatives: Other options that were considered.
|
|
924
|
+
confidence: How confident the agent was (0.0 to 1.0).
|
|
925
|
+
outcome: What happened as a result (can be updated later).
|
|
926
|
+
outcome_quality: Was the outcome good/bad/neutral.
|
|
927
|
+
tags: Categories for organization.
|
|
928
|
+
session_id: Which session this decision was made in.
|
|
929
|
+
user_id: Which user this decision was for.
|
|
930
|
+
agent_id: Which agent made this decision.
|
|
931
|
+
team_id: Which team context.
|
|
932
|
+
created_at: When the decision was made.
|
|
933
|
+
updated_at: When the outcome was recorded.
|
|
900
934
|
"""
|
|
901
935
|
|
|
936
|
+
id: str
|
|
902
937
|
decision: str
|
|
903
|
-
reasoning: Optional[str] = None
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
938
|
+
reasoning: Optional[str] = field(default=None, metadata={"description": "Why this decision was made"})
|
|
939
|
+
decision_type: Optional[str] = field(
|
|
940
|
+
default=None,
|
|
941
|
+
metadata={"description": "Category: tool_selection, response_style, clarification, escalation, etc"},
|
|
942
|
+
)
|
|
943
|
+
context: Optional[str] = field(default=None, metadata={"description": "The situation that required a decision"})
|
|
944
|
+
alternatives: Optional[List[str]] = field(
|
|
945
|
+
default=None, metadata={"description": "Other options that were considered"}
|
|
946
|
+
)
|
|
947
|
+
confidence: Optional[float] = field(default=None, metadata={"description": "Confidence level 0.0 to 1.0"})
|
|
948
|
+
outcome: Optional[str] = field(default=None, metadata={"description": "What happened as a result"})
|
|
949
|
+
outcome_quality: Optional[str] = field(default=None, metadata={"description": "Was outcome good/bad/neutral"})
|
|
950
|
+
tags: Optional[List[str]] = field(default=None, metadata={"description": "Categories for organization"})
|
|
951
|
+
|
|
952
|
+
# Scope
|
|
953
|
+
session_id: Optional[str] = field(default=None, metadata={"internal": True})
|
|
954
|
+
user_id: Optional[str] = field(default=None, metadata={"internal": True})
|
|
955
|
+
agent_id: Optional[str] = field(default=None, metadata={"internal": True})
|
|
956
|
+
team_id: Optional[str] = field(default=None, metadata={"internal": True})
|
|
957
|
+
created_at: Optional[str] = field(default=None, metadata={"internal": True})
|
|
958
|
+
updated_at: Optional[str] = field(default=None, metadata={"internal": True})
|
|
909
959
|
|
|
910
960
|
@classmethod
|
|
911
|
-
def from_dict(cls, data: Any) -> Optional["
|
|
961
|
+
def from_dict(cls, data: Any) -> Optional["DecisionLog"]:
|
|
912
962
|
"""Parse from dict/JSON, returning None on any failure."""
|
|
913
963
|
if data is None:
|
|
914
964
|
return None
|
|
@@ -921,8 +971,9 @@ class Decision:
|
|
|
921
971
|
log_debug(f"{cls.__name__}.from_dict: _parse_json returned None for data={_truncate_for_log(data)}")
|
|
922
972
|
return None
|
|
923
973
|
|
|
924
|
-
|
|
925
|
-
|
|
974
|
+
# id and decision are required
|
|
975
|
+
if not parsed.get("id") or not parsed.get("decision"):
|
|
976
|
+
log_debug(f"{cls.__name__}.from_dict: missing required fields 'id' or 'decision'")
|
|
926
977
|
return None
|
|
927
978
|
|
|
928
979
|
field_names = {f.name for f in fields(cls)}
|
|
@@ -941,6 +992,26 @@ class Decision:
|
|
|
941
992
|
log_debug(f"{self.__class__.__name__}.to_dict failed: {e}")
|
|
942
993
|
return {}
|
|
943
994
|
|
|
995
|
+
def to_text(self) -> str:
|
|
996
|
+
"""Convert to searchable text format."""
|
|
997
|
+
parts = [f"Decision: {self.decision}"]
|
|
998
|
+
if self.reasoning:
|
|
999
|
+
parts.append(f"Reasoning: {self.reasoning}")
|
|
1000
|
+
if self.context:
|
|
1001
|
+
parts.append(f"Context: {self.context}")
|
|
1002
|
+
if self.decision_type:
|
|
1003
|
+
parts.append(f"Type: {self.decision_type}")
|
|
1004
|
+
if self.outcome:
|
|
1005
|
+
parts.append(f"Outcome: {self.outcome}")
|
|
1006
|
+
return "\n".join(parts)
|
|
1007
|
+
|
|
1008
|
+
def __repr__(self) -> str:
|
|
1009
|
+
return f"DecisionLog(id={self.id}, decision={self.decision[:50]}...)"
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
# Backwards compatibility alias
|
|
1013
|
+
Decision = DecisionLog
|
|
1014
|
+
|
|
944
1015
|
|
|
945
1016
|
@dataclass
|
|
946
1017
|
class Feedback:
|
agno/learn/stores/__init__.py
CHANGED
|
@@ -15,8 +15,10 @@ Available Stores:
|
|
|
15
15
|
- SessionContextStore: Current session state
|
|
16
16
|
- LearnedKnowledgeStore: Reusable knowledge/insights
|
|
17
17
|
- EntityMemoryStore: Third-party entity facts
|
|
18
|
+
- DecisionLogStore: Agent decision logging (Phase 2)
|
|
18
19
|
"""
|
|
19
20
|
|
|
21
|
+
from agno.learn.stores.decision_log import DecisionLogStore
|
|
20
22
|
from agno.learn.stores.entity_memory import EntityMemoryStore
|
|
21
23
|
from agno.learn.stores.learned_knowledge import LearnedKnowledgeStore
|
|
22
24
|
from agno.learn.stores.protocol import LearningStore
|
|
@@ -32,4 +34,5 @@ __all__ = [
|
|
|
32
34
|
"SessionContextStore",
|
|
33
35
|
"LearnedKnowledgeStore",
|
|
34
36
|
"EntityMemoryStore",
|
|
37
|
+
"DecisionLogStore",
|
|
35
38
|
]
|