InMemoryDb stores an Agent’s sessions and run history in the current Python process. Data is lost when the process exits.
Usage
In-Memory Storage for Agents
Store agent sessions and run history in the current Python process with InMemoryDb.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Store agent sessions and run history in the current Python process with InMemoryDb.
InMemoryDb stores an Agent’s sessions and run history in the current Python process. Data is lost when the process exits.
uv pip install agno openai
from agno.agent import Agent
from agno.db.in_memory import InMemoryDb
db = InMemoryDb()
agent = Agent(db=db, add_history_to_context=True)
agent.print_response("Give me an easy dinner recipe")
agent.print_response("Which ingredients did you just recommend?")