POST /openapi/memorylake/api/v1/projects/{id}/documents/search
Performs semantic search over all documents in the project. Returns matched content ranked by relevance. Results are categorized into three types — table, paragraph, and figure — each identified by the type field.
curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v1/projects/proj-e7b262987be4589fabc60257ec2a2230/documents/search' \ -H 'Authorization: Bearer sk_xxxxxx' \ -H 'Content-Type: application/json' \ -d '{ "query": "What were the quarterly sales figures in 2024?", "top_n": 10 }'
Response
object
Show Search results
integer
Actual number of results returned
array
Search results ranked by relevance. Each item is a discriminated union — type decides which variant-only fields are present and which sub-field of highlight is populated. Click to expand the full per-item shape.
Show Result item
string
required
Discriminator. One of paragraph, table, or figure.
string
Document ID
string
Document file name, e.g. report_2024.xlsx
object
Source file info.
Show source_document properties
string
Original file name
object
Matched content. The object always has the same three optional fields below — exactly one is populated, selected by the parent item’s type.
Show highlight properties
Chunk[]
Populated when type=paragraph. Matched text spans, in document order. Absent otherwise.
Show Chunk properties
string
Plain-text snippet of the match
string
Location hint (e.g. page number p12, or a cell range for workbook paragraphs)
InnerTable[]
Populated when type=table. Matched sub-tables within the source table region. Absent otherwise.
Show InnerTable properties
string
Inner table ID
string
Cell range covered, e.g. A1:D50
integer
Number of data rows
string
Internal storage path of the materialized table
TableColumn[]
Column descriptors.
Show TableColumn properties
string
Column ID
string
Column header name
string
Inferred data type (e.g. string, number, date)
string
Column cell range
integer
Non-null value count
integer
Null value count
integer
Approximate number of distinct values
string
Minimum value (string-encoded)
string
Maximum value (string-encoded)
object[]
Sample raw values from the column
object[]
Sample formatted/display values
string
Model-inferred semantic comment for the column
boolean
Whether the column participates in a row hierarchy
object
Populated when type=figure. The matched figure descriptor. Absent otherwise.
Show figure properties
string
Original figure caption
string
OCR / extracted text inside the figure
string
Model-generated summary of the figure
string[]
Pre-generated questions the figure can answer
string
Internal storage path of the figure asset
string
Only when type=paragraph. Paragraph block ID inside the document.
string
Only when type=table. Table entity ID.
string
Only when type=table. Table title.
string
Only when type=table. Table footnote.
string
Only when type=table. Worksheet name (workbook tables).
string
Only when type=table. Model-inferred semantic name for the worksheet.
string
Only when type=table. Model-inferred semantic comment for the worksheet.
string
Only when type=table. Table region location, e.g. A1:D50.