跳到主要内容

混合检索

Memorose 检索默认融合多种信号,而不是只依赖单一路径。

检索过程

  1. 先对查询生成 embedding
  2. 执行向量检索
  3. 执行文本检索
  4. 根据 graph_depth 做图谱扩展
  5. 按需并入组织知识
  6. 合并排序后返回结果

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:把图谱邻接关系纳入结果