Skip to content

examples: add Synap memory integration example#954

Open
visy-ani wants to merge 2 commits into
anthropics:mainfrom
visy-ani:add-synap-memory-example
Open

examples: add Synap memory integration example#954
visy-ani wants to merge 2 commits into
anthropics:mainfrom
visy-ani:add-synap-memory-example

Conversation

@visy-ani
Copy link
Copy Markdown

Summary

Adds examples/synap_memory.py showing how to give a Claude Agent persistent, cross-session memory via Synap, using both plug points:

  • create_synap_hooksUserPromptSubmit hook that fetches Synap context and injects it via additionalContext
  • create_synap_mcp_server — exposes synap_search / synap_remember as MCP tools the model can call explicitly

The package is published on PyPI as synap-claude-agent. Source code lives in our open source repo: https://github.com/maximem-ai/maximem_synap_sdk/tree/main/packages/integrations/synap-claude-agent

Test plan

  • Manually ran python examples/synap_memory.py with SYNAP_API_KEY set
  • Verified hook injection adds Synap context to subsequent prompts
  • Verified MCP tools synap_search / synap_remember are callable by the model

Copilot AI review requested due to automatic review settings May 14, 2026 10:08
Copy link
Copy Markdown

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds an example script demonstrating how to integrate Synap (a managed memory layer) with the Claude Agent SDK for persistent, cross-session memory.

Changes:

  • New example file showing two integration patterns: hook-based context injection and MCP tool-based memory access.
  • Documents installation and API key setup for synap-claude-agent and maximem-synap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@visy-ani
Copy link
Copy Markdown
Author

Hi @stephanien-ant and @chrislloyd 👋 — would love a review on this whenever you have a chance! This adds examples/synap_memory.py demonstrating how to use both Claude Agent SDK plug points (hooks + MCP tools) for persistent long-term memory via Synap.

Why this matters: many agent builders need cross-session memory but end up rolling their own. The example shows the canonical hook + MCP-server patterns the SDK already supports, so it doubles as a working hooks/MCP reference even for users who don't pick Synap.

Paired with the TypeScript sibling: anthropics/claude-agent-sdk-typescript#327. 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.

2 participants