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

# Context Vault Search

> Search source chunks, extracted memories, or both.

Use `GET /api/context-vault/search` to retrieve Context Vault knowledge.

Search supports three modes:

| Mode        | Returns                                                               |
| ----------- | --------------------------------------------------------------------- |
| `documents` | Source chunks from ingested documents                                 |
| `memories`  | Extracted document memories and curated company facts                 |
| `hybrid`    | Source chunks, extracted document memories, and curated company facts |

The endpoint returns retrieval context, not a generated final answer.

Document memories include evidence when they were extracted from uploaded or
scraped sources. Curated company facts can return with `evidence: []`; treat
them as workspace-approved context rather than document-backed citations.

## Single-scope search

```bash theme={null}
curl "https://api.memcontext.in/api/context-vault/search?workspaceId=WORKSPACE_ID&query=leave%20policy&scope=hr&mode=hybrid" \
  -H "X-API-Key: $MEMCONTEXT_API_KEY"
```

## Multi-scope search

Use `scopes` when the answer should come from two or more hard lanes.

```bash theme={null}
curl "https://api.memcontext.in/api/context-vault/search?workspaceId=WORKSPACE_ID&query=trial%20and%20billing&scopes=dev,billing&mode=hybrid" \
  -H "X-API-Key: $MEMCONTEXT_API_KEY"
```

When `scopes` is provided, it takes precedence over `scope`. Results are still
limited to the same workspace.

## Project filter

Use `project` to narrow results inside the selected scope or scopes.

```bash theme={null}
curl "https://api.memcontext.in/api/context-vault/search?workspaceId=WORKSPACE_ID&query=refunds&scopes=billing,support&project=q3-policy" \
  -H "X-API-Key: $MEMCONTEXT_API_KEY"
```
