agno 2.3.24__py3-none-any.whl → 2.3.26__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/agent.py +357 -28
- agno/db/base.py +214 -0
- agno/db/dynamo/dynamo.py +47 -0
- agno/db/firestore/firestore.py +47 -0
- agno/db/gcs_json/gcs_json_db.py +47 -0
- agno/db/in_memory/in_memory_db.py +47 -0
- agno/db/json/json_db.py +47 -0
- agno/db/mongo/async_mongo.py +229 -0
- agno/db/mongo/mongo.py +47 -0
- agno/db/mongo/schemas.py +16 -0
- agno/db/mysql/async_mysql.py +47 -0
- agno/db/mysql/mysql.py +47 -0
- agno/db/postgres/async_postgres.py +231 -0
- agno/db/postgres/postgres.py +239 -0
- agno/db/postgres/schemas.py +19 -0
- agno/db/redis/redis.py +47 -0
- agno/db/singlestore/singlestore.py +47 -0
- agno/db/sqlite/async_sqlite.py +242 -0
- agno/db/sqlite/schemas.py +18 -0
- agno/db/sqlite/sqlite.py +239 -0
- agno/db/surrealdb/surrealdb.py +47 -0
- agno/knowledge/chunking/code.py +90 -0
- agno/knowledge/chunking/document.py +62 -2
- agno/knowledge/chunking/strategy.py +14 -0
- agno/knowledge/knowledge.py +7 -1
- agno/knowledge/reader/arxiv_reader.py +1 -0
- agno/knowledge/reader/csv_reader.py +1 -0
- agno/knowledge/reader/docx_reader.py +1 -0
- agno/knowledge/reader/firecrawl_reader.py +1 -0
- agno/knowledge/reader/json_reader.py +1 -0
- agno/knowledge/reader/markdown_reader.py +1 -0
- agno/knowledge/reader/pdf_reader.py +1 -0
- agno/knowledge/reader/pptx_reader.py +1 -0
- agno/knowledge/reader/s3_reader.py +1 -0
- agno/knowledge/reader/tavily_reader.py +1 -0
- agno/knowledge/reader/text_reader.py +1 -0
- agno/knowledge/reader/web_search_reader.py +1 -0
- agno/knowledge/reader/website_reader.py +1 -0
- agno/knowledge/reader/wikipedia_reader.py +1 -0
- agno/knowledge/reader/youtube_reader.py +1 -0
- agno/knowledge/utils.py +1 -0
- agno/learn/__init__.py +65 -0
- agno/learn/config.py +463 -0
- agno/learn/curate.py +185 -0
- agno/learn/machine.py +690 -0
- agno/learn/schemas.py +1043 -0
- agno/learn/stores/__init__.py +35 -0
- agno/learn/stores/entity_memory.py +3275 -0
- agno/learn/stores/learned_knowledge.py +1583 -0
- agno/learn/stores/protocol.py +117 -0
- agno/learn/stores/session_context.py +1217 -0
- agno/learn/stores/user_memory.py +1495 -0
- agno/learn/stores/user_profile.py +1220 -0
- agno/learn/utils.py +209 -0
- agno/models/base.py +59 -0
- agno/os/routers/agents/router.py +4 -4
- agno/os/routers/knowledge/knowledge.py +7 -0
- agno/os/routers/teams/router.py +3 -3
- agno/os/routers/workflows/router.py +5 -5
- agno/os/utils.py +55 -3
- agno/team/team.py +131 -0
- agno/tools/browserbase.py +78 -6
- agno/tools/google_bigquery.py +11 -2
- agno/utils/agent.py +30 -1
- agno/workflow/workflow.py +198 -0
- {agno-2.3.24.dist-info → agno-2.3.26.dist-info}/METADATA +24 -2
- {agno-2.3.24.dist-info → agno-2.3.26.dist-info}/RECORD +70 -56
- {agno-2.3.24.dist-info → agno-2.3.26.dist-info}/WHEEL +0 -0
- {agno-2.3.24.dist-info → agno-2.3.26.dist-info}/licenses/LICENSE +0 -0
- {agno-2.3.24.dist-info → agno-2.3.26.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Learning Store Protocol
|
|
3
|
+
=======================
|
|
4
|
+
Defines the interface that all learning stores must implement.
|
|
5
|
+
|
|
6
|
+
This protocol enables:
|
|
7
|
+
- Consistent API across different learning types
|
|
8
|
+
- Easy addition of custom stores
|
|
9
|
+
- Type safety with Protocol typing
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from typing import Any, Callable, List, Optional, Protocol, runtime_checkable
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@runtime_checkable
|
|
16
|
+
class LearningStore(Protocol):
|
|
17
|
+
"""Protocol that all learning stores must implement.
|
|
18
|
+
|
|
19
|
+
A learning store handles one type of learning (user profile, session context,
|
|
20
|
+
learned knowledge, etc.) and provides methods for:
|
|
21
|
+
|
|
22
|
+
- recall: Retrieve relevant data for the current context
|
|
23
|
+
- process: Extract and save learnings from conversations
|
|
24
|
+
- build_context: Format data for inclusion in agent prompts
|
|
25
|
+
- get_tools: Provide tools for agent interaction
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def learning_type(self) -> str:
|
|
30
|
+
"""Unique identifier for this learning type.
|
|
31
|
+
|
|
32
|
+
Used for storage keys and logging.
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
String identifier (e.g., "user_profile", "session_context")
|
|
36
|
+
"""
|
|
37
|
+
...
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def schema(self) -> Any:
|
|
41
|
+
"""Schema class used for this learning type.
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
The dataclass or schema class for this learning type.
|
|
45
|
+
"""
|
|
46
|
+
...
|
|
47
|
+
|
|
48
|
+
def recall(self, **kwargs) -> Optional[Any]:
|
|
49
|
+
"""Retrieve relevant data for the current context.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
**kwargs: Context including user_id, session_id, message, etc.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Retrieved data (schema instance, list, or None if not found).
|
|
56
|
+
"""
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
async def arecall(self, **kwargs) -> Optional[Any]:
|
|
60
|
+
"""Async version of recall."""
|
|
61
|
+
...
|
|
62
|
+
|
|
63
|
+
def process(self, messages: List[Any], **kwargs) -> None:
|
|
64
|
+
"""Extract and save learnings from messages.
|
|
65
|
+
|
|
66
|
+
Called after a conversation to extract learnings.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
messages: Conversation messages to analyze.
|
|
70
|
+
**kwargs: Context including user_id, session_id, etc.
|
|
71
|
+
"""
|
|
72
|
+
...
|
|
73
|
+
|
|
74
|
+
async def aprocess(self, messages: List[Any], **kwargs) -> None:
|
|
75
|
+
"""Async version of process."""
|
|
76
|
+
...
|
|
77
|
+
|
|
78
|
+
def build_context(self, data: Any) -> str:
|
|
79
|
+
"""Build context string for agent prompts.
|
|
80
|
+
|
|
81
|
+
Formats the recalled data into a string that can be
|
|
82
|
+
injected into the agent's system prompt.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
data: Data returned from recall().
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
Formatted context string, or empty string if no data.
|
|
89
|
+
"""
|
|
90
|
+
...
|
|
91
|
+
|
|
92
|
+
def get_tools(self, **kwargs) -> List[Callable]:
|
|
93
|
+
"""Get tools to expose to the agent.
|
|
94
|
+
|
|
95
|
+
Returns callable tools that the agent can use to interact
|
|
96
|
+
with this learning type (e.g., update_user_memory, search_learnings).
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
**kwargs: Context including user_id, session_id, etc.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
List of callable tools, or empty list if no tools.
|
|
103
|
+
"""
|
|
104
|
+
...
|
|
105
|
+
|
|
106
|
+
async def aget_tools(self, **kwargs) -> List[Callable]:
|
|
107
|
+
"""Async version of get_tools."""
|
|
108
|
+
...
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def was_updated(self) -> bool:
|
|
112
|
+
"""Check if the store was updated in the last operation.
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
True if data was saved/updated, False otherwise.
|
|
116
|
+
"""
|
|
117
|
+
...
|