Add Persistent Memory to Microsoft AutoGen Agents
AutoGen excels at multi-agent conversations, but every agent starts with a blank slate when the process restarts. This guide wires REM Labs into AutoGen so your agents remember previous conversations, share context across team members, and retrieve facts with 90% accuracy on LongMemEval.
Why AutoGen Agents Need External Memory
Microsoft AutoGen lets you build multi-agent systems where a planner, coder, and critic collaborate in a group chat. The conversation history lives in Python lists attached to each agent. Restart the process and the history is gone. Scale to multiple workers and they cannot share what they learned.
REM Labs solves both problems. It stores every memory unit externally with vector, full-text, and entity graph indexing. Any agent, on any machine, can retrieve relevant context in under 50ms.
Step 1: Install
Step 2: Create a Memory-Aware Agent
The register_reply hook fires before every response. It searches REM for context relevant to the latest message and prepends it. The agent now has cross-session recall without any changes to AutoGen internals.
Step 3: Persist Group Chat History
Each message from the group chat is stored as its own memory unit. On the next run, the memory search retrieves the most relevant previous exchanges -- even weeks later.
Step 4: Shared Memory Across Agents
Because REM is an external API, multiple AutoGen agents can share a namespace. A research agent stores findings; a writer agent recalls them.
What Gets Indexed
Every memory stored through the API is automatically indexed three ways:
- Vector embedding -- semantic similarity search
- Full-text index -- exact keyword and proper noun matching
- Entity graph -- extracted entities and relationships
No configuration needed. Multi-signal fusion retrieval combines all three at query time for 90% recall on LongMemEval.
Full API reference: See the REM Labs docs for namespace management, tag filtering, metadata queries, and the complete Python SDK reference.