尧图网站设计 尧图网站设计YAOTU DESIGN
ARTICLE DETAIL

资讯详情

深耕网站设计与一线实操的经验洞察。

2026-02-20 Thursday

2026-02-20 Thursday 2026-02-20 Thursday【免费下载链接】LEANN[MLsys2026 Best Paper]: https://arxiv.org/abs/2506.08276. RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.项目地址: https://gitcode.com/GitHub_Trending/le/LEANNDeployed the v2.1.0 hotfix for the payment gateway timeout issue.Root cause: connection pool exhaustion under high concurrent load.Fix: increased pool size from 10 to 50 and added circuit breaker pattern.Alice reviewed the Kubernetes HPA settings — autoscaling now triggers at 60% CPU.Need to follow up with the SRE team about Prometheus alerting thresholds.从格式上看这是一份典型的**半结构化工作日志记忆**# 标题记录日期与星期正文用无序列表逐条记录当日关键事件。同类文件还包括 2026-02-15.mdREST 迁移 gRPC 的讨论与基准测试结论和 2026-02-25.md与 ML 团队讨论向量数据库选型最终决定用 LEANN 做 PoC。它们共同构成 OpenClaw 记忆检索测试的输入语料。 在 conftest.py 中memory_fixtures fixture 会把整个 fixtures 目录复制到临时目录供测试使用skill_dir 则指向 skills/leann-memory说明这些记忆文件正是 leann-memory 技能要索引、检索的典型数据源。 ## 二、为什么这类记忆文件适合做语义检索 像 2026-02-20.md 这样的工作日志关键字面如 pool size、HPA、circuit breaker与实际业务提问之间存在语义鸿沟。使用者更可能这样提问 - 支付网关超时问题我们是怎么修复的 - 连接池参数改成多少了 - 自动扩缩的触发条件是什么 这些问题几乎不会与日志文本逐字重合但语义高度相关。这正是 LEANN 语义检索的用武之地。[leann-memory 技能说明](https://link.gitcode.com/i/dbf792473ec39e0eb4d9e4f4a387b563) 明确指出LEANN 提供 **97% 存储压缩的语义记忆搜索**传统方案为每个 chunk 保存完整嵌入向量50K 片段约 75 MBLEANN 通过基于图的选择性重算压缩到约 2 MB并且使用本地嵌入模型零 API 成本、零网络延迟。其工作原理是LEANN 只存储剪枝后的邻居图而非完整向量检索时由本地守护进程按需重算嵌入OpenClaw 的异步睡眠时间计算模型恰好能隐藏这一重算延迟。 因此把 2026-02-20.md 这类记忆文件纳入 LEANN 索引等于给智能体装上了以语义而非关键词回忆工作史的能力。 ## 三、安装与首次建索引 leann-memory 技能以 OpenClaw skill 形式分发skills/leann-memory/claw.json 清单显示其许可为 [shell]、入口为 instructions.md、兼容 Claude/GPT/Gemini/Qwen/Llama 等模型要求 OpenClaw 0.8.0。安装分两步 bash # 安装 LEANN 核心 pip install leann-core # 安装技能或手动复制目录到 ~/.openclaw/workspace/skills/leann-memory/ clawhub install leann-team/leann-memory首次使用前用which leann校验 CLI 是否就绪。然后对记忆文件建索引命令取自 skills/leann-memory/instructions.mdleann build openclaw-memory \ --docs ~/.openclaw/workspace/MEMORY.md ~/.openclaw/workspace/memory/ \ --embedding-model all-MiniLM-L6-v2 \ --embedding-mode sentence-transformers把~/.openclaw/workspace/memory/替换为本文示例所在的tests/openclaw/fixtures/memory/目录即可对2026-02-20.md等文件建索引。几个关键参数的底层语义可以在 cli.py 中确认--embedding-model嵌入模型名CLI 默认值为facebook/contriever见 cli.py L810技能文档推荐轻量的all-MiniLM-L6-v2两者均可在本地运行。--embedding-mode嵌入执行模式传入sentence-transformers时走本地 sentence-transformers 路径相关提示逻辑见 embedding_compute.py。索引是幂等的重复执行leann build只处理新增或变更的文件不会重复嵌入。四、语义检索把日志变成可问答的记忆建好索引后用leann search检索命令同样出自 instructions.mdleann search openclaw-memory payment gateway timeout root cause --top-k 5 --json --non-interactive这里--top-k控制返回条数CLI 默认 5见 cli.py L515--json输出机器可读结果--non-interactive适合被 Agent 直接调用。--json的输出格式如下[ { id: a1b2c3, score: 0.847, text: Deployed the v2.1.0 hotfix for the payment gateway timeout issue..., metadata: { file_path: /data/web/disk1/git_repo/GitHub_Trending/le/LEANN/tests/openclaw/fixtures/memory/2026-02-20.md, source: memory/2026-02-20.md } } ]每个结果包含id、score、text、metadata四要素metadata记录了来源文件路径便于做溯源引用。针对这份日志以下几类问句都能命中对应条目我们是怎么修支付网关超时的 → 命中 v2.1.0 热修复记录连接池现在多大 → 命中 increased pool size from 10 to 50HPA 什么时候触发扩容 → 命中 autoscaling now triggers at 60% CPUSRE 那边还有什么待办 → 命中 follow up with the SRE team about Prometheus alerting thresholds若结果不够全面将--top-k提升到 1015 即可获得更完整的上下文instructions.md 的 Tips 部分明确说明这是低成本操作。五、持续同步让记忆索引跟随日志增长记忆文件会持续追加因此需要保持索引更新。技能提供了两种方式# 一次性检查并重建处理新增/变更文件 leann watch openclaw-memory --once # 后台持续监控每 30 秒检查一次 leann watch openclaw-memory --interval 30【免费下载链接】LEANN[MLsys2026 Best Paper]: https://arxiv.org/abs/2506.08276. RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.项目地址: https://gitcode.com/GitHub_Trending/le/LEANN创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表