Skip to Content

Knowledge

Retrieve chunks

Get the ranked chunks an engine finds for a question, without writing an answer.

POST/v1/engine/retrieve

Searches 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>required

The engine to search.

querystringrequired

The question, in plain words.

top_kintegerdefault: 8

How many chunks to return, from 1 to 100. Your plan can cap it lower.

Response

chunksobject[]required

The chunks, best match first.

chunks[].chunk_idstring<uuid>required

The chunk's ID. Matches chunk_id in query citations.

chunks[].contentstringrequired

The chunk's text.

chunks[].metadataobjectrequired

The metadata stored with the chunk.

Status codes

StatusMeaning
200The search ran. An empty list means nothing matched.
401The key is missing, malformed, or revoked.
402Your plan's monthly allowance is used up.
403The key's capability or scope doesn't allow reading this engine.
404The engine doesn't exist in the key's workspace.
422A field is missing or invalid.
429The read rate limit was hit.