POST /openapi/memorylake/api/v1/projects/{id}/documents/search
table, paragraph, and figure — each identified by the type field.
Permission required:
project:doc_search · instancePath Parameters
string
required
Project ID
Request Body
string
required
Search query text
integer
default:"10"
Maximum number of results to return (minimum 1)
curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v1/projects/proj-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/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
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
Show Result item
string
required
Discriminator. One of
paragraph, table, or figure.string
Document ID
string
Document file name, e.g.
report_2024.xlsxobject
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
Show highlight properties
Chunk[]
InnerTable[]
Populated when
type=table. Matched sub-tables within the source table region. Absent otherwise.Show InnerTable properties
Show InnerTable properties
string
Inner table ID
string
Cell range covered, e.g.
A1:D50integer
Number of data rows
string
Internal storage path of the materialized table
TableColumn[]
Column descriptors.
Show TableColumn properties
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.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.integer
Only when
type=figure. Figure numeric ID.{
"success": true,
"data": {
"count": 3,
"results": [
{
"type": "paragraph",
"document_id": "doc-123",
"document_name": "report_2024.pdf",
"paragraph_block_id": "blk-456",
"highlight": {
"chunks": [
{
"text": "Q1 2024 sales reached $2.5M...",
"range": "p12"
}
]
},
"source_document": {
"file_name": "report_2024.pdf"
}
},
{
"type": "table",
"document_id": "doc-789",
"document_name": "sales_data.xlsx",
"table_id": "tbl-001",
"title": "Quarterly Sales Summary",
"sheet_name": "Sheet1",
"table_region_info": "A1:D50",
"highlight": {
"inner_tables": [...]
},
"source_document": {
"file_name": "sales_data.xlsx"
}
}
]
}
}