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

# Quickstart

> Change your base URL. Your agent remembers.

Anona Memory is a hosted service. There is no infrastructure to run, no schema to
design, and no vector database to operate.

The fastest way in is the **memory proxy**: point an OpenAI-compatible client at Anona
instead of the model provider. Every request recalls what matters from the space and
every reply is stored back, so the conversation carries across sessions, processes and
machines, with no `record` or `retrieve` calls in your code.

> [!TIP]
>
> **No account yet?** You can try Anona before signing up. `anona start` (from
> `pip install -U anona` or `npm i -g @anona-labs/memory`) creates a temporary
> profile with 1,000 credits for 72 hours, and its `anona_tmp_` token is accepted
> by the REST API, the MCP endpoint and this drop-in proxy, anywhere you would
> put an API key. Claim it later with `anona login` to keep what it stored.
> See [Temporary profiles](https://docs.memory.anonalabs.com/agents/temp-profiles.md).

```python Python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="anona_live_YOUR_KEY",
    base_url="https://api.anonalabs.com/v1",   # ← the only change
    default_headers={"X-Anona-Space-Id": "my-app"},
)

client.chat.completions.create(
    model="gpt-oss",
    messages=[{"role": "user", "content": "I'm on the Scale plan, 4 seats."}],
)

# New process, new day, no history passed in:
answer = client.chat.completions.create(
    model="gpt-oss",
    messages=[{"role": "user", "content": "What plan am I on?"}],
)
print(answer.choices[0].message.content)   # → "You're on the Scale plan, with 4 seats."
```

```typescript TypeScript theme={null}
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ANONA_API_KEY,
  baseURL: "https://api.anonalabs.com/v1",   // ← the only change
  defaultHeaders: { "X-Anona-Space-Id": "my-app" },
});

await client.chat.completions.create({
  model: "gpt-oss",
  messages: [{ role: "user", content: "I'm on the Scale plan, 4 seats." }],
});

const answer = await client.chat.completions.create({
  model: "gpt-oss",
  messages: [{ role: "user", content: "What plan am I on?" }],
});
console.log(answer.choices[0].message.content);
```

```bash cURL theme={null}
curl https://api.anonalabs.com/v1/chat/completions \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "space_id": "my-app",
        "messages": [{"role": "user", "content": "What plan am I on?"}]
      }'
```

That is the whole integration. You never supply an LLM key. Anona runs the model and
meters the turn in Anona credits.

> [!NOTE]
>
> Already using the **Responses API** or the **Anthropic SDK**? Both work the same way:
> `/v1/responses` and `/v1/messages` speak those shapes with the identical memory
> wrapper. Streaming is supported on all three.

## Get set up

**1. Create an account and a key**

Sign up at the [Anona Memory dashboard](https://memory.anonalabs.com) with your
organization name, email, and a password of 8 or more characters.

Verify your email before your first sign-in. Signing up does not create a key: go to
**API keys → New key**, pick an environment, and copy it. The full key is shown once,
at the moment you create it, and never again.

| Key prefix | Environment |
| - | - |
| `anona_live_...` | Production |
| `anona_test_...` | Development and testing |

**2. Create a memory space**

Every memory lives inside a space: one per app, per tenant, or per end user, whichever
boundary you want memories isolated along. Create one from **Spaces → New space** in the
dashboard, or over the API:

```bash cURL theme={null}
curl -X POST https://api.anonalabs.com/v1/spaces/ \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "customer-support-bot"}'
```

```python Python theme={null}
from anona import AnonaClient

client = AnonaClient(api_key="anona_live_YOUR_KEY")
client.create_space("customer-support-bot")
```

```typescript TypeScript theme={null}
import { Anona } from "@anona-labs/memory";

const anona = new Anona({ apiKey: "anona_live_YOUR_KEY" });
await anona.createSpace({ name: "customer-support-bot" });
```

```json theme={null}
{
  "space_id": "customer-support-bot",
  "name": "customer-support-bot",
  "created_at": "2026-07-14T12:00:00Z"
}
```

The name you chose **is** the `space_id`. Nothing is generated for you. Pass it as
`X-Anona-Space-Id` (or `space_id` in the body) on every proxied call.

**3. Tune what gets injected (optional)**

Each knob has a header form, so a stock client sets them once in `default_headers` and
never touches the request body.

| Header | Body field | Default | Effect |
| - | - | - | - |
| `X-Anona-Space-Id` | `space_id` | `default` | Which space to recall from and store into |
| `X-Anona-Memory-Limit` | `memory_limit` | `5` | How many memories to inject |
| `X-Anona-Memory-Tokens` | `memory_token_budget` | none | Approximate token cap on the injected block |
| `X-Anona-Auto-Record` | `auto_record` | `true` | Store this turn back into the space |
| `X-Anona-Memory` | `memory` | `true` | `false` skips recall entirely for this call |

> [!NOTE]
>
> Set `X-Anona-Space-Id` even for a quick test. Leave it out and the turn is
> recalled from and stored into a space literally named `default`, created on the
> first proxied call, so a space you never created shows up in your space list
> and counts against your plan's space limit.

Serving many end users from one space? Add `X-Anona-User-Id` and each user gets
their own memory, with no space per user and no leakage between them:

```python Python theme={null}
client = OpenAI(
    api_key="anona_live_YOUR_KEY",
    base_url="https://api.anonalabs.com/v1",
    default_headers={
        "X-Anona-Space-Id": "my-app",
        "X-Anona-User-Id": current_user.id,   # ← per end user
    },
)
```

```typescript TypeScript theme={null}
const client = new OpenAI({
  apiKey: "anona_live_YOUR_KEY",
  baseURL: "https://api.anonalabs.com/v1",
  defaultHeaders: {
    "X-Anona-Space-Id": "my-app",
    "X-Anona-User-Id": currentUser.id, // ← per end user
  },
});
```

```bash cURL theme={null}
curl https://api.anonalabs.com/v1/chat/completions \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Anona-Space-Id: my-app" \
  -H "X-Anona-User-Id: user_123" \
  -d '{"messages": [{"role": "user", "content": "What plan am I on?"}]}'
```

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

The same knobs can be stored on the space itself
(`PUT /v1/spaces/{space_id}/chat-settings`, or the **Chat defaults** tab in the
dashboard), so they apply to every call without touching your code. A request
that sets a field still wins over the stored default.

See [Chat](https://docs.memory.anonalabs.com/api-reference/chat.md) for the full endpoint reference.

## Or call memory directly

The proxy is memory with the wiring done for you. When you want the memory layer on its
own (ingesting documents, storing facts your model never said, searching without
generating), use the memory API directly.

```bash cURL theme={null}
# Store a memory
curl -X POST https://api.anonalabs.com/v1/record \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"space_id": "customer-support-bot", "content": "Alice is a senior engineer at Google"}'

# Search memories
curl -X POST https://api.anonalabs.com/v1/retrieve \
  -H "Authorization: Bearer anona_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"space_id": "customer-support-bot", "query": "Where does Alice work?"}'
```

```python Python SDK theme={null}
# pip install anona
from anona import AnonaClient

client = AnonaClient(api_key="anona_live_YOUR_KEY")

client.record(space_id="customer-support-bot", content="Alice is a senior engineer at Google")

results = client.retrieve(space_id="customer-support-bot", query="Where does Alice work?")
print(results)
```

```typescript TypeScript SDK theme={null}
// npm install @anona-labs/memory
import { Anona } from "@anona-labs/memory";

const anona = new Anona({ apiKey: process.env.ANONA_API_KEY! });

await anona.record({
  spaceId: "customer-support-bot",
  content: "Alice is a senior engineer at Google",
});

const results = await anona.retrieve({
  spaceId: "customer-support-bot",
  query: "Where does Alice work?",
});
console.log(results);
```

> [!NOTE]
>
> The `record` call above is synchronous, and synchronous writes are slow: the text is
> analyzed by a language model and its facts extracted before the call returns. Measured
> against production, that is **about 3-12 seconds** for a short memory, and longer
> for long content, against **1-3 seconds** for the same write queued.
>
> It is written that way here only so the `retrieve` on the next line finds the memory.
> **In real code, pass `"async": true`** (`background=True` in the Python SDK,
> `background: true` in TypeScript) and poll the returned job: same work, same cost, a
> fraction of the wait. See
> [Memories](https://docs.memory.anonalabs.com/api-reference/memories.md#store-a-memory-asynchronously).

## Where to go next

> **[Chat](https://docs.memory.anonalabs.com/api-reference/chat.md)**
>
> Streaming, tunables, and the full proxy reference.

> **[Core concepts](https://docs.memory.anonalabs.com/concepts.md)**
>
> Spaces, memory types, and tenant isolation.

> **[Retrieve API](https://docs.memory.anonalabs.com/api-reference/retrieve.md)**
>
> Filters, latency modes, and relevance scoring.

> **[Framework adapters](https://docs.memory.anonalabs.com/integrations/langchain.md)**
>
> Already on LangChain, CrewAI, LlamaIndex, ADK, Agent Framework or Strands?
> Wire memory in without calling record and retrieve yourself.

> **[Examples](https://docs.memory.anonalabs.com/integrations/examples.md)**
>
> A complete runnable script for every adapter.

> **[MCP](https://docs.memory.anonalabs.com/mcp-integration.md)**
>
> Connect Claude Code and other MCP clients.


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