← 返回
未分类

Bm25 Rerank Memory

本地 BM25 + Embedding + Rerank 混合记忆检索。检索 /root/workspace/Remember 下的 Markdown 记忆文件,支持关键词+语义+重排。每次记忆搜索用它替代 mem0。
ckqiao
未分类 clawhub v1.0.0 100000 Key: 无需
★ 0
Stars
📥 296
下载
💾 0
安装

概述

BM25 Rerank Memory Search

调用本地检索脚本 /opt/memory/bm25_rerank_search.py,返回精确的上下文片段。

依赖

  • BM25: rank_bm25
  • 向量+重排: SiliconFlow API (BAAI/bge-m3 + BAAI/bge-reranker-v2-m3)
  • 安装: pip install rank-bm25 --break-system-packages

使用方式

搜索记忆

python3 /opt/memory/bm25_rerank_search.py search <查询词>

重建索引(记忆文件变更后需执行)

python3 /opt/memory/bm25_rerank_search.py reindex

检索逻辑

  1. BM25 关键词匹配 → 候选集 A
  2. BGE-M3 向量相似度 → 候选集 B
  3. A ∪ B 合并
  4. BGE-Reranker-v2-m3 重排 → 最终结果

输出格式

每条结果包含: [score] path:chunk_id + 内容片段 (最多显示前200字符)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 21:33 安全 安全

安全检测

暂无安全检测报告