hybrid-memory

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Hybrid Memory System

混合内存系统

We use two memory systems integrated into a single view:
  1. QMD (Vector Store): For retrieving documents, specs, and full content.
  2. Graphiti (Knowledge Graph): For retrieving facts, timelines, and relationships.
我们将两个内存系统整合为一个统一视图:
  1. QMD(向量存储):用于检索文档、规格说明和完整内容。
  2. Graphiti(知识图谱):用于检索事实、时间线和关系。

Primary Tool

主要工具

For 95% of memory queries, use the hybrid search script. It queries both systems in parallel.
bash
~/clawd/scripts/memory-hybrid-search.sh "your query"
Optional flags:
  • [group_id]
    — Specify agent group (default:
    clawdbot-main
    )
  • --json
    — Output JSON for programmatic use
对于95%的内存查询,请使用混合搜索脚本。它会并行查询两个系统。
bash
~/clawd/scripts/memory-hybrid-search.sh "your query"
可选参数:
  • [group_id]
    — 指定Agent组(默认值:
    clawdbot-main
  • --json
    — 输出JSON格式以支持程序化调用

Specific Tools (Advanced)

专用工具(进阶)

Only use these if the hybrid script fails or you need granular control.
仅在混合脚本失效或需要精细控制时使用这些工具。

Graphiti Only (Temporal/Facts)

仅使用Graphiti(时序/事实)

Search for specific temporal facts:
bash
~/clawd/scripts/graphiti-search.sh "your question" clawdbot-main 10
Log new facts (IMPORTANT):
bash
~/clawd/scripts/graphiti-log.sh clawdbot-main user "Name" "Fact to remember"
搜索特定的时序事实:
bash
~/clawd/scripts/graphiti-search.sh "your question" clawdbot-main 10
记录新事实(重要):
bash
~/clawd/scripts/graphiti-log.sh clawdbot-main user "Name" "Fact to remember"

QMD Only (Deep Document Search)

仅使用QMD(深度文档搜索)

If you need more results or specific file filtering:
bash
qmd search "query" -n 10
如果需要更多结果或特定文件过滤:
bash
qmd search "query" -n 10

Recall Pattern

召回流程

  1. User asks question ("What was the plan for the project?")
  2. Run Hybrid Search (
    ~/clawd/scripts/memory-hybrid-search.sh "plan for the project"
    )
  3. Synthesize Answer from both the temporal facts and document snippets found.
  4. If needed: Use
    read
    to get the full content of a file found in the QMD results.
  1. 用户提出问题(例如:“项目的计划是什么?”)
  2. 运行混合搜索
    ~/clawd/scripts/memory-hybrid-search.sh "plan for the project"
  3. 综合答案:结合找到的时序事实和文档片段生成答案。
  4. 如有需要:使用
    read
    命令获取QMD结果中找到的文件的完整内容。

When to Use Which

适用场景对照表

Question TypeUse
"What's in GOALS.md?"Hybrid search →
read
file
"When did we discuss X?"Hybrid search (Graphiti results)
"What did I say last Tuesday?"Graphiti direct
"Find notes about architecture"Hybrid search (QMD results)
问题类型适用方式
“GOALS.md里有什么内容?”混合搜索 →
read
读取文件
“我们什么时候讨论过X?”混合搜索(依赖Graphiti结果)
“我上周二说了什么?”直接使用Graphiti
“查找关于架构的笔记”混合搜索(依赖QMD结果)