Skip to content

Commit b2b9950

Browse files
authored
update docs for merged storage (#195)
## What does this PR do? - at some places in the `Examples` section still `...AgentStorage` was being used for example `PostgresAgentStorage` instead of just `PostgresStorage`
1 parent 4392710 commit b2b9950

30 files changed

+61
-61
lines changed

agent-ui/introduction.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Let's start with a local playground server. Create a file `playground.py`
7171
from agno.agent import Agent
7272
from agno.models.openai import OpenAIChat
7373
from agno.playground import Playground, serve_playground_app
74-
from agno.storage.agent.sqlite import SqliteAgentStorage
74+
from agno.storage.sqlite import SqliteStorage
7575
from agno.tools.duckduckgo import DuckDuckGoTools
7676
from agno.tools.yfinance import YFinanceTools
7777

@@ -83,7 +83,7 @@ web_agent = Agent(
8383
tools=[DuckDuckGoTools()],
8484
instructions=["Always include sources"],
8585
# Store the agent sessions in a sqlite database
86-
storage=SqliteAgentStorage(table_name="web_agent", db_file=agent_storage),
86+
storage=SqliteStorage(table_name="web_agent", db_file=agent_storage),
8787
# Adds the current date and time to the instructions
8888
add_datetime_to_instructions=True,
8989
# Adds the history of the conversation to the messages
@@ -99,7 +99,7 @@ finance_agent = Agent(
9999
model=OpenAIChat(id="gpt-4o"),
100100
tools=[YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True)],
101101
instructions=["Always use tables to display data"],
102-
storage=SqliteAgentStorage(table_name="finance_agent", db_file=agent_storage),
102+
storage=SqliteStorage(table_name="finance_agent", db_file=agent_storage),
103103
add_datetime_to_instructions=True,
104104
add_history_to_messages=True,
105105
num_history_responses=5,

agents/memory.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ from rich.json import JSON
8282

8383
from agno.agent import Agent
8484
from agno.models.openai import OpenAIChat
85-
from agno.storage.agent.sqlite import SqliteAgentStorage
85+
from agno.storage.sqlite import SqliteStorage
8686

8787
agent = Agent(
8888
model=OpenAIChat(id="gpt-4o"),
8989
# Store agent sessions in a database
90-
storage=SqliteAgentStorage(table_name="agent_sessions", db_file="tmp/agent_storage.db"),
90+
storage=SqliteStorage(table_name="agent_sessions", db_file="tmp/agent_storage.db"),
9191
# Set add_history_to_messages=true to add the previous chat history to the messages sent to the Model.
9292
add_history_to_messages=True,
9393
# Number of historical responses to add to the messages.

examples/concepts/memory/memories-and-summaries-postgres.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: Memories and Summaries with Postgres
88
from agno.agent import Agent, AgentMemory
99
from agno.memory.db.postgres import PgMemoryDb
1010
from agno.models.openai import OpenAIChat
11-
from agno.storage.agent.postgres import PostgresAgentStorage
11+
from agno.storage.postgres import PostgresStorage
1212
from rich.pretty import pprint
1313

1414
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
@@ -21,7 +21,7 @@ agent = Agent(
2121
create_session_summary=True,
2222
),
2323
# Store agent sessions in a database
24-
storage=PostgresAgentStorage(
24+
storage=PostgresStorage(
2525
table_name="personalized_agent_sessions", db_url=db_url
2626
),
2727
# Show debug logs so, you can see the memory being created

examples/concepts/memory/memories-and-summaries-sqlite-async.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import json
1111
from agno.agent import Agent, AgentMemory
1212
from agno.memory.db.sqlite import SqliteMemoryDb
1313
from agno.models.openai import OpenAIChat
14-
from agno.storage.agent.sqlite import SqliteAgentStorage
14+
from agno.storage.sqlite import SqliteStorage
1515
from rich.console import Console
1616
from rich.json import JSON
1717
from rich.panel import Panel
@@ -39,7 +39,7 @@ agent = Agent(
3939
update_session_summary_after_run=True,
4040
),
4141
# Store agent sessions in a database
42-
storage=SqliteAgentStorage(table_name="agent_sessions", db_file=agent_storage_file),
42+
storage=SqliteStorage(table_name="agent_sessions", db_file=agent_storage_file),
4343
description="You are a helpful assistant that always responds in a polite, upbeat and positive manner.",
4444
# Show debug logs to see the memory being created
4545
# debug_mode=True,

examples/concepts/memory/memories-and-summaries.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import json
1010
from agno.agent import Agent, AgentMemory
1111
from agno.memory.db.sqlite import SqliteMemoryDb
1212
from agno.models.openai import OpenAIChat
13-
from agno.storage.agent.sqlite import SqliteAgentStorage
13+
from agno.storage.sqlite import SqliteStorage
1414
from rich.console import Console
1515
from rich.json import JSON
1616
from rich.panel import Panel
@@ -35,7 +35,7 @@ agent = Agent(
3535
update_session_summary_after_run=True,
3636
),
3737
# Store agent sessions in a database, that persists between runs
38-
storage=SqliteAgentStorage(
38+
storage=SqliteStorage(
3939
table_name="agent_sessions", db_file="tmp/agent_storage.db"
4040
),
4141
# add_history_to_messages=true adds the chat history to the messages sent to the Model.

examples/concepts/memory/persistent-memory-mongodb.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ from agno.agent import Agent
1111
from agno.memory.agent import AgentMemory
1212
from agno.memory.db.mongodb import MongoMemoryDb
1313
from agno.models.openai import OpenAIChat
14-
from agno.storage.agent.mongodb import MongoDbAgentStorage
14+
from agno.storage.mongodb import MongoDbStorage
1515
from rich.console import Console
1616
from rich.json import JSON
1717
from rich.panel import Panel
@@ -22,7 +22,7 @@ db_url = "mongodb://localhost:27017"
2222
agent = Agent(
2323
model=OpenAIChat(id="gpt-4o"),
2424
# Store agent sessions in MongoDB
25-
storage=MongoDbAgentStorage(
25+
storage=MongoDbStorage(
2626
collection_name="agent_sessions", db_url=db_url, db_name="agno"
2727
),
2828
# Store memories in MongoDB

examples/concepts/memory/persistent-memory-postgres.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ from typing import List, Optional
1010
import typer
1111
from agno.agent import Agent
1212
from agno.knowledge.pdf_url import PDFUrlKnowledgeBase
13-
from agno.storage.agent.postgres import PostgresAgentStorage
13+
from agno.storage.postgres import PostgresStorage
1414
from agno.vectordb.pgvector import PgVector, SearchType
1515

1616
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
@@ -21,7 +21,7 @@ knowledge_base = PDFUrlKnowledgeBase(
2121
),
2222
)
2323

24-
storage = PostgresAgentStorage(table_name="pdf_agent", db_url=db_url)
24+
storage = PostgresStorage(table_name="pdf_agent", db_url=db_url)
2525

2626

2727
def pdf_agent(new: bool = False, user: str = "user"):

examples/concepts/memory/persistent-memory.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import json
99

1010
from agno.agent import Agent
1111
from agno.models.openai import OpenAIChat
12-
from agno.storage.agent.sqlite import SqliteAgentStorage
12+
from agno.storage.sqlite import SqliteStorage
1313
from rich.console import Console
1414
from rich.json import JSON
1515
from rich.panel import Panel
1616

1717
agent = Agent(
1818
model=OpenAIChat(id="gpt-4o"),
1919
# Store agent sessions in a database
20-
storage=SqliteAgentStorage(
20+
storage=SqliteStorage(
2121
table_name="agent_sessions", db_file="tmp/agent_storage.db"
2222
),
2323
# Set add_history_to_messages=true to add the previous chat history to the messages sent to the Model.

examples/concepts/rag/agentic-rag-agent-ui.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ from agno.embedder.openai import OpenAIEmbedder
1010
from agno.knowledge.pdf_url import PDFUrlKnowledgeBase
1111
from agno.models.openai import OpenAIChat
1212
from agno.playground import Playground, serve_playground_app
13-
from agno.storage.agent.postgres import PostgresAgentStorage
13+
from agno.storage.postgres import PostgresStorage
1414
from agno.vectordb.pgvector import PgVector, SearchType
1515

1616
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
@@ -37,7 +37,7 @@ rag_agent = Agent(
3737
# Add a tool to read chat history.
3838
read_chat_history=True,
3939
# Store the agent sessions in the `ai.rag_agent_sessions` table
40-
storage=PostgresAgentStorage(table_name="rag_agent_sessions", db_url=db_url),
40+
storage=PostgresStorage(table_name="rag_agent_sessions", db_url=db_url),
4141
instructions=[
4242
"Always search your knowledge base first and use it if available.",
4343
"Share the page number or source URL of the information you used in your response.",

examples/concepts/rag/rag-with-lance-db-and-sqlite.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ from agno.agent import Agent
99
from agno.embedder.ollama import OllamaEmbedder
1010
from agno.knowledge.pdf_url import PDFUrlKnowledgeBase
1111
from agno.models.ollama import Ollama
12-
from agno.storage.agent.sqlite import SqliteAgentStorage
12+
from agno.storage.sqlite import SqliteStorage
1313
from agno.vectordb.lancedb import LanceDb
1414

1515
# Define the database URL where the vector database will be stored
@@ -38,7 +38,7 @@ knowledge_base = PDFUrlKnowledgeBase(
3838
knowledge_base.load(recreate=False)
3939

4040
# Set up SQL storage for the agent's data
41-
storage = SqliteAgentStorage(table_name="recipes", db_file="data.db")
41+
storage = SqliteStorage(table_name="recipes", db_file="data.db")
4242
storage.create() # Create the storage if it doesn't exist
4343

4444
# Initialize the Agent with various configurations including the knowledge base and storage

0 commit comments

Comments
 (0)