This is a B2C example: one user, identified by
user_id alone. On a B2B instance you also pass a customer_id. See Identifiers & Scopes.1. Ingest one message
You hand Synap raw text; it runs the ingestion pipeline and stores structured memory. The call returns immediately with aningestion_id you can wait on.
first_memory.py
2. See what Synap extracted
From that one message, Synap extracts structured memory types, not just a blob of text:| Type | What it found |
|---|---|
| Fact | Alex runs a coffee roastery in Portland. |
| Preference | Prefers email over phone. |
| Temporal event | Planning a second location next spring. |
| Entities | Alex, Portland, coffee roastery (resolved and linked in the graph). |
3. Read it back
On the next turn, fetch context for the same scope you ingested at, before you call your LLM:context.facts and context.preferences into your system prompt, and your agent now “remembers” Alex on every future conversation.
Where to go next
Quickstart
The full setup: create a Client, an Instance, and an API key, then run the loop.
Memory Model Cheat Sheet
The 5 identifiers, 2 write paths, and 4 fetch interfaces on one page.
Playground
Try it in the browser, no install or API key needed.
First Integration
Wire Synap into a real FastAPI + LLM app, end to end.