Skip to content

Knowledge Base API

Hybrid search using BM25 + vector + RRF fusion.

GET /v1/knowledge/search?q=query&n=10
X-API-Key: your-api-key

Response

json
{
  "chunks": [
    {
      "id": "chunk_abc123",
      "content": "Matched text content...",
      "source_id": "src_xyz",
      "source_name": "guide.md",
      "score": 0.85
    }
  ],
  "count": 1
}

List Sources

GET /v1/knowledge/sources

Response

json
{
  "sources": [
    {
      "id": "src_xyz",
      "name": "guide.md",
      "chunks": 42,
      "size": 15360,
      "ingested_at": "2025-01-15T10:30:00Z"
    }
  ]
}

Ingest Document

POST /v1/knowledge/ingest
Content-Type: application/json
json
{
  "name": "company-faq.md",
  "content": "# FAQ\n\n## What is Yunque Agent?\n..."
}

Upload File

POST /v1/knowledge/upload
Content-Type: multipart/form-data

Supports: .txt, .md, .csv, .json, .pdf

Delete Source

DELETE /v1/knowledge/source?id=src_xyz

© 2025 云鸢科技(青岛)有限公司 × Dream Lab