---
title: "Search the knowledge base"
method: GET
path: "/api/v1/knowledge/search"
---

# Search the knowledge base

`GET /api/v1/knowledge/search`

## Request

- Base URL: `https://myagentda.com`
- URL: `https://myagentda.com/api/v1/knowledge/search`
- Auth: API key in header `Authorization`

Hybrid full-text + semantic search across all topics visible to the user (semantic degrades gracefully to full-text when unavailable). Returns snippets; fetch full documents via the document endpoint.

## Query parameters

- `q` string, required
- `topic` string

## Response `200`

Search results.

- object: Ranked hits.
  - `semantic` boolean: Whether the semantic leg contributed.
  - `hits` object[]: Ranked results, best first.
    - `document_id` string: Document ID.
    - `topic` string: Topic number, e.g. T-3.
    - `topic_name` string: Topic name.
    - `title` string: Document title.
    - `snippet` string: Matching excerpt.
    - `source` string, nullable: Document source.
    - `author` string: Last author.
    - `updated_at` string: Last update (ISO 8601).
    - `matched_by` 'text' | 'semantic' | 'both': Which search leg matched.

## Other responses

- `400`: The request was invalid.
- `401`: The access token is missing or invalid.

---

[API](https://skmtc.dev/myagentda/apis/agentda.md) · [All operations](https://skmtc.dev/myagentda/apis/agentda/llms.txt) · [OpenAPI document](https://skmtc.dev/myagentda/apis/agentda/revisions/66a449ab49dc?raw)
