---
title: "Search facts"
method: POST
path: "/api/v1/facts/search"
---

# Search facts

`POST /api/v1/facts/search`

## Request

- Base URL: `https://ctxstore.ai`
- URL: `https://ctxstore.ai/api/v1/facts/search`
- Auth: HTTP bearer

Semantically search stored facts. Returns the most relevant facts for the query.

## Request body

- object
  - `query` string, required: Search query
  - `top_k` integer: Number of results to return
  - `category` 'preference' | 'decision' | 'identity' | 'technical' | 'relationship': Filter by category

## Response `200`

Search results

- object
  - `results` Fact[]
    - `text` string: The fact content
    - `score` number: Semantic similarity score (0-1)
    - `category` 'preference' | 'decision' | 'identity' | 'technical' | 'relationship'
    - `is_permanent` boolean
    - `fact_id` string
  - `count` integer

## Other responses

- `401`: Unauthorized

---

[API](https://skmtc.dev/ctxstore/apis/ctxstore-ai.md) · [All operations](https://skmtc.dev/ctxstore/apis/ctxstore-ai/llms.txt) · [OpenAPI document](https://skmtc.dev/ctxstore/apis/ctxstore-ai/revisions/0581ff18c0f4?raw)
