MemorySync
Official SDK

AG2 + MemorySync

An automatic memory loop for AG2’s ConversableAgent — one attach call, duplicate-proof multi-agent capture, and a deadlock-free bridge.

Overview

Install ag2-memorysync and one attach call gives a classic AutoGen ConversableAgent long-term memory: every incoming user message is persisted and enriched with recalled context under a hard budget (default 1.2s), and every outgoing reply is persisted — through AG2’s own hook system, with zero extra code per turn. The injected context feeds the LLM only; the original text is what persists, so recalled memories can never re-enter storage. A process-wide dedup registry plus deterministic idempotency seeds fix the double-store bug Zep documents in their own zep-ag2 adapter (two attached agents in one session store every utterance twice with conflicting roles — ours stores once, by test). All async work rides one persistent background event loop that never touches the caller’s loop, so chats driven from inside asyncio work — zep-ag2 documents a deadlock caveat there. The package has zero framework dependencies: it duck-types against the agent, so it works with whichever classic distribution you installed and cannot version-conflict (zep-ag2 pins ag2<1).

Setup status and requirements

Supported version
ag2-memorysync 1.0.0 (PyPI)
Last setup review
2026-08-24
Permissions
A MemorySync API key with read and write scopes.
Limits
Targets the classic ConversableAgent framework (`pip install autogen`, Python 3.10+). The rewritten `pip install ag2` v1 has no hook system yet — a future adapter target.
Open setup documentation →

Capabilities

Quick Start

from autogen import ConversableAgent
from ag2_memorysync import MemorySyncCapability
assistant = ConversableAgent("assistant", llm_config=...)
memory = MemorySyncCapability(api_key="ms_...",
user_id="customer-42",
session_id="support")
memory.add_to_agent(assistant) # that’s the whole integration

Use Cases

ConversableAgent chats that remember users across sessions

Multi-agent GroupChat workflows with duplicate-proof shared capture

Replacing Teachability’s per-turn analyzer-LLM cost with zero-LLM memory

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.