AutoGen + MemorySync
A real Memory-protocol implementation for Microsoft AutoGen — async-native, budgeted recall, and a clear() that cannot nuke a customer.
Overview
Install autogen-memorysync and AutoGen agents remember users across sessions. MemorySyncMemory implements the full autogen_core Memory protocol: update_context runs before every model call and injects recalled context as a SystemMessage under a hard budget (default 1.2s) — a slow or dead memory backend means an unenriched turn, never a late or broken one. Retrieval is role-aware (the last user message, not blindly messages[-1] — which after a tool result is assistant text, a real retrieval bug in the Mem0 adapter that ships inside autogen-ext). Everything is genuinely async (Mem0’s calls a synchronous client inside async methods, blocking the event loop), writes carry deterministic idempotency seeds so retries never duplicate, clear() is session-scoped by default with whole-user wipe as an explicit opt-in, and add_turn_pair() reduces the capture loop AutoGen deliberately leaves to applications to one call. search_memory and save_memory FunctionTools included.
Setup status and requirements
- Supported version
- autogen-memorysync 1.0.0 (PyPI)
- Last setup review
- 2026-08-24
- Permissions
- A MemorySync API key with read and write scopes.
- Limits
- Requires autogen-agentchat/autogen-core 0.4+ (Python 3.10+). AutoGen is in maintenance mode — the Memory protocol is frozen and stable; a Microsoft Agent Framework adapter is a separate roadmap item.
Capabilities
- Full autogen_core Memory protocol — drop into AssistantAgent memory=[...]
- Hard recall budget (default 1.2s) — a reply is never late, tested against a slow backend
- Genuinely async httpx — never blocks the event loop (Mem0’s adapter does)
- Role-aware retrieval: queries the last user message, not messages[-1]
- clear() is session-scoped by default — cannot wipe a customer by accident
- Deterministic idempotency seeds — retried adds converge on one row
- add_turn_pair(): the whole capture loop in one call
- search_memory + save_memory FunctionTools for tool-equipped agents
Quick Start
from autogen_agentchat.agents import AssistantAgentfrom autogen_memorysync import MemorySyncMemorymemory = MemorySyncMemory(api_key="ms_...",user_id="customer-42",session_id="support")agent = AssistantAgent("assistant", model_client=...,memory=[memory])result = await agent.run(task=user_text)await memory.add_turn_pair(user_text,result.messages[-1].content)
Use Cases
AutoGen assistants that greet returning users with context
Multi-agent teams where each agent carries per-user memory
Migrating off the event-loop-blocking Mem0 autogen-ext adapter
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.