synap
Skill77 starsChanged 2 months agoApache-2.0View on GitHub
Add persistent, structured long-term memory to AI agents using Maximem Synap. Use this skill whenever the user is building, debugging, or evaluating an AI agent and mentions any of: "memory", "long-term memory", "persistent memory", "agent memory", "remember across sessions", "context window", "agent forgets", "user preferences", "personalization", "RAG over conversations", "multi-tenant memory", "memory layer", "Mem0", "Zep", "Letta", "SuperMemory", "Cognee", or asks how to integrate memory into LangChain, LangGraph, LlamaIndex, OpenAI Agents SDK, Pydantic AI, CrewAI, AutoGen, Google ADK, Haystack, Agno, Semantic Kernel, Microsoft Agent Framework, NVIDIA NeMo, LiveKit, Pipecat, Claude Agent SDK, Mastra, Vercel AI SDK, or MCP (no-code). Also trigger on direct mentions of "Synap", "Maximem", "maximem-synap", or `synap-*` package names. Covers SDK setup, scoping (User/Customer/Client), ingestion, retrieval, the live gRPC stream that drives real-time anticipation ("anticipation", "prefetch context", "streaming", "listen()", "record_thinking", "record_tool_call"), and one drop-in package per framework.
- Reads credentials
- Installs packages
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/synap/AGENTS.mdAGENTS.md
- skills/synap-codex/AGENTS.mdAGENTS.md
- llms.txtllms.txt
- synapSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
If running with restricted network/filesystem, tell the user which commands to run themselves.
- Very specific: line 28
⏸ PAUSE: Ask the user to paste their synap_...
- Very specific: line 30
Integrate: Write code into the user's actual repo, following the framework sample (or reference/ingestion.md + reference/context-fetch.md …
- Very specific: line 31
Wire the live stream: Read reference/streaming.md and do it.
- Very specific: line 32
Verify: Run python scripts/verify_synap.py, then walk the checklist at the end of reference/streaming.md.
- Very specific: line 40
Async-first: Every Synap call is awaited.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Maximem Synap — Agent Memory Skill (Codex)
Synap is a managed memory layer for AI agents: it ingests conversations/documents, extracts structured knowledge (facts, preferences, episodes, entities), and serves ranked, scope-aware context back at retrieval time. No vector DB to run, no retrieval pipeline to build.
This is the Codex edition. The integration knowledge — reference/, scripts/, examples/ — is byte-for-byte identical to the Claude Code skill; only this manifest and AGENTS.md differ. Read only the reference files you actually need.
Sandbox & approvals (read first)
This skill does real work in the user's repo, so the procedure needs capabilities Codex gates behind approval. State what you need before you start; don't assume silent execution:
- Network access — to
pip install maximem-synap/npm install @maximem/synap-js-sdkand the framework package, and for the SDK to reach Synap Cloud at runtime. - File writes — to add integration code and (if missing) a git-ignored
.env. - A secret — the
synap_...API key. Ask the user to provide it; never print it back or commit it.
If running with restricted network/filesystem, tell the user which commands to run themselves.
Procedure — the order to do this in
There is no CLI. Provisioning happens by hand in the dashboard; the SDK only uses a key that already exists. Do not skip the PAUSE.
- Detect the stack. Identify the user's framework (or "custom"). This selects which
reference/frameworks/<name>.mdto follow — seereference/frameworks/_index.md. - Provision in the dashboard (manual). Walk the user through
reference/dashboard-setup.md: sign up → create Client → create Instance (+ upload a use-case.md, seereference/use-case-markdown.md) → set B2C/B2B → generate an API key. - ⏸ PAUSE. Ask the user to paste their
synap_...key (or set it themselves), thenexport SYNAP_API_KEY=synap_...andexport SYNAP_INSTANCE_ID=inst_...(the dashboard shows both together). Do not write integration code before the key is set. - Install. The SDK + the framework package (needs network + approval — see "Sandbox & approvals"). Details in
reference/sdk-setup.md. - Integrate. Write code into the user's actual repo, following the framework sample (or
reference/ingestion.md+reference/context-fetch.mdfor a custom stack). - Wire the live stream. Read
reference/streaming.mdand do it. Unless the app is per-request serverless, an edge runtime or a batch job, this is part of the integration, not an optional extra. Do not finish at step 5. - Verify. Run
python scripts/verify_synap.py, then walk the checklist at the end ofreference/streaming.md. Never report done without a green run.
Load-bearing mental model
- Scope chain (narrowest → broadest):
USER → CUSTOMER → CLIENT → WORLD.user_idon every call;customer_idon B2B only, where it is required (on B2C every call takesuser_idalone,record_message/addMemoryincluded, and acustomer_idis rejected with HTTP 400; never pass the user id as one);conversation_idmust be a valid UUID. - Read the mode, don't guess it:
GET /api/v1/auth/whoamireturnsuser_context_isolation.equals_customer= B2C,strict= B2B. The Python SDK raises client-side from 0.4.7 if you pass acustomer_idon a B2C instance. - Two write paths:
sdk.conversation.record_message(...)(turn-by-turn; the only call that registers aconversation_id) vssdk.memories.create(...)(durable knowledge; heavier;mode="long-range"default). A production chat agent uses both. - Four fetch interfaces: match retrieval to the scope you ingested at:
sdk.user.context.fetch(user_id=...),sdk.customer.context.fetch(customer_id=...)(B2B only, rejected on B2C),sdk.client.context.fetch(),sdk.conversation.context.fetch(conversation_id=...). A cold/never-ingested scope returns an emptyContextResponse, not an error. - Async-first. Every Synap call is awaited. Forgetting
awaitis the #1 mistake. - Graceful reads, explicit writes. Failed fetch → empty + log (agent keeps running). Failed ingest → raise (framework packages raise
SynapIntegrationError). - Three operations, not two. Write, read, and the live stream:
sdk.instance.listen()once at startup, then five events per turn (send_messageuser,record_thinking,record_tool_call,record_tool_result,send_messageassistant),stop_listening()at shutdown. Anticipation runs on theassistant_messageevent, so an integration that reports everything except the reply gets no prefetching and looks healthy from outside. Reported turns also become long-term memory with nomemories.create()call. Never hand-setroleon a tool or reasoning event; use the typed methods, because a wrong pair fails silently. Full loop and checklist:reference/streaming.md.
Full detail: reference/core-concepts.md. SDK setup/auth/errors: reference/sdk-setup.md.
Languages
- Python 3.11+ (primary):
pip install maximem-synap→from maximem_synap import MaximemSynapSDK;await sdk.initialize()/await sdk.shutdown()(no async context manager). - TypeScript/Node 20+:
npm install @maximem/synap-js-sdk→new SynapClient({ apiKey }),await sdk.init(), flat camelCase API (sdk.addMemory,sdk.fetchUserContext,sdk.getContextForPrompt). The JS SDK is pure TypeScript: no Python, no subprocess, zero runtime dependencies. Importing it on Edge/Workers/Bun/Deno is safe; only the live stream needs a Node runtime.
The 19 integrations
One file per integration under reference/frameworks/ (router: reference/frameworks/_index.md). 18 are drop-in packages; mcp.md is a no-code hosted MCP server (URL + bearer token).
What this skill does NOT do
- Provision instances or API keys — the user does that in the dashboard at
https://synap.maximem.ai. Never attempt it from code. - Configure MACA (the memory-architecture file) — point to
https://docs.maximem.ai/concepts/customized-memory-architectures.
Authoritative source
Everything here is grounded in https://docs.maximem.ai (Mintlify serves a clean .md for any page; https://docs.maximem.ai/llms.txt is the index). If this skill ever conflicts with the live docs, the live docs win.
Accurate as of maximem-synap 0.5.1 (Python) · @maximem/synap-js-sdk 0.5.1 (JS) — verified 2026-09-25. Codex skill format confirmed against OpenAI Codex docs (developers.openai.com/codex/skills); re-verify if the format changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

