Documentation Index
Fetch the complete documentation index at: https://docs.maximem.ai/llms.txt
Use this file to discover all available pages before exploring further.
Status: Live in Playground · Try it: synap.maximem.ai/playground
Open the playground and pick AI Companion to see the reference implementation. (This recipe replaces the previous Tinder Dating Support example.)
What you’ll build
A conversational agent that:- Tracks personal context — name, pronouns, life events, ongoing situations, communication style
- Adapts tone to the user (formal vs casual, brief vs warm, emoji vs plain)
- Respects boundaries — topics the user has marked off-limits stay off-limits
- Holds threads across sessions — picks up open conversations without recap prompts
When to use this recipe
Build this if:- The product is a 1:1 conversational experience (companion, journaling buddy, lifestyle assistant)
- Personalization across sessions is the core value, not tool execution
- The user owns their context — strict per-user isolation
- You want minimal tools; the memory does the heavy lifting
Architecture at a glance
Memory is the agent. Tools are optional.Stack
| Layer | Choice |
|---|---|
| Synap SDK | maximem-synap (Python) / @maximem/synap (TypeScript) |
| Framework | OpenAI Agents SDK (Python) / Vercel AI SDK (TypeScript) |
| Memory adapter | maximem-synap-openai-agents / @maximem/synap-vercel-adk |
| LLM | OpenAI gpt-4o (warmer voice) or claude-sonnet-4-6 (better long-form) |
| Channel | Native mobile / web chat |
Prerequisites
- A Synap API key — see Authentication
- Python: Python 3.11+
- TypeScript: Node 18+ and Python 3.11+ on the host
Install
Configure
Build it
1. Identity & scoping
customer_id = "companion"— single tenant (your app)user_id = <stable user ID>— strict per-user isolation; no cross-user leakageconversation_id = <session UUID>— one per app session
conversation_id (per app install, not per app open) if you want the companion to feel like one continuous relationship rather than a series of standalone chats.
2. System prompt
The prompt is most of the work here — it shapes how memory gets used.System prompt
3. Wire memory + LLM
4. The “forget” hook
A trust-grade companion needs a way to forget. Expose this from your app.Run & verify
Day 1
Day 8 (fresh session, same user)
Day 14
Customize / extend
- Voice channel → adapt this for phone using Voice Concierge. Tone matters even more in voice.
- Wellness flavor → if the companion is goal-driven (workouts, sleep, journaling), see AI Coach for the goal-tracking shape.
- Multi-modal → image generation, voice notes, photo recognition — all stack on top; memory is unchanged.
- End-to-end encryption → memories at rest aren’t encrypted per-user by default. If your trust model requires it, encrypt the document field client-side before calling
memories.create.
Troubleshooting
Companion forgets things the user told it last week- Confirm ingestion is firing. Log inside the
asyncio.create_taskblock during development — the fire-and-forget pattern swallows errors silently. - Increase
maxResultsin the search adapter so important memories aren’t crowded out.
- Sharpen the system prompt’s “never volunteer unprompted” line.
- Consider tagging sensitive memories with
metadata.sensitivity = "high"and filtering them out of default search.
- Long histories can let the model regress to LLM-default voice. Re-inject the user’s tone preference into the system prompt at the start of each session, pulled from a “communication-style” memory.
Related
- Integrations: OpenAI Agents SDK · Vercel AI SDK
- Concepts: Customer Context · Memory Types · Memory Scopes
- Patterns: Graceful Degradation · RAG over User History
- Other recipes: AI Coach