Knowledge
Retrieve chunks
Get the ranked chunks an engine finds for a question, without writing an answer.
POST
/v1/engine/retrieveSearches the engine's vector and OKF sources, ranks what it finds, and returns the chunks for your own model to use. lynk.retrieve calls it for you.
Body
engine_idstring<uuid>requiredThe engine to search.
querystringrequiredThe question, in plain words.
top_kintegerdefault: 8How many chunks to return, from 1 to 100. Your plan can cap it lower.
Response
chunksobject[]requiredThe chunks, best match first.
chunks[].chunk_idstring<uuid>requiredThe chunk's ID. Matches chunk_id in query citations.
chunks[].contentstringrequiredThe chunk's text.
chunks[].metadataobjectrequiredThe metadata stored with the chunk.
Status codes
| Status | Meaning |
|---|---|
200 | The search ran. An empty list means nothing matched. |
401 | The key is missing, malformed, or revoked. |
402 | Your plan's monthly allowance is used up. |
403 | The key's capability or scope doesn't allow reading this engine. |
404 | The engine doesn't exist in the key's workspace. |
422 | A field is missing or invalid. |
429 | The read rate limit was hit. |