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

# End-User Memory

> Personalize answers across sessions with remembered end-user profiles. Pass user context into the Guru via the Upsert Profiles API or let logged-in users build memory automatically on the web.

End-User Memory lets your Guru tailor its answers to the person asking. You can pass an end-user profile (name, plan, region, history, anything else useful) into Gurubase via the [Upsert Profiles](/api-reference/endpoints/upsert-profiles) API, and, on the web channel, memory can also be built automatically from a logged-in user's own questions. When that same user asks a question on a supported channel where they can be identified, the Guru uses the stored memory as context, so answers stay consistent across sessions and devices.

This is the Memory-Powered Personalization feature surfaced as a first-class product capability.

## Turning Memory On or Off

The default depends on where Gurubase runs:

* **Gurubase Cloud:** memory follows your plan and is **on by default** on plans that include it.
* **Self-hosted:** memory is **off by default**.

To change it for a Guru:

1. Open the Guru's **Edit** page.
2. Expand **Advanced Settings**.
3. Toggle **End-User Memory** on or off and click **Update Guru**.

When memory is on, it is used everywhere the caller can be identified:

* **Web (logged-in users only):** the authenticated user is identified automatically. Their memory is loaded on every question and updated from each new question (respecting PII masking, so masked questions are stored). Anonymous web visitors have no memory.
* **API, widget, MCP:** memory is used whenever you pass an `external_user_id` in the [Ask Question](/api-reference/endpoints/ask-question) call. Without `external_user_id`, no memory is loaded or written. Profiles you supply via [Upsert Profiles](/api-reference/endpoints/upsert-profiles) always take priority.

<Note>
  Slack, Discord, Microsoft Teams, Jira, and GitHub bots do not pass an `external_user_id` yet, so they do not use memory. Web, widget, MCP, and the direct API do.
</Note>

## Viewing and Deleting Your Own Memory

Logged-in web users get a **View your memory** modal that lists what the Guru remembers about them. From the modal they can:

* **Delete a single memory** with the row's delete button.
* **Clear all memories** with a single action.

The modal is scoped to the signed-in user only; a user can never see or delete another user's memory.

## What Memory Unlocks

<CardGroup cols={3}>
  <Card title="Plan-Aware Answers" icon="user-pen">
    A Pro-plan customer asking about quotas sees Pro-plan limits; a Free user sees Free limits, automatically.
  </Card>

  <Card title="Cross-Session Continuity" icon="history">
    The Guru remembers what was asked yesterday, last week, and last quarter without re-asking the user every time.
  </Card>

  <Card title="Per-User Refusals" icon="lock">
    Combine memory with source-level RBAC so the Guru only cites what each user is entitled to see.
  </Card>
</CardGroup>

## How It Works

<Steps>
  <Step title="Identify the user">
    Generate or reuse a stable `external_user_id` for each end user in your application. This is the key Gurubase will use to look up the user's memory.
  </Step>

  <Step title="Upsert the profile">
    Call [`POST /{guru_slug}/profiles/`](/api-reference/endpoints/upsert-profiles) with a JSON `memory` object. The structure is up to you - name, plan, region, account tier, recent activity, anything that helps the Guru answer better.
  </Step>

  <Step title="Pass the user into questions">
    When the user asks a question, include the same `external_user_id` in your [Ask Question](/api-reference/endpoints/ask-question) call. The Guru pulls the stored profile and grounds its answer with both the knowledge base **and** the user context.
  </Step>

  <Step title="Update over time">
    Re-upsert the profile whenever something changes (plan change, new permission, new context). The Upsert endpoint is idempotent, so you can safely call it on every relevant event.
  </Step>
</Steps>

## Example Profile Payload

```json theme={null}
POST /{guru_slug}/profiles/
{
  "users": [
    {
      "external_user_id": "user-7f3a-9b21",
      "memory": {
        "name": "Sarah E.",
        "email": "sarah@example.com",
        "plan": "Pro",
        "region": "EU",
        "department": "Sales",
        "preferred_language": "English",
        "last_topics": ["pricing", "renewal"]
      }
    }
  ]
}
```

The `memory` object structure is fully open. Pass whatever your application knows about the user that the Guru should use as context.

## Pairs Well With

<CardGroup cols={2}>
  <Card title="Smart Triage" icon="route" href="/guides/triage">
    Triage uses memory to skip clarifying questions the Guru already knows the answer to.
  </Card>

  <Card title="Actions" icon="zap" href="/guides/actions">
    Actions can use memory fields (e.g. `customer_email`, `plan`) as parameters when calling your APIs.
  </Card>

  <Card title="PII Masking" icon="shield-user" href="/guides/pii-masking">
    Mask personal data in answers and logs even while the Guru uses it as context internally.
  </Card>

  <Card title="Audit Logs" icon="clipboard-list" href="/guides/audit-logs">
    Every memory-informed answer is logged with the `external_user_id` that drove it.
  </Card>
</CardGroup>

## API Reference

* [Upsert User Profiles](/api-reference/endpoints/upsert-profiles) - Create or update profiles in bulk
* [Ask Question](/api-reference/endpoints/ask-question) - Ask a question scoped to an `external_user_id`


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