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.
Files changed (140) hide show
  1. agno/agent/__init__.py +4 -0
  2. agno/agent/agent.py +1368 -541
  3. agno/agent/remote.py +13 -0
  4. agno/db/base.py +339 -0
  5. agno/db/postgres/async_postgres.py +116 -12
  6. agno/db/postgres/postgres.py +1242 -25
  7. agno/db/postgres/schemas.py +48 -1
  8. agno/db/sqlite/async_sqlite.py +119 -4
  9. agno/db/sqlite/schemas.py +51 -0
  10. agno/db/sqlite/sqlite.py +1186 -13
  11. agno/db/utils.py +37 -1
  12. agno/integrations/discord/client.py +12 -1
  13. agno/knowledge/__init__.py +4 -0
  14. agno/knowledge/chunking/code.py +1 -1
  15. agno/knowledge/chunking/semantic.py +1 -1
  16. agno/knowledge/chunking/strategy.py +4 -0
  17. agno/knowledge/filesystem.py +412 -0
  18. agno/knowledge/knowledge.py +3722 -2182
  19. agno/knowledge/protocol.py +134 -0
  20. agno/knowledge/reader/arxiv_reader.py +2 -2
  21. agno/knowledge/reader/base.py +9 -7
  22. agno/knowledge/reader/csv_reader.py +236 -13
  23. agno/knowledge/reader/docx_reader.py +2 -2
  24. agno/knowledge/reader/field_labeled_csv_reader.py +169 -5
  25. agno/knowledge/reader/firecrawl_reader.py +2 -2
  26. agno/knowledge/reader/json_reader.py +2 -2
  27. agno/knowledge/reader/markdown_reader.py +2 -2
  28. agno/knowledge/reader/pdf_reader.py +5 -4
  29. agno/knowledge/reader/pptx_reader.py +2 -2
  30. agno/knowledge/reader/reader_factory.py +118 -1
  31. agno/knowledge/reader/s3_reader.py +2 -2
  32. agno/knowledge/reader/tavily_reader.py +2 -2
  33. agno/knowledge/reader/text_reader.py +2 -2
  34. agno/knowledge/reader/web_search_reader.py +2 -2
  35. agno/knowledge/reader/website_reader.py +5 -3
  36. agno/knowledge/reader/wikipedia_reader.py +2 -2
  37. agno/knowledge/reader/youtube_reader.py +2 -2
  38. agno/knowledge/remote_content/__init__.py +29 -0
  39. agno/knowledge/remote_content/config.py +204 -0
  40. agno/knowledge/remote_content/remote_content.py +74 -17
  41. agno/knowledge/utils.py +37 -29
  42. agno/learn/__init__.py +6 -0
  43. agno/learn/machine.py +35 -0
  44. agno/learn/schemas.py +82 -11
  45. agno/learn/stores/__init__.py +3 -0
  46. agno/learn/stores/decision_log.py +1156 -0
  47. agno/learn/stores/learned_knowledge.py +6 -6
  48. agno/models/anthropic/claude.py +24 -0
  49. agno/models/aws/bedrock.py +20 -0
  50. agno/models/base.py +60 -6
  51. agno/models/cerebras/cerebras.py +34 -2
  52. agno/models/cohere/chat.py +25 -0
  53. agno/models/google/gemini.py +50 -5
  54. agno/models/litellm/chat.py +38 -0
  55. agno/models/n1n/__init__.py +3 -0
  56. agno/models/n1n/n1n.py +57 -0
  57. agno/models/openai/chat.py +25 -1
  58. agno/models/openrouter/openrouter.py +46 -0
  59. agno/models/perplexity/perplexity.py +2 -0
  60. agno/models/response.py +16 -0
  61. agno/os/app.py +83 -44
  62. agno/os/interfaces/slack/router.py +10 -1
  63. agno/os/interfaces/whatsapp/router.py +6 -0
  64. agno/os/middleware/__init__.py +2 -0
  65. agno/os/middleware/trailing_slash.py +27 -0
  66. agno/os/router.py +1 -0
  67. agno/os/routers/agents/router.py +29 -16
  68. agno/os/routers/agents/schema.py +6 -4
  69. agno/os/routers/components/__init__.py +3 -0
  70. agno/os/routers/components/components.py +475 -0
  71. agno/os/routers/evals/schemas.py +4 -3
  72. agno/os/routers/health.py +3 -3
  73. agno/os/routers/knowledge/knowledge.py +128 -3
  74. agno/os/routers/knowledge/schemas.py +12 -0
  75. agno/os/routers/memory/schemas.py +4 -2
  76. agno/os/routers/metrics/metrics.py +9 -11
  77. agno/os/routers/metrics/schemas.py +10 -6
  78. agno/os/routers/registry/__init__.py +3 -0
  79. agno/os/routers/registry/registry.py +337 -0
  80. agno/os/routers/teams/router.py +20 -8
  81. agno/os/routers/teams/schema.py +6 -4
  82. agno/os/routers/traces/traces.py +5 -5
  83. agno/os/routers/workflows/router.py +38 -11
  84. agno/os/routers/workflows/schema.py +1 -1
  85. agno/os/schema.py +92 -26
  86. agno/os/utils.py +84 -19
  87. agno/reasoning/anthropic.py +2 -2
  88. agno/reasoning/azure_ai_foundry.py +2 -2
  89. agno/reasoning/deepseek.py +2 -2
  90. agno/reasoning/default.py +6 -7
  91. agno/reasoning/gemini.py +2 -2
  92. agno/reasoning/helpers.py +6 -7
  93. agno/reasoning/manager.py +4 -10
  94. agno/reasoning/ollama.py +2 -2
  95. agno/reasoning/openai.py +2 -2
  96. agno/reasoning/vertexai.py +2 -2
  97. agno/registry/__init__.py +3 -0
  98. agno/registry/registry.py +68 -0
  99. agno/run/agent.py +59 -0
  100. agno/run/base.py +7 -0
  101. agno/run/team.py +57 -0
  102. agno/skills/agent_skills.py +10 -3
  103. agno/team/__init__.py +3 -1
  104. agno/team/team.py +1165 -330
  105. agno/tools/duckduckgo.py +25 -71
  106. agno/tools/exa.py +0 -21
  107. agno/tools/function.py +35 -83
  108. agno/tools/knowledge.py +9 -4
  109. agno/tools/mem0.py +11 -10
  110. agno/tools/memory.py +47 -46
  111. agno/tools/parallel.py +0 -7
  112. agno/tools/reasoning.py +30 -23
  113. agno/tools/tavily.py +4 -1
  114. agno/tools/websearch.py +93 -0
  115. agno/tools/website.py +1 -1
  116. agno/tools/wikipedia.py +1 -1
  117. agno/tools/workflow.py +48 -47
  118. agno/utils/agent.py +42 -5
  119. agno/utils/events.py +160 -2
  120. agno/utils/print_response/agent.py +0 -31
  121. agno/utils/print_response/team.py +0 -2
  122. agno/utils/print_response/workflow.py +0 -2
  123. agno/utils/team.py +61 -11
  124. agno/vectordb/lancedb/lance_db.py +4 -1
  125. agno/vectordb/mongodb/mongodb.py +1 -1
  126. agno/vectordb/pgvector/pgvector.py +3 -3
  127. agno/vectordb/qdrant/qdrant.py +4 -4
  128. agno/workflow/__init__.py +3 -1
  129. agno/workflow/condition.py +0 -21
  130. agno/workflow/loop.py +0 -21
  131. agno/workflow/parallel.py +0 -21
  132. agno/workflow/router.py +0 -21
  133. agno/workflow/step.py +117 -24
  134. agno/workflow/steps.py +0 -21
  135. agno/workflow/workflow.py +427 -63
  136. {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/METADATA +49 -76
  137. {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/RECORD +140 -126
  138. {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/WHEEL +1 -1
  139. {agno-2.3.26.dist-info → agno-2.4.1.dist-info}/licenses/LICENSE +0 -0
  140. {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 Decision:
897
- """Schema for Decision Logs. (Phase 2)
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
- context: Optional[str] = None
905
- outcome: Optional[str] = None
906
- agent_id: Optional[str] = None
907
- team_id: Optional[str] = None
908
- created_at: Optional[str] = None
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["Decision"]:
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
- if not parsed.get("decision"):
925
- log_debug(f"{cls.__name__}.from_dict: missing required field 'decision'")
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:
@@ -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
  ]