POST /openapi/memorylake/api/v1/projects/{id}/search
所需权限:
project:search · instance路径参数
请求体
curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v1/projects/proj-e7b262987be4589fabc60257ec2a2230/search' \
-H 'Authorization: Bearer sk_xxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"query": "What were the quarterly sales figures in 2024?",
"user_id": "user-abc123",
"top_n": 10,
"threshold": 0.3
}'
响应
显示 组合搜索结果
显示 组合搜索结果
文档搜索结果。每个条目是一个可区分联合体 —
type 决定哪些变体专有字段存在,以及 highlight 的哪个子字段被填充。点击展开查看完整的单条目结构。显示 文档结果条目
显示 文档结果条目
匹配内容。该对象始终包含以下三个可选字段 — 根据父条目的
type 值,恰好填充其中一个。显示 highlight 属性
显示 highlight 属性
当
type=table 时填充。源表区域内匹配的子表。其他情况下不存在。显示 InnerTable 属性
显示 InnerTable 属性
记忆搜索结果。结构与搜索记忆相同。
{
"success": true,
"message": "Operation completed successfully",
"data": {
"documents": [
{
"type": "paragraph",
"document_id": "doc-80e1657a999bce34ef2f7056f117134d",
"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-7f432d326c7acd40563b4503da81cdd8",
"document_name": "sales_data.xlsx",
"table_id": "tbl-001",
"title": "Quarterly Sales Summary",
"sheet_name": "Sheet1",
"semantic_sheet_name": "2024 Quarterly Sales",
"table_region_info": "A1:D50",
"highlight": {
"inner_tables": [
{
"id": "itbl-001",
"data_range": "A1:D50",
"num_rows": 49,
"persist_path": "tables/doc-7f432d326c7acd40563b4503da81cdd8/itbl-001",
"columns": [
{
"id": "col-1",
"name": "Quarter",
"data_type": "string",
"range": "A2:A50",
"count": 49,
"null_count": 0,
"approx_ndv": 4,
"examples": [{ "v": "Q1" }, { "v": "Q2" }],
"display_examples": [{ "v": "Q1" }, { "v": "Q2" }]
},
{
"id": "col-2",
"name": "Revenue",
"data_type": "number",
"range": "B2:B50",
"min_value": "1200000",
"max_value": "3100000"
}
]
}
]
},
"source_document": { "file_name": "sales_data.xlsx" }
},
{
"type": "figure",
"document_id": "doc-7e00074632a081cdffe6700d4c496206",
"document_name": "report_2024.pdf",
"figure_id": 7,
"highlight": {
"figure": {
"caption": "Figure 7. Quarterly revenue trend, 2024",
"text": "Q1 $2.5M Q2 $2.8M Q3 $3.0M Q4 $3.1M",
"summary_text": "Bar chart showing steady quarterly revenue growth across 2024.",
"prequestion_list": [
"Which quarter had the highest revenue in 2024?",
"What was the revenue trend across 2024?"
],
"persist_path": "figures/doc-7e00074632a081cdffe6700d4c496206/fig-7.png"
}
},
"source_document": { "file_name": "report_2024.pdf" }
}
],
"memories": [
{
"id": "fact-b6729ff5905991da96a5eced75b95fa1",
"content": "User prefers Hangzhou cuisine restaurants",
"user_id": "user-abc123",
"expired": false,
"has_unresolved_conflict": false,
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}
]
}
}
任一列表在没有匹配项超过阈值时可能为空。请独立处理
documents 和 memories — 它们只是为了方便而一起返回的两个查找结果。