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 Amazon — Shopping Assistant to see the reference implementation running before you build.
What you’ll build
A chat agent that:- Searches the catalog with the buyer’s preferences applied as filters by default
- Recalls preferences — dietary restrictions, allergies, sizes, materials, brand likes/dislikes
- Grounds in order history — “find me another of those running shoes I bought in March”
- Handles post-purchase — tracking, returns, replacement orders
When to use this recipe
Build this if your product:- Has a sizeable catalog where suggestion quality matters
- Tracks per-buyer order history you want the agent to reference
- Wants the agent to remember preferences across visits without making the buyer re-state them
- Needs the agent to take post-purchase actions (track, return, replace)
Architecture at a glance

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 |
| Channel | Your existing chat surface (web widget, in-app, etc.) |
Prerequisites
- A Synap API key — see Authentication
- Internal APIs for catalog search, product details, orders, and returns
- Python recipe: Python 3.11+
- TypeScript recipe: Node 18+ and Python 3.11+ on the host
Install
Configure
Build it
1. Identity & scoping
customer_id = "amazon"— single tenantuser_id = <stable buyer ID>— from authenticated sessionconversation_id = <session UUID>— per chat session
2. Business tools
3. System prompt
System prompt
4. Wire memory + LLM + tools
Run & verify
Session 1
Session 2 (a week later, new conversation_id)
Inspect what got stored
Customize / extend
- Voice channel → swap the chat handler for Voice Concierge. The shopping tools transfer untouched.
- Multi-tenant marketplaces → set
customer_idper seller storefront. See Patterns → Multi-Tenant SaaS. - Replay historical orders into memory on launch so the agent is useful from day one. See Patterns → Replay History.
- Different framework → see AI Integrations for LangChain, LlamaIndex, CrewAI, etc.
- Support flavor → adapt this shape with
request_refundinstead ofrequest_return; see Uber — Customer Support.
Troubleshooting
Assistant ignores known allergies / dietary prefs- Confirm
synap_searchis being called (Python) — inspect the agent trace. If the model isn’t calling it, sharpen the system prompt: “Before recommending food, beauty, or supplements, callsynap_searchfor the buyer’s restrictions.” - For the TS path with
synap.wrap, increasemaxResultsso the dietary memory makes it into the injected context.
- The agent has the buyer’s affinity but no negative feedback. Capture explicit rejections (“I didn’t like that one”) with
synap_store, or post-purchase ratings via your own pipeline →sdk.memories.create.
- Order data should be tool-fetched live, never cached in memory. If you see stale orders in suggestions, your tool is returning cached data, not Synap.
Related
- Integrations: OpenAI Agents SDK · Vercel AI SDK
- Concepts: Customized Memory Architectures · Memory Scopes
- Patterns: Replay History · Multi-Tenant SaaS
- Other recipes: Uber — Customer Support · Salesforce — Enterprise Sales Assistant