Up to 7.2× the speed of standard llama.cpp Runs 100% on your PC
Free for personal use
Download free
Local API Guide/Endpoints/Knowledge search

Knowledge search

POST/v1/knowledge/search
Free: not countedBase URL http://localhost:1234/v1
Local API Guide contents

Overview

Searches your documents the way the app does: by meaning (Qwen3-Embedding-4B) and by keywords, combined, best first. Passages that don't really match are left out, so you may get fewer than limit, or none. It doesn't generate text, so it doesn't count toward your daily allowance.

Request body

ParameterDescription
querystringrequiredA question or keywords.
collectionstringall (default), a collection name, or an id like c:3.
limitinteger1 to 40 passages. Default 8.
Authorization headerAuthorization: Bearer <key>, only when Require API key is on in the app.

Response

FieldDescription
query, collectionstringYour query, and the collection searched (all or c:<id>).
data[].indexintegerRank, from 1.
data[].document, document_idstring, integerThe file the passage is from.
data[].collectionstringIts collection id.
data[].location, headingstringWhere in the file (page, slide, sheet) and the section heading, when known.
data[].textstringThe passage.
data[].similaritynumberCloseness in meaning to the query (0–1).
data[].scorenumberThe combined ranking score (meaning and keywords).

Example

curl http://localhost:1234/v1/knowledge/search \
  -H "Content-Type: application/json" \
  -d '{"query": "refunds for digital goods", "collection": "Policies", "limit": 5}'
Response
{
  "object": "list",
  "query": "refunds for digital goods",
  "collection": "c:3",
  "data": [
    { "index": 1, "document": "Refund policy.pdf", "document_id": 41, "collection": "c:3",
      "location": "page 2", "heading": "Digital products",
      "text": "Digital goods can be refunded within 14 days if they have not been downloaded…",
      "similarity": 0.7412, "score": 0.03252 }
  ]
}

Errors

StatusCodeWhen
401invalid_api_keyRequire API key is on and the key is missing or wrong.
400invalid_requestquery is missing, limit is out of range, or collection is not a string.
404collection_not_foundNo collection has that name or id.
503knowledge_unavailableThe knowledge model is not installed, or no model is loaded.
502knowledge_search_failedThe search failed.