You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agents/memory.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Memory
4
4
5
5
If you're building intelligent agents, you need to give them memory **which is their ability to learn about the user they are interacting with**. Memory comes in 3 shapes:
6
6
7
-
1.**Session Storage:** Session storage saves sessions in a database and enables Agents to have multi-turn conversations. Session storage also holds the session state, which is persistent across runs because it is saved to the database after each run. Session storage is a form of short-term memory **called "Storage" in Agno**.
7
+
1.**Session Storage:** Session storage saves sessions in a database and enables Agents to have multi-turn conversations. Session storage also holds the session state, which is persisted across runs because it is saved to the database after each run. Session storage is a form of short-term memory **called "Storage" in Agno**.
8
8
9
9
2.**User Memories:** The Agent can also store insights and facts about the user it learns over time. This helps the agents personalize its response to the user it is interacting with. Think of this as adding "ChatGPT like memory" to your agent. **This is called "Memory" in Agno**.
Copy file name to clipboardExpand all lines: agents/storage.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: Storage
6
6
7
7
Agents come with built-in memory but it only lasts while the session is active.
8
8
9
-
To persist history and state across runs, we can provide `AgentStorage` which saves an Agent's session to a database or file. Storage has typically been an under-discussed part of agentic infrastructure, but we see it as one of the most critical pieces of the stack.
9
+
To persist session history and state across runs, we can provide `AgentStorage` which saves an Agent's session to a database or file. Storage has typically been an under-discussed part of agentic infrastructure, but we see it as one of the most critical pieces of the stack.
10
10
11
11
While storage is absolutely necessary when building user facing AI products as any production application will need to be able to retrieve sessions, continue sessions, and save state between runs. There is so much more:
12
12
- Storage saves our Agent's session data for inspection and evaluations.
Copy file name to clipboardExpand all lines: introduction/agents.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@ Set `debug_mode=True` or `export AGNO_DEBUG=true` to see the system prompt, user
167
167
168
168
## Agent with reasoning
169
169
170
-
Agents can also **"think" & "reason"** to solve problems that require more than one step. The `ReasoningTools` is one of the best "hacks" to improve the Agents's response quality.
170
+
Agents can also **"think" & "analyze"** to solve problems that require more than one step. The `ReasoningTools` is one of the best "hacks" to improve the Agents's response quality.
Copy file name to clipboardExpand all lines: knowledge/introduction.mdx
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,19 @@
2
2
title: Introduction
3
3
---
4
4
5
-
A **knowledge base** is a database of information that an agent can search to improve its responses. This information is stored in a vector database and provides agents with business context, helping them respond in a context-aware manner. The general syntax is:
5
+
**Knowledge** is domain-specific information that the Agent can **search** at runtime to make better decisions (dynamic few-shot learning) or provide accurate responses (agentic RAG). Knowledge is stored in a vector db and this **searching on demand** pattern is known as Agentic RAG.
Example: If we're building a Text2Sql Agent, we'll need to give the table schemas, column names, data types, example queries, common "gotchas" to help it generate the best-possible SQL query.
9
+
10
+
We're obviously not going to put this all in the system prompt, instead we store this information in a vector database and let the Agent query it at runtime.
11
+
12
+
Using this information, the Agent can then generate the best-possible SQL query. This is called dynamic few-shot learning.
13
+
</Accordion>
14
+
15
+
**Agno Agents use Agentic RAG** by default, meaning if you add `knowledge` to an Agent, it will search this knowledge base, at runtime, for the specific information it needs to achieve its task.
16
+
17
+
The simplest example of how to add knowledge to an Agent is:
6
18
7
19
```python
8
20
from agno.agent import Agent, AgentKnowledge
@@ -18,6 +30,24 @@ knowledge_base.load_text("The sky is blue")
We can give our agent access to the knowledge base in the following ways:
34
+
35
+
- We can set `search_knowledge=True` to add a `search_knowledge_base()` tool to the Agent. `search_knowledge` is `True`**by default** if you add `knowledge` to an Agent.
36
+
- We can set `add_references=True` to automatically add references from the knowledge base to the Agent's prompt. This is the traditional 2023 RAG approach.
37
+
38
+
<Tip>
39
+
40
+
If you need complete control over the knowledge base search, you can pass your own `retriever` function with the following signature:
This function is called during `search_knowledge_base()` and is used by the Agent to retrieve references from the knowledge base.
48
+
49
+
</Tip>
50
+
21
51
## Vector Databases
22
52
23
53
While any type of storage can act as a knowledge base, vector databases offer the best solution for retrieving relevant results from dense information quickly. Here's how vector databases are used with Agents:
If you're building intelligent agents, you need to give them memory which is the ability to **remember**, **reason** and **personalize** responses to users. Memory comes in 3 shapes:
7
+
If you're building intelligent agents, you need to give them memory **which is their ability to learn about the user they are interacting with**. Memory comes in 3 shapes:
8
8
9
-
1.**Chat History:** This is the current conversation between users and the agent, stored as sessions in chronological order. This is the most basic form of memory and **called "Storage" in Agno**.
10
-
2.**User Memories:** Insights and facts about users extracted from conversations, helping agents personalize their responses to users. Think of this as adding a "ChatGPT like memory" to your agent. **This is called "Memory" in Agno**.
11
-
3.**Session Summaries:** Condensed representations of conversations, useful when chat histories grow too long. **This is called "Summary" in Agno**.
9
+
1.**Session Storage:** Session storage saves sessions in a database and enables Agents to have multi-turn conversations. Session storage also holds the session state, which is persisted across runs because it is saved to the database after each run. Session storage is a form of short-term memory **called "Storage" in Agno**.
10
+
11
+
2.**User Memories:** The Agent can also store insights and facts about the user it learns over time. This helps the agents personalize its response to the user it is interacting with. Think of this as adding "ChatGPT like memory" to your agent. **This is called "Memory" in Agno**.
12
+
13
+
3.**Session Summaries:** The Agent can store a condensed representations of the session, useful when chat histories gets too long. **This is called "Summary" in Agno**.
When we speak about Memory, the commonly agreed upon understanding of Memory is the ability to store insights and facts about the user the Agent is interacting with. In short, build a persona of the user, learn about their preferences and use that to personalize the Agent's response.
23
+
24
+
### Agentic Memory
25
+
26
+
Agno Agents natively support Agentic Memory Management and recommend it as the best way to give Agents memory.
27
+
28
+
With Agentic Memory, The Agent itself creates, updates and deletes memories from user conversations.
29
+
30
+
Set `enable_agentic_memory=True` to enable Agentic Memory.
31
+
32
+
```python agentic_memory.py
33
+
from agno.agent.agent import Agent
34
+
from agno.memory.v2.db.sqlite import SqliteMemoryDb
Memory is critical for personal assistants, it allows Agents to "Remember" and "Personalize" their responses to users. Learn more about agent memory [here](/agents/memory) and about managing sessions [here](/agents/sessions).
82
+
Set `enable_user_memories=True` to trigger the `MemoryManager` after each run. We recommend using Agentic Memory but this option is there is you need it.
83
+
84
+
```python create_memories_after_each_run.py
85
+
from agno.agent.agent import Agent
86
+
from agno.memory.v2.db.sqlite import SqliteMemoryDb
Copy file name to clipboardExpand all lines: memory/storage.mdx
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,11 @@ title: Storage
4
4
5
5
# Memory Storage
6
6
7
-
Agno's memory system provides persistent storage options to ensure memories are retained across application restarts. This is critical for production applications where users expect consistent experiences over time.
7
+
To persist memories across sessions and application restarts, store memories in a persistent storage like a database.
8
+
9
+
If you're using Memory in production, persistent storage is critical as you'd want to retain user memories across application restarts.
10
+
11
+
Agno's memory system supports multiple persistent storage options.
8
12
9
13
## Storage Options
10
14
@@ -115,14 +119,14 @@ from agno.storage.sqlite import SqliteStorage
Copy file name to clipboardExpand all lines: models/introduction.mdx
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,7 @@
2
2
title: Introduction
3
3
---
4
4
5
-
Language Models are machine-learning programs that are trained to understand natural language and code. They provide reasoning and planning capabilities to Agents.
6
-
7
-
Use any `model` with an `Agent` like:
5
+
Language Models are machine-learning programs that are trained to understand natural language and code. They act as the **brain** of the Agent - helping it reason, act, and respond to the user. Better the model, smarter the Agent.
Copy file name to clipboardExpand all lines: reasoning/introduction.mdx
+22-25Lines changed: 22 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Introduction
3
3
---
4
4
5
-
Reasoning is the ability to **thinkand validate** before responding or taking action.
5
+
**Reasoning** gives Agents the ability to "think" before responding and "analyze" the results of their actions (i.e. tool calls), greatly improving the Agents' ability to solve problems that require sequential tool calls.
6
6
7
7
Reasoning Agents go through an internal chain of thought before responding, working through different ideas, validating and correcting as needed. Agno supports 3 approaches to reasoning:
8
8
1.[Reasoning Models](#reasoning-models)
@@ -35,7 +35,7 @@ Read more about reasoning models in the [Reasoning Models Guide](/reasoning/reas
35
35
36
36
## Reasoning Model + Response Model
37
37
38
-
What if we wanted to use a Reasoning Model to reason but a different model to generate the response? It is well known that reasoning models are great at solving problems but not that great at responding in a natural way (like claude sonnet or gpt-4.5).
38
+
What if we wanted to use a Reasoning Model to reason but a different model to generate the response? It is well known that reasoning models are great at solving problems but not that great at responding in a natural way (like claude sonnet or gpt-4o).
39
39
40
40
By using a separate model for reasoning and a different model for responding, we can have the best of both worlds.
41
41
@@ -65,37 +65,34 @@ The research was first published by Anthropic in [this blog post](https://www.an
0 commit comments