examples: add Synap memory integration example#954
Conversation
There was a problem hiding this comment.
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-agentandmaximem-synap.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @stephanien-ant and @chrislloyd 👋 — would love a review on this whenever you have a chance! This adds 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! |
Summary
Adds
examples/synap_memory.pyshowing how to give a Claude Agent persistent, cross-session memory via Synap, using both plug points:create_synap_hooks—UserPromptSubmithook that fetches Synap context and injects it viaadditionalContextcreate_synap_mcp_server— exposessynap_search/synap_rememberas MCP tools the model can call explicitlyThe 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-agentTest plan
python examples/synap_memory.pywithSYNAP_API_KEYsetsynap_search/synap_rememberare callable by the model