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

# User Profiles

> Pre-aggregated user context built from memory.

## What profiles are

Profiles are a convenience layer over memory. Instead of running multiple search calls to gather broad context, call a single endpoint:

```
GET /api/memories/profile
```

This returns a pre-aggregated snapshot of the user's knowledge base, useful for bootstrapping context at the start of a session.

## Profile sections

The response has two sections:

| Section   | Contents                     | Source                                               |
| --------- | ---------------------------- | ---------------------------------------------------- |
| `static`  | Stable preferences and facts | Older memories with category `preference` or `fact`  |
| `dynamic` | Recent context               | Memories from the last 14 days across all categories |

```json theme={null}
{
  "static": [
    "Prefers TypeScript over JavaScript",
    "Uses macOS with VS Code",
    "Likes dark mode"
  ],
  "dynamic": [
    "Working on e-commerce checkout flow",
    "Chose Stripe for payment processing"
  ]
}
```

## When to use profiles

Profiles work well for:

* **Application startup** - load broad user context in a single call
* **Personalization** - tailor content or UI based on known preferences
* **Content generation** - provide a persona or style guide derived from memory
* **Support systems** - give agents background before the user explains anything

## Profiles vs search

|              | Profile                            | Search                                      |
| ------------ | ---------------------------------- | ------------------------------------------- |
| **Use case** | Broad context                      | Specific retrieval                          |
| **Query**    | None (returns everything relevant) | Natural language query                      |
| **Results**  | Two arrays of strings              | Ranked memory objects with relevance scores |
| **Caching**  | Cached for performance             | Always fresh                                |

Use profiles for "who is this user?" and search for "what did they decide about X?".

Profiles follow the same scope isolation rules as search and list. A scoped profile never includes memories from another scope, and an unscoped profile only includes global/unscoped memories.

## Scoping by scope and project

Pass a `scope` query parameter to build profile context from one isolated memory container only:

```
GET /api/memories/profile?scope=user_123
```

Omit `scope` to build a profile from unscoped/global memories only.

You can also add `project` to narrow the profile inside that scope:

```
GET /api/memories/profile?scope=user_123&project=memcontext
```

This returns only memories tagged with that project inside `user_123`.
