samples: add Synap long-term memory AgentChat sample#7691
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Python sample demonstrating Synap-backed long-term memory for an AgentChat AssistantAgent.
Changes:
- Adds setup/run documentation for the Synap memory sample.
- Adds a sample script wiring Synap search/store tools into an
AssistantAgent. - Demonstrates storing and querying a remembered user fact.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
python/samples/agentchat_synap_memory/README.md |
Documents installation, environment variables, execution, and Synap resources. |
python/samples/agentchat_synap_memory/main.py |
Creates the Synap SDK/tools and runs two AgentChat prompts using an OpenAI model client. |
| user_id = "demo-user-001" | ||
| customer_id = "demo-customer" |
| agent = AssistantAgent( | ||
| name="memory_assistant", | ||
| model_client=OpenAIChatCompletionClient(model="gpt-4o-mini"), | ||
| tools=tools, |
|
|
||
| agent = AssistantAgent( | ||
| name="memory_assistant", | ||
| model_client=OpenAIChatCompletionClient(model="gpt-4o-mini"), |
| await Console( | ||
| agent.run_stream(task="What do you know about my dietary restrictions?") | ||
| ) |
| import os | ||
|
|
||
| from autogen_agentchat.agents import AssistantAgent | ||
| from autogen_agentchat.ui import Console | ||
| from autogen_ext.models.openai import OpenAIChatCompletionClient | ||
| from maximem_synap import MaximemSynapSDK | ||
| from synap_autogen import SynapSearchTool, SynapStoreTool | ||
|
|
||
|
|
||
| async def main() -> None: |
|
Hi @ekzhu and @victordibia 👋 — would appreciate a look at this whenever you have a moment! This adds Why this fits the samples folder: it follows the same shape as the other All real CI checks are green (CLA, GitGuardian, Agent, Prepare). The "Cleanup artifacts" failure is the standard post-job cleanup that shows on most PRs. Happy to make any changes you'd like — thanks! |
Summary
Adds
python/samples/agentchat_synap_memory/— a sample showing how to give an AutoGenAssistantAgentpersistent, cross-session memory via Synap.The agent is wired with
SynapSearchToolandSynapStoreToolfromsynap-autogen— it can semantically search the user's existing memories and persist new facts the user mentions.PyPI: https://pypi.org/project/synap-autogen/
Open source: https://github.com/maximem-ai/maximem_synap_sdk/tree/main/packages/integrations/synap-autogen