Skip to content

samples: add Synap long-term memory AgentChat sample#7691

Open
visy-ani wants to merge 4 commits into
microsoft:mainfrom
visy-ani:add-synap-memory-sample
Open

samples: add Synap long-term memory AgentChat sample#7691
visy-ani wants to merge 4 commits into
microsoft:mainfrom
visy-ani:add-synap-memory-sample

Conversation

@visy-ani
Copy link
Copy Markdown

Summary

Adds python/samples/agentchat_synap_memory/ — a sample showing how to give an AutoGen AssistantAgent persistent, cross-session memory via Synap.

The agent is wired with SynapSearchTool and SynapStoreTool from synap-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

Copilot AI review requested due to automatic review settings May 14, 2026 11:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +33 to +34
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"),
Comment on lines +58 to +60
await Console(
agent.run_stream(task="What do you know about my dietary restrictions?")
)
Comment on lines +20 to +29
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:
@visy-ani
Copy link
Copy Markdown
Author

Hi @ekzhu and @victordibia 👋 — would appreciate a look at this whenever you have a moment! This adds python/samples/agentchat_synap_memory/ — an AssistantAgent sample showing how to plug long-term memory into AutoGen via Synap.

Why this fits the samples folder: it follows the same shape as the other agentchat_* samples (single main.py + README), uses the standard OpenAIChatCompletionClient, and only adds two BaseTool instances from synap-autogen. No new core dependencies — agents in the samples folder demonstrate exactly how third-party tools plug into AssistantAgent.

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants