Autogen memory integration
Add persistent memory to Microsoft Autogen agents using the zep-autogen package.
Add persistent memory to Microsoft Autogen agents using the zep-autogen package.
The zep-autogen package integrates Zep with Microsoft Autogen agents, adding persistent memory and context retrieval. Choose between user-specific conversation memory or structured knowledge graph memory.
Set your API keys as environment variables:
User Memory: Stores conversation history in user threads with automatic context injection
Knowledge Graph Memory: Maintains structured knowledge with custom entity models
Automatic Context Injection: ZepUserMemory automatically injects relevant conversation history and context via the update_context() method. The agent receives up to 10 recent messages plus context from Zep’s Context Block.
Zep tools allow agents to search and add data directly to memory storage with manual control and structured responses.
Important: Tools must be bound to either graph_id OR user_id, not both. This determines whether they operate on knowledge graphs or user graphs.
Search Tool Parameters:
query: str (required) - Search query textlimit: int (optional, default 10) - Maximum results to returnscope: str (optional, default “edges”) - Search scope: “edges”, “nodes”, “episodes”Add Tool Parameters:
data: str (required) - Content to storedata_type: str (optional, default “text”) - Data type: “text”, “json”, “message”Both memory types support direct querying with different scope parameters.
Memory Objects (ZepUserMemory/ZepGraphMemory):
update_context()Function Tools (search/add tools):
Note: Both approaches can be combined - using memory for automatic context and tools for explicit operations.