Skip to content

Retrieval

Retrieve
POST/api/v1/retrieval/retrieve
Search Files
POST/api/v1/retrieval/files/search
Grep File
POST/api/v1/retrieval/files/grep
Read File
POST/api/v1/retrieval/files/read
ModelsExpand Collapse
RetrievalRetrieveResponse = object { results }

Response containing retrieval results.

results: array of object { content, metadata, rerank_score, 2 more }

Ordered list of retrieved chunks.

content: string

Text content of the retrieved chunk.

metadata: optional map[string or number or boolean or array of string]

User-defined metadata associated with the chunk.

One of the following:
string
number
boolean
array of string
rerank_score: optional number

Relevance score from the reranker, if reranking was applied.

score: optional number

Hybrid search relevance score.

static_fields: optional object { attachments, chunk_end_char, chunk_index, 5 more }

Built-in fields stored for every exported chunk.

attachments: optional array of object { attachment_name, source_id, type }

Attachments associated with the chunk

attachment_name: string

Attachment-relative path, e.g. ‘screenshots/page_7.jpg’.

source_id: string

File ID to pass as source_id when fetching the attachment.

type: string

Attachment kind, e.g. ‘screenshot’, ‘items’.

chunk_end_char: optional number

End character offset of the chunk.

chunk_index: optional number

Index of the chunk within the file.

chunk_start_char: optional number

Start character offset of the chunk.

chunk_token_count: optional number

Token count of the chunk.

page_range_end: optional number

Last page number covered by this chunk.

page_range_start: optional number

First page number covered by this chunk.

parsed_directory_file_id: optional string

ID of the parsed file.

RetrievalSearchResponse = object { files }

File search results.

files: array of object { file_id, file_name }

Matching files with names.

file_id: string

ID of the file.

file_name: string

Display name of the file.

RetrievalGrepResponse = object { matches }

Grep results for a file.

matches: array of object { content, end_char, start_char }

Regex matches found in the file.

content: string

Matched text content.

end_char: number

End character offset of the match.

start_char: number

Start character offset of the match.

RetrievalReadResponse = object { content }

File read result.

content: string

Parsed text content of the file.