from agno.agent import Agent
from agno.tools.mem0 import Mem0Tools
agent = Agent(
instructions=[
"You are a memory-enhanced assistant that can remember information across conversations",
"Store important information about users and their preferences",
"Retrieve relevant memories to provide personalized responses",
],
tools=[Mem0Tools(user_id="user_123")],
markdown=True,
)
agent.print_response("Remember that I prefer vegetarian meals and I'm allergic to nuts")
Create a virtual environment
Terminal
and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set your API keys
export MEM0_API_KEY=your-mem0-api-key
export MEM0_ORG_ID=your-organization-id
export MEM0_PROJECT_ID=your-project-id
export OPENAI_API_KEY=xxx
Install libraries
pip install -U mem0ai openai agno
Run Agent
python cookbook/tools/mem0_tools.py