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

# Search Chat Memories - POST /v1/workspaces/:workspace_id/chat-memories/search

> Layered semantic search over chat memories with budget control via POST /v1/workspaces/:workspace_id/chat-memories/search. Minimum role viewer.

Run semantic search over a workspace's layered chat memories and return hits plus a character budget (useful to bound length when injecting memory into context).

## Endpoint

```http theme={null}
POST /v1/workspaces/:workspace_id/chat-memories/search
```

## Authentication

`Authorization: Bearer <jwt>` or `X-API-Key <sk_...>`. Minimum role: **viewer**.

## Path parameters

**workspace\_id** `string` *required*

Workspace id.

## Request body

**query** `string`

Search text; falls back to the `query` query param when omitted.

**max\_items** `integer`

Maximum number of memories to return.

**max\_chars** `integer`

Maximum character budget for returned content.

## Response

**hits** `array`

Array of matched memories, each with `content` and other fields.

**budget** `object`

Budget statistics.

**budget**

**items** `integer`

Actual number of returned items.

**chars** `integer`

Total characters of returned content.

## Example

```bash cURL theme={null}
curl -X POST https://memo.ariacompute.com/v1/workspaces/ws_01a2b3c4d5e6/chat-memories/search \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -d '{"query":"user identity and preferences","max_items":10,"max_chars":2000}'
```

```json 200 theme={null}
{
  "hits": [
    {
      "id": "cm_01a2b3c4d5e6",
      "content": "User is a developer focused on pricing and integration.",
      "layer": 3,
      "kind": "persona"
    }
  ],
  "budget": { "items": 1, "chars": 53 }
}
```


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