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

# Your First Memory

## 1. Store Your First Memory

Send a conversation to Lumi0. It will automatically extract and store meaningful memories.

```ts theme={null}
await client.memory.add({
  userId: "user_123",
  messages: [
    {
      role: "user",
      content: "Hi! My favorite color is blue and I live in London."
    }
  ]
});
```

Example extracted memories:

* Favorite color is blue
* Lives in London

## 2. Search Memories

Retrieve relevant memories whenever your AI needs context.

```ts theme={null}
const memories = await client.memory.search({
  userId: "user_123",
  query: "What is my favorite color?"
});

console.log(memories);
```

Example response:

```json theme={null}
{
  "memories": [
    {
      "id": "mem_01K...",
      "memory": "Favorite color is blue",
      "score": 0.98
    }
  ]
}
```

## 3. BatchMemories

Retrieve relevant memories whenever your AI needs context.

```ts theme={null}
const memories = await client.memory.search({
  userId: "user_123",
  query: "What is my favorite color?"
});

console.log(memories);
```

Example response:

```json theme={null}
{
  "memories": [
    {
      "id": "mem_01K...",
      "memory": "Favorite color is blue",
      "score": 0.98
    }
  ]
}
```

## 3. Use Memories with Your LLM

Include the retrieved memories in your prompt before calling your language model.

```ts theme={null}
const context = memories
  .map((m) => `- ${m.memory}`)
  .join("\n");

// Pass `context` to OpenAI, Gemini, Claude, or another LLM.
```

This allows your AI to generate responses using long-term memory instead of relying only on the current conversation.

***

## What's Next?

Now that you've stored and retrieved your first memory, explore the rest of the documentation:

* **Core Concepts** — Learn how Lumi0 manages memory.
* **Memory API** — Explore every endpoint and SDK method.
* **Guides** — Build chatbots, AI agents, and assistants with persistent memory.
* **Integrations** — Connect Lumi0 with OpenAI, Gemini, Claude, LangChain, and more.
