> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memory.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Core Concepts

> The terminology behind spaces, the three memory operations, keys, and tenant isolation.

## At a glance

| Concept | What it is | Where it appears |
| - | - | - |
| **Memory space** | The isolation boundary for one application or tenant. | `space_id` on every call |
| **Scope** | A partition *inside* a space: one end user, agent, or session. | `user_id` / `agent_id` / `session_id` |
| **Record** | Storing a memory so its facts become searchable. | `POST /v1/record` |
| **Retrieve** | Ranking stored memories against a natural-language query. | `POST /v1/retrieve` |
| **Reason** | Synthesizing a single answer across many memories. | `POST /v1/reason` |
| **API key** | The credential that identifies your organization. | `Authorization: Bearer` |
| **Credits** | The unit every metered operation is billed in. | `GET /v1/usage/me` |

## Memory space

A space is where the memories for a specific application or context live. Your
organization can hold many spaces, and each is fully isolated from the others.

You create a space with a `name`, and that name **is** its permanent `space_id`, the
identifier every other call takes. Nothing separate is generated, and `space_id` is not
a field you can send on create.

```bash theme={null}
POST /v1/spaces/
{"name": "customer-support-bot"}

# → {"space_id": "customer-support-bot", "name": "customer-support-bot", ...}
```

Reference: [Spaces API](https://docs.memory.anonalabs.com/api-reference/spaces.md)

## Scope

A space is the coarse boundary. **Scope** partitions it, so a single space serves many
end users without their memories mixing:

```bash theme={null}
POST /v1/record    {"space_id": "support", "user_id": "alice", "content": "..."}
POST /v1/retrieve  {"space_id": "support", "user_id": "alice", "query": "..."}
```

Do **not** create a space per end user. Spaces are capped per plan, and memories in
different spaces can never be synthesized together, so you would lose exactly the
cross-user view you built a memory layer for. One space plus `user_id` is the pattern.

Scoping is strict: a scoped search returns only memories written under that same scope,
never another user's, and never unscoped ones. Consolidated memories are built per user,
so a synthesis cannot mix two users' facts.

Reference: [Scoping](https://docs.memory.anonalabs.com/api-reference/retrieve.md#scoping-within-a-space)

## Record

Storing a memory is not a plain insert. The content is analyzed, its durable facts are
extracted, and the result is embedded and indexed for semantic search.

```python theme={null}
client.record(
    space_id="customer-support-bot",
    content="Alice works at Google and specializes in distributed systems",
)
```

Reference: [Memories API](https://docs.memory.anonalabs.com/api-reference/memories.md)

## Retrieve

Retrieve finds memories by meaning rather than keyword overlap, and returns them ranked
by relevance with their entities and event time attached.

```python theme={null}
results = client.retrieve(
    space_id="customer-support-bot",
    query="What is Alice's expertise?",
)
```

Reference: [Retrieve API](https://docs.memory.anonalabs.com/api-reference/retrieve.md)

## Reason

Reason runs an agentic pass over the space, connecting related facts and weighing
recency, and returns one synthesized answer instead of a ranked list.

```python theme={null}
answer = client.reason(
    space_id="customer-support-bot",
    query="What have we learned about Alice's career?",
)
```

| | Retrieve | Reason |
| - | - | - |
| **Returns** | A ranked list of memories | A single synthesized answer |
| **Cost** | Lower | Higher, it reasons across the space |
| **Use when** | You want to inject context into a prompt | You want a conclusion, not the evidence |

Reference: [Reason API](https://docs.memory.anonalabs.com/api-reference/reason.md)

## API key

Every request carries `Authorization: Bearer <key>`. Keys are created and revoked from
the dashboard under **API keys**, or through the
[API Keys endpoints](https://docs.memory.anonalabs.com/api-reference/api-keys.md). The full key is shown once at creation;
afterwards only its prefix is visible.

Reference: [Authentication](https://docs.memory.anonalabs.com/api-reference/authentication.md)

## Tenant isolation

Each organization's memories live in a dedicated database schema, with no shared tables.
A `space_id` belonging to one organization is both meaningless and inaccessible to
another. The boundary is enforced twice: as an authorization check at the gateway, and
again at the database layer.

## Next steps

> **[API overview](https://docs.memory.anonalabs.com/api-reference/overview.md)**
>
> The full endpoint surface in one table.

> **[Python SDK](https://docs.memory.anonalabs.com/sdk/python.md)**
>
> Client library reference.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.