混合检索
Memorose 检索默认融合多种信号,而不是只依赖单一路径。
检索过程
- 先对查询生成 embedding
- 执行向量检索
- 执行文本检索
- 根据
graph_depth做图谱扩展 - 按需并入组织知识
- 合并排序后返回结果
API 示例
curl -s -X POST "http://127.0.0.1:3000/v1/users/user_123/streams/$STREAM_ID/retrieve" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"org_id": "default",
"agent_id": "coding-assistant",
"query": "How should I help this user with Rust async work?",
"limit": 10,
"enable_arbitration": false,
"min_score": 0.2,
"graph_depth": 2
}'
常用过滤项
org_id:带上组织级共享知识agent_id:偏向某个 agent 的程序性记忆start_time/end_time:有效时间过滤as_of:事务时间点查询graph_depth:把图谱邻接关系纳入结果