> ## 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.

# Your first memory

> Ingest one message, see what Synap extracts from it, and read it back. The shortest path to understanding what Synap actually does for your agent.

Once you have an API key (from the [Quickstart](/getting-started/quickstart)), you can see Synap's memory in action in a few lines. This page ingests a single message, shows what Synap pulls out of it, and retrieves it back.

<Note>
  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](/concepts/memory-scopes).
</Note>

## 1. Ingest one message

You hand Synap raw text; it runs the [ingestion pipeline](/concepts/how-ingestion-works) and stores structured memory. The call returns immediately with an `ingestion_id` you can wait on.

```python first_memory.py theme={null}
import asyncio
from maximem_synap import MaximemSynapSDK

async def main():
    sdk = MaximemSynapSDK()          # reads SYNAP_API_KEY from the environment
    await sdk.initialize()
    try:
        result = await sdk.memories.create(
            document=(
                "User: I'm Alex, I run a small coffee roastery in Portland. "
                "I always prefer email over phone, and I'm planning to expand to a "
                "second location next spring."
            ),
            document_type="ai-chat-conversation",
            user_id="user_alex",
        )

        # Block until the pipeline finishes (good for scripts and tests).
        await sdk.memories.wait_for_completion(result.ingestion_id)
        print("Ingested:", result.ingestion_id)
    finally:
        await sdk.shutdown()

asyncio.run(main())
```

## 2. See what Synap extracted

From that one message, Synap extracts structured [memory types](/concepts/memories-and-context#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). |

You did not tag any of this by hand. Extraction and [entity resolution](/concepts/entity-resolution) happen automatically.

## 3. Read it back

On the next turn, fetch context for the same scope you ingested at, before you call your LLM:

```python theme={null}
context = await sdk.user.context.fetch(
    user_id="user_alex",
    search_query=["communication preferences", "business"],
)

for fact in context.facts:
    print("fact:", fact.content)
for pref in context.preferences:
    print("preference:", pref.content)
```

Inject `context.facts` and `context.preferences` into your system prompt, and your agent now "remembers" Alex on every future conversation.

## Where to go next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/getting-started/quickstart">
    The full setup: create a Client, an Instance, and an API key, then run the loop.
  </Card>

  <Card title="Memory Model Cheat Sheet" icon="table-list" href="/concepts/memory-model-cheat-sheet">
    The 5 identifiers, 2 write paths, and 4 fetch interfaces on one page.
  </Card>

  <Card title="Playground" icon="play" href="/getting-started/playground">
    Try it in the browser, no install or API key needed.
  </Card>

  <Card title="First Integration" icon="code" href="/setup/first-integration">
    Wire Synap into a real FastAPI + LLM app, end to end.
  </Card>
</CardGroup>
