🎥 Watch the Mem0 + Vanna AI demo
A minimal proof-of-concept showing how to integrate Vanna AI — a conversational analytics engine — with Mem0, a universal memory layer for AI agents, to demonstrate how persistent user memory can personalize data queries.
- 🧠 Mem0 Integration — Stores and retrieves user preferences or context across sessions
- 🪄 Vanna API — Answers analytical questions using
/chat_sseendpoint - 💬 Interactive CLI — Prompts the user to add or view stored preferences before asking a question
- 🔐 .env-based Config — Secure, no hard-coded API keys
- 🧩 Local-First Setup — Works directly from terminal without a frontend
Pre-reqs: Vanna connected to your database. Takes 90 secs to do this at app.vanna.ai assuming you're a database admin.
To get started:
-
Clone the repository
git clone https://github.com/vanna-ai/mem0.git
cd mem0 -
Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate -
Install dependencies
pip install -r requirements.txt -
Copy the example environment file and fill in your keys
cp .env.example .env -
Run the script
python main.py
🤖 Checking what I already know about you...
🧠 Here are your current preferences:
- User requests that returned charts are blue in color
Would you like to add any new preferences? (press Enter to skip)
➡️ Your new preference: i prefer line charts to bar charts where applicable
💾 Saved: "show line charts over bar charts where applicable"
Now, what question would you like to ask?
❓ Your question: show monthly sales over the last 12 months
📤 Sent to Vanna API...
VANNA_API_KEY=
VANNA_USER_EMAIL=
MEM0_API_KEY=
MEM0_USER_EMAIL=
MEM0_ORG_ID=
MEM0_PROJECT_ID=
.
├── main.py
├── test_mem0_sdk.py
├── requirements.txt
├── .env.example
├── .gitignore
└── README.md
Vanna AI
Description: Demo showcasing persistent memory with Mem0 to personalize Vanna analytics.
🌐 https://vanna.ai
Vanna AI is a conversational analytics engine that connects to your databases and lets you ask business questions in natural language — returning SQL, charts, or dataframes as responses.
Mem0 is a universal memory layer for AI agents — enabling them to remember user preferences, context, and history across sessions. Perfect for personalization, state management, and long-term contextual reasoning.