Skip to content

Commit 278623c

Browse files
committed
update docs
1 parent 1c96065 commit 278623c

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

agents/memory.mdx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,39 @@ from agno.models.openai import OpenAIChat
3838
from agno.storage.sqlite import SqliteStorage
3939
from rich.pretty import pprint
4040

41+
# UserId for the memories
4142
user_id = "ava"
42-
db_file = "tmp/memory.db"
43+
# Database file for memory and storage
44+
db_file = "tmp/agent.db"
45+
46+
# Initialize memory.v2
4347
memory = Memory(
48+
# Use any model for creating memories
49+
model=OpenAIChat(id="gpt-4.1"),
4450
db=SqliteMemoryDb(table_name="user_memories", db_file=db_file),
45-
delete_memories=True,
46-
clear_memories=True,
4751
)
48-
memory.clear()
52+
# Initialize storage
4953
storage = SqliteStorage(table_name="agent_sessions", db_file=db_file)
5054

55+
# Initialize Agent
5156
memory_agent = Agent(
5257
model=OpenAIChat(id="gpt-4.1"),
58+
# Store memories in a database
5359
memory=memory,
60+
# Give the Agent the ability to update memories
5461
enable_agentic_memory=True,
62+
# OR - Run the MemoryManager after each response
63+
enable_user_memories=True,
64+
# Store the chat history in the database
5565
storage=storage,
66+
# Add the chat history to the messages
5667
add_history_to_messages=True,
68+
# Number of history runs
5769
num_history_runs=3,
58-
read_chat_history=True,
70+
markdown=True,
5971
)
6072

73+
memory.clear()
6174
memory_agent.print_response(
6275
"My name is Ava and I like to ski.",
6376
user_id=user_id,
@@ -68,7 +81,7 @@ print("Memories about Ava:")
6881
pprint(memory.get_user_memories(user_id=user_id))
6982

7083
memory_agent.print_response(
71-
"I live in san francisco",
84+
"I live in san francisco, where should i move within a 4 hour drive?",
7285
user_id=user_id,
7386
stream=True,
7487
stream_intermediate_steps=True,

memory/memory.mdx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,39 @@ from agno.models.openai import OpenAIChat
2222
from agno.storage.sqlite import SqliteStorage
2323
from rich.pretty import pprint
2424

25+
# UserId for the memories
2526
user_id = "ava"
26-
db_file = "tmp/memory.db"
27+
# Database file for memory and storage
28+
db_file = "tmp/agent.db"
29+
30+
# Initialize memory.v2
2731
memory = Memory(
32+
# Use any model for creating memories
33+
model=OpenAIChat(id="gpt-4.1"),
2834
db=SqliteMemoryDb(table_name="user_memories", db_file=db_file),
29-
delete_memories=True,
30-
clear_memories=True,
3135
)
32-
memory.clear()
36+
# Initialize storage
3337
storage = SqliteStorage(table_name="agent_sessions", db_file=db_file)
3438

39+
# Initialize Agent
3540
memory_agent = Agent(
3641
model=OpenAIChat(id="gpt-4.1"),
42+
# Store memories in a database
3743
memory=memory,
44+
# Give the Agent the ability to update memories
3845
enable_agentic_memory=True,
46+
# OR - Run the MemoryManager after each response
47+
enable_user_memories=True,
48+
# Store the chat history in the database
3949
storage=storage,
50+
# Add the chat history to the messages
4051
add_history_to_messages=True,
52+
# Number of history runs
4153
num_history_runs=3,
42-
read_chat_history=True,
54+
markdown=True,
4355
)
4456

57+
memory.clear()
4558
memory_agent.print_response(
4659
"My name is Ava and I like to ski.",
4760
user_id=user_id,
@@ -52,7 +65,7 @@ print("Memories about Ava:")
5265
pprint(memory.get_user_memories(user_id=user_id))
5366

5467
memory_agent.print_response(
55-
"I live in san francisco",
68+
"I live in san francisco, where should i move within a 4 hour drive?",
5669
user_id=user_id,
5770
stream=True,
5871
stream_intermediate_steps=True,

0 commit comments

Comments
 (0)