Skip to content

Commit 3121d3e

Browse files
committed
Update docs
1 parent f46bace commit 3121d3e

File tree

8 files changed

+165
-86
lines changed

8 files changed

+165
-86
lines changed

agents/introduction.mdx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,30 @@ title: Introduction
44

55
## What are Agents?
66

7-
**Agents** are intelligent programs that solve problems autonomously.
7+
**Agents** are AI programs that operate autonomously.
88

9-
Agents have memory, domain knowledge and the ability to use tools (like searching the web, querying a database, making API calls). Unlike traditional programs that follow a predefined execution path, Agents dynamically adapt their approach based on the context and tool results.
9+
The core of an Agent is a model, the tools it has access to, and instructions to guide its behavior.
1010

11-
Instead of a rigid binary definition, let's think of Agents in terms of agency and autonomy.
11+
- The **model** acts as the **brain** of the Agent - helping it reason, act, and respond to the user. Better the model, smarter the Agent.
12+
- **Tools** are the **body** of the Agent - enabling it to interact with the real world. "Tool-use" is what makes these systems "Agentic".
13+
- **Instructions** guide the **behavior** of the Agent. Better the model, better it is at following instructions.
1214

13-
- **Level 0**: Agents with no tools (basic inference tasks).
14-
- **Level 1**: Agents with tools for autonomous task execution.
15-
- **Level 2**: Agents with knowledge, combining memory and reasoning.
16-
- **Level 3**: Teams of specialized agents collaborating on complex workflows.
15+
Agents also have **memory**, **knowledge**, **storage** and the ability to **reason**.
16+
17+
- **reasoning:** lets Agents "think" before responding and "analyze" the results of their actions (i.e. tool calls). Reasoning improves the Agents ability to solve problems that require multi-step tool use. Reasoning improves quality, but also increases latency and cost.
18+
- **knowledge:** is domain-specific information the Agent can **_search on demand_** to make better decisions (dynamic few-shot learning) or provide accurate responses (agentic RAG). This knowledge is stored in a vector database and this _**Agent's searching on demand**_ pattern is known as Agentic Search. **Agno (is aiming to) have first class support for the popular Agentic Search pattern, Hybrid Search + Reranking, for every major vector database.**
19+
- **storage:** is used by Agents to save session history and state in a database. Model APIs are stateless and storage enables us to continue conversations across runs using a `session_id`. This makes Agents stateful and enables multi-turn conversations.
20+
- **memory:** gives Agents the ability to store and recall information from previous interactions, allowing them to learn user preferences and personalize their responses. This is an evolving field and Agno is aiming to support the popular Memory patterns.
1721

1822
<img height="200" src="/images/agent.png" style={{ borderRadius: "8px" }} />
1923

20-
If this is your first time building agents, [follow this guide](/agents) and then dive into more advanced concepts.
24+
<Check>
25+
If this is your first time building agents, [follow these examples](/introduction/agents#basic-agent) before diving into advanced concepts.
26+
</Check>
2127

2228
## Example: Research Agent
2329

24-
Let's create a research agent that can search the web using DuckDuckGo, scrape the top links using Newspaper4k and write a research report for us. Ideally we'll use specialized tools (like Exa) but let's start with the free tools first.
30+
Let's build a research agent using Exa to showcase how to guide the Agent to produce the report in a specific format. In advanced cases, we should use [Structured Outputs](/agents/structured-output) instead.
2531

2632
<Note>
2733
The description and instructions are converted to the system message and the

agents/run.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: Agent.run()
44

55
Use the `Agent.run()` function to run the agent and return the response as a `RunResponse` object or a stream of `RunResponse` objects.
66

7+
<Tip>
8+
Many of our examples use `agent.print_response()` but that is just a helper utility to print the response in the terminal. In practice, you should always use `agent.run()`.
9+
</Tip>
10+
711
```python
812
from typing import Iterator
913
from agno.agent import Agent, RunResponse

agents/sessions.mdx

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
---
2-
title:
2+
title: Sessions
33
---
44

5-
Agents are able to maintain a conversation with one or more users. It is important to understand the following concepts:
5+
When we call `Agent.run()`, it creates a stateless, singular Agent run.
66

7-
- **Session:** Each conversation with an Agent is called a **session**. Sessions are identified by a `session_id` and should be unique for each user.
8-
- **Run:** Every interaction (i.e. chat) within a session is called a **run**. Runs are identified by a `run_id`.
9-
- **Messages:** are the individual messages sent to and received from the model. They have a `role` (`system`, `user` or `assistant`) and `content`.
7+
But what if we want to continue this run i.e. have a multi-turn conversation? That's where `sessions` come in. A session is a multi-turn conversation between a user and an Agent. Using a `session_id`, we can maintain conversation history and state across multiple runs.
108

9+
Let's outline some key concepts:
1110

12-
Below is an example where a single run is created with an Agent. A `session_id` is automatically generated and added to the run. This won't be associated with any specific user.
11+
- **Session:** A session is a multi-turn conversation between a user and an Agent. Sessions are identified by a `session_id` and each turn is called a **run**.
12+
- **Run:** Every interaction (i.e. chat or turn) with an Agent is called a **run**. Runs are identified by a `run_id`. `Agent.run()` creates a new `run_id` when called.
13+
- **Messages:** are the individual messages sent to and received from the model. They are the underlying data structure that the Agent and model communicate using. Each run contains a list of messages and each session contains a list of runs.
14+
15+
Let's start with an example where a single run is created with an Agent. A `run_id` is automatically generated, as well as a `session_id` (because we didn't provide one to continue the conversation). This run is not yet associated with a specific user.
1316

1417
```python
1518
from typing import Iterator
@@ -23,22 +26,31 @@ agent = Agent(model=OpenAIChat(id="gpt-4o-mini"))
2326
agent.print_response("Tell me a 5 second short story about a robot")
2427
```
2528

26-
## Multiple Users with Sessions
29+
## Each User gets a Unique Set of Sessions
30+
31+
Each user that is interacting with an Agent maintains a unique set of sessions. Set a `user_id` to connect a user to their sessions.
32+
33+
In the examples below, we set a `session_id` to demo how you can continue multi-turn conversations with multiple users at the same time. In production, the `session_id` is automatically generated.
2734

28-
Sessions are unique for each user. If you want to maintain a conversation with multiple users, you can use the `user_id` and `session_id` to identify the session.
35+
Note: Multi-user, multi-session currently only works with `Memory.v2`.
2936

30-
This requires storage of sessions. See [storage](/agents/storage) for more information.
37+
<Tip>
38+
39+
`Memory.v2` will become the default memory implementation in the next release.
40+
41+
</Tip>
3142

3243
```python
33-
from typing import Iterator
34-
from agno.agent import Agent, RunResponse
44+
from agno.agent import Agent
3545
from agno.models.openai import OpenAIChat
36-
from agno.utils.pprint import pprint_run_response
37-
from agno.storage.postgres import PostgresStorage
46+
from agno.memory.v2 import Memory
3847

3948
agent = Agent(
40-
model=OpenAIChat(id="gpt-4o-mini"),
41-
storage=PostgresStorage(table_name="agent_sessions", db_url="postgresql+psycopg://ai:ai@localhost:5532/ai"),
49+
model=OpenAIChat(id="gpt-4o-mini"),
50+
# Multi-user, multi-session only work with Memory.v2
51+
memory=Memory(),
52+
add_history_to_messages=True,
53+
num_history_runs=3,
4254
)
4355

4456
user_1_id = "user_101"
@@ -48,7 +60,11 @@ user_1_session_id = "session_101"
4860
user_2_session_id = "session_102"
4961

5062
# Start the session with user 1
51-
agent.print_response("Tell me a 5 second short story about a robot.", user_id=user_1_id, session_id=user_1_session_id)
63+
agent.print_response(
64+
"Tell me a 5 second short story about a robot.",
65+
user_id=user_1_id,
66+
session_id=user_1_session_id,
67+
)
5268
# Continue the session with user 1
5369
agent.print_response("Now tell me a joke.", user_id=user_1_id, session_id=user_1_session_id)
5470

@@ -57,6 +73,10 @@ agent.print_response("Tell me about quantum physics.", user_id=user_2_id, sessio
5773
# Continue the session with user 2
5874
agent.print_response("What is the speed of light?", user_id=user_2_id, session_id=user_2_session_id)
5975

60-
# Continue the session with user 1
61-
agent.print_response("What can you tell me about what AIs are capable of?", user_id=user_1_id, session_id=user_1_session_id)
76+
# Ask the agent to give a summary of the conversation, this will use the history from the previous messages
77+
agent.print_response(
78+
"Give me a summary of our conversation.",
79+
user_id=user_1_id,
80+
session_id=user_1_session_id,
81+
)
6282
```

introduction.mdx

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebarTitle: What is Agno
55

66
**Agno is a lightweight library for building Agents with memory, knowledge, tools and reasoning.**
77

8-
Developers use Agno to build Reasoning Agents, Multimodal Agents, Teams of Agents and Agentic Workflows. Agno also provides a beautiful UI to chat with Agents and tools to monitor and evaluate their performance.
8+
Developers use Agno to build Reasoning Agents, Multimodal Agents, Teams of Agents and Agentic Workflows. Agno also provides a beautiful UI to chat with your Agents and tools to monitor and evaluate their performance.
99

1010
Here's an Agent that researches and writes a report on a stock, reasoning through each step:
1111

@@ -45,19 +45,19 @@ agent.print_response("Write a report on NVDA", stream=True, show_full_reasoning=
4545

4646
Agno is simple, fast and model-agnostic. Here are some key features:
4747

48-
- **Model Agnostic**: Agno provides a unified interface to 23+ model providers, no lock-in.
48+
- **Model Agnostic**: Agno Agents can connect to 23+ model providers, no lock-in.
4949
- **Lightning Fast**: Agents instantiate in **~2μs** on average (10,000x faster than LangGraph) and use **~3.75Kib** memory on average (50x less than LangGraph) (see [benchmarks](https://github.com/agno-agi/agno#performance)).
50-
- **Reasoning is a first class citizen**: Build Agents that can "think" and "analyze" using Reasoning Models, `ReasoningTools` or our custom `CoT+Tool-use` approach.
50+
- **Reasoning is a first class citizen**: Make your Agents "think" and "analyze" using Reasoning Models, `ReasoningTools` or our custom `CoT+Tool-use` approach.
5151
- **Natively Multi Modal**: Agno Agents are natively multi modal, they can take in text, image, audio and video and generate text, image, audio and video as output.
5252
- **Advanced Multi Agent Architecture**: Agno provides an industry leading multi-agent architecture with 3 different modes: `route`, `collaborate` and `coordinate`.
53-
- **Long-term Memory & Session Storage**: Agno provides `Storage` & `Memory` classes to provide your Agents with long-term memory and session storage.
54-
- **20+ Vector Databases for Knowledge**: Add domain knowledge to your Agents by integrating with 20+ vector databases. **Fully async and highly performant.**
55-
- **Structured Outputs**: Agno Agents have first class support for structured outputs using native structured outputs or `json_mode`.
53+
- **Agentic RAG using Hybrid Search + Reranking**: Give your Agents access to domain knowledge using one of 20+ vector databases. Get access to state-of-the-art Agentic search that uses hybrid search with re-ranking. **Fully async and highly performant.**
54+
- **Long-term Memory & Session Storage**: Agno provides plug-n-play `Storage` & `Memory` drivers that give your Agents long-term memory and session storage.
55+
- **Structured Outputs**: Agno Agents can return fully-typed responses using model provided structured outputs or `json_mode`.
5656
- **Monitoring**: Monitor agent sessions and performance in real-time on [agno.com](https://app.agno.com).
5757

5858
# Getting Started
5959

60-
If you're new to Agno, start by building your [first Agent](/introduction/agents), then chat with it on the [playground](/introduction/playground) and finally, monitor it on [agno.com](/introduction/monitoring).
60+
If you're new to Agno, start by building your [first Agent](/introduction/agents), chat with it on the [playground](/introduction/playground) and finally, monitor it on [agno.com](/introduction/monitoring).
6161

6262
<CardGroup cols={3}>
6363
<Card
@@ -90,59 +90,73 @@ After that, checkout the [Examples Gallery](/examples) and build real-world appl
9090

9191
# Dive deeper
9292

93-
Agno is a battle-tested framework with a state-of-the-art multi-agent architecture and ridiculous performance, checkout the following guides to dive-in:
93+
Agno is a battle-tested framework with a state-of-the-art reasoning and multi-agent architecture, checkout the following guides to dive-in:
9494

9595
<CardGroup cols={3}>
9696
<Card title="Agents" icon="user-astronaut" iconType="duotone" href="/agents">
97-
Learn core Agent concepts
97+
Learn how to build lightning fast Agents.
98+
</Card>
99+
<Card title="Teams" icon="microchip" iconType="duotone" href="/teams">
100+
Build state-of-the-art multi-agent teams.
98101
</Card>
99102
<Card title="Models" icon="microchip" iconType="duotone" href="/models">
100-
Use any model, any provider, no lock-in
103+
Use any model, any provider, no lock-in.
101104
</Card>
102105
<Card
103106
title="Tools"
104107
icon="screwdriver-wrench"
105108
iconType="duotone"
106109
href="/tools"
107110
>
108-
Use 100s of tools to extend your Agents
111+
Use 100s of tools to extend your Agents.
112+
</Card>
113+
<Card title="Reasoning" icon="brain" iconType="duotone" href="/reasoning">
114+
Make your Agents "think" and "analyze".
109115
</Card>
110116
<Card title="Knowledge" icon="brain" iconType="duotone" href="/knowledge">
111-
Add domain-specific knowledge to your Agents
117+
Add domain knowledge using Agentic RAG.
112118
</Card>
113119
<Card
114120
title="Vector Databases"
115121
icon="spider-web"
116122
iconType="duotone"
117123
href="/vectordb"
118124
>
119-
Add semantic search and retrieval to your Agents
125+
Vector databases that can be used with Knowledge.
120126
</Card>
121127
<Card title="Storage" icon="database" iconType="duotone" href="/storage">
122-
Persist agent states and conversations in a database
128+
Persist agent session and state in a database.
123129
</Card>
124130
<Card
125131
title="Memory"
126132
icon="lightbulb"
127133
iconType="duotone"
128134
href="/agents/memory"
129135
>
130-
Remember user details and session summaries
136+
Remember user details and session summaries.
131137
</Card>
132138
<Card
133139
title="Embeddings"
134140
icon="network-wired"
135141
iconType="duotone"
136142
href="/embedder"
137143
>
138-
Generate embeddings for your knowledge base
144+
Generate embeddings for your knowledge base.
139145
</Card>
140146
<Card
141147
title="Workflows"
142148
icon="diagram-project"
143149
iconType="duotone"
144150
href="/workflows"
145151
>
146-
Build complex workflows with Agents
152+
Build stateful, dynamic, multi-agent workflows.
153+
</Card>
154+
<Card
155+
title="Evals"
156+
icon="diagram-project"
157+
iconType="duotone"
158+
href="/evals"
159+
>
160+
Evaluate your Agents and monitor performance.
147161
</Card>
148162
</CardGroup>

0 commit comments

Comments
 (0)