CAMEL-AI + MemorySync
A lossless storage backend plus a drop-in AgentMemory: verbatim local history, scored semantic recall under a hard budget, and zero client-side embeddings.
Overview
Install camel-memorysync and pass MemorySyncMemory(user_id=..., session_id=...) to ChatAgent — verbatim chat history kept locally, plus semantic recall from MemorySync, injected as one scored SYSTEM-role context record that CAMEL’s ScoreBasedContextCreator sorts directly after the system prompt. Only the user’s turns are sent to MemorySync, which stores just the durable facts in them; assistant, system and tool records stay local. Your history is never reordered, rewritten, or role-swapped: the in-repo Mem0Storage returns extracted facts instead of your messages with every record hardcoded role=USER (breaking OpenAI’s alternation), and its clear() calls client.delete_users() — resetting a chat destroys the whole account. Here clear() resets the local window only, and remote deletion is explicit and loud: forget_session() and forget_user() delete the facts extracted from this session’s or all of the user’s CAMEL turns, so memories from other MemorySync surfaces survive. Recall runs under a hard 1.2s budget and fails open to history-only context, an anti-echo filter keeps the live conversation from coming back as “memories”, multimodal image payloads round-trip intact in the local history, and a deterministic seed lets the server recognise a retried save, so a turn is extracted once. Unlike VectorDBMemory there are zero client-side embeddings — no OpenAIEmbedding key, no vector database to operate.
Setup status and requirements
- Supported version
- camel-memorysync 1.1.0 (PyPI)
- Last setup review
- 2026-10-01
- Permissions
- A MemorySync API key with read and write scopes.
- Limits
- Requires camel-ai 0.2.60+ (Python 3.10+).
Capabilities
- Byte-exact local history — roles, uuids, and images preserved
- Only user turns sent to MemorySync; replies stay local
- One scored recall record after the system prompt — history never touched
- Anti-echo filter — the live turn never returns as a “memory”
- clear() is local-only; forget_session()/forget_user() are explicit and loud
- Zero client-side embeddings — recall is one MemorySync query
- Hard 1.2s recall budget; fails open to history-only context
- Cross-surface recall — memories from LangChain, the CLI, voice agents work here
- Deterministic idempotency seeds — a retried save is extracted once
Quick Start
from camel.agents import ChatAgentfrom camel_memorysync import MemorySyncMemorymemory = MemorySyncMemory(user_id="customer-42", # requiredsession_id="support",)agent = ChatAgent(system_message="You are a helpful travel assistant.",memory=memory,)agent.step("I always prefer window seats on long flights")# a new session, days later:agent.step("which seat should I book for the Oslo flight?") # remembers
Use Cases
Multi-agent CAMEL societies with per-user long-term memory
Replacing the history-corrupting in-repo Mem0Storage
Long-term memory without operating a vector DB or embedding pipeline
Explore More
Built for production AI systems
Build AI systems that remember
MemorySync provides the infrastructure layer for persistent memory, adaptive retrieval, and enterprise AI intelligence.
Start free. No credit card required.