Camel AI integration
Connect Camel’s agent framework to Mem0 so every agent can persist and recall conversation context across sessions with minimal setup.Prerequisites
- Mem0:
MEM0_API_KEY(or self-hosted endpoint),pip install mem0ai - Camel AI:
pip install camel-ai(requires Python 3.9+) - Optional: OpenAI API key if you run LLM-backed agents
Camel provides a Python SDK today. A TypeScript path is not available yet.
Configure credentials
- Mem0
- Camel
1
Export your API key
2
(Self-host) Point to your Mem0 API
Wire Mem0 into a Camel agent
1
Create a Mem0-backed memory store
2
Attach it to Camel memory
3
Let your agent read and write Mem0
Run
python camel_mem0_demo.py (or the snippet above in a REPL). You should see the agent respond and the memory persisted to Mem0. Re-running with a new prompt should include the stored preference.Verify the integration
- Mem0 dashboard shows new memories under
agent_id=travel_agentanduser_id=alice. mem0_store.load()returns the records you just wrote.- Camel agent replies reference prior user preferences on subsequent runs.
Troubleshooting
- Missing MEM0_API_KEY — set
export MEM0_API_KEY="sk-..."or passapi_keyintoMem0Storage. - No memories returned — ensure
agent_id/user_idin your query match what you used when writing. - Network errors to Mem0 — if self-hosting, set
MEM0_BASE_URLto your deployment URL.