Official SDK

CAMEL-AI memory

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+).
Open setup documentation →

Capabilities

Quick Start

from camel.agents import ChatAgent
from camel_memorysync import MemorySyncMemory
memory = MemorySyncMemory(
user_id="customer-42", # required
session_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

Guides and related pages

Explore More

Add long-term memory to CAMEL-AI

Start free with 10,000 add requests a month and no credit card. Memory is stored per end user and comes back in every later session.