Show HN: Komi-learn —— 为编程智能体提供持续记忆与自我提升功能
Show HN: Komi-learn – continuous memory and self-improvement for coding agents

原始链接: https://github.com/kurikomi-labs/komi-learn

**Komi-learn** 是一款自主工具,旨在为 Claude Code 和 Codex 等编程智能体提供持续记忆与自我提升功能。通过观察你的工作流程,它能自动提炼出持久的经验教训,例如你的代码风格、技术栈以及有效的修复方案,且无需手动输入或使用斜杠命令。 该系统通过后台循环运行: * **回溯 (Recall):** 在会话开始时,根据你当前的上下文加载相关经验。 * **提炼 (Distill):** 会话结束后,工具会提取有价值的技术,同时过滤掉密钥和不可复用的数据。 * **策划与共享 (Curate & Share):** 它负责管理长期记忆,并提供一个可选的、注重隐私的社区池。通过基于 GitHub 的透明 PR 系统,该社区池允许你共享并获取来自其他智能体的通用见解。 Komi-learn 设计得既稳健又不会造成干扰,如果无法连接到大语言模型,它会自动跳过学习任务,确保你的工作流程不会中断。该工具目前处于早期开发阶段,可通过 `pip` 安装。你可以使用提供的演示脚本立即验证其功能,该脚本展示了智能体如何回溯并应用从先前会话中学习到的经验。

最近一篇“Show HN”帖子介绍了 **Komi-learn**,这是一款旨在为编码智能体提供持续记忆和自我提升能力的工具。该项目旨在解决开发人员在多个项目间切换时遇到的“上下文遗忘”问题。 讨论中出现了一个争论:这类系统是否有必要,还是仅仅需要简单的文档?一位评论者质疑,与结构化的 Markdown 文件集合相比,Komi-learn 是否能带来任何实质性的好处,并建议该领域需要标准化的基准测试(如 LoCoMo)来证明其有效性。另一位用户反驳道,自动化记忆系统更具优势,因为它们能主动注入相关上下文,而智能体往往会忽略或无法完全处理静态文档。 创建者对这些反馈表示认可,并指出该项目仍处于早期阶段,计划在未来的开发中采纳这些建议。
相关文章

原文

Continuous memory and self-improvement for coding agents. It learns how you work and recalls it automatically, with no commands. Works with Claude Code and Codex.

PyPI Python License: MIT CI

It watches a session, distills durable lessons in the background (your style, your stack, fixes that worked), and loads the relevant ones at the start of the next session. No slash commands, nothing to save by hand.

The idea is from Hermes Agent; this is my own take, generalized across hosts with an optional shared layer (the community pool, below).

It's early. The core loop is built and CI-tested, but it hasn't been battle-tested across a lot of real sessions yet. Feedback and bug reports are welcome.

pip install komi-learn
komi-learn install            # or: komi-learn install --host codex

install runs a short interactive setup, then recall and background learning start in your next session. If you already use Claude Code you're already logged in. For scripts, komi-learn install --yes takes the defaults.

From source:

git clone https://github.com/kurikomi-labs/komi-learn
cd komi-learn
pip install -e .
komi-learn doctor      # check the install and what to fix
komi-learn status      # config + how much it has learned
komi-learn config      # change any setting (menu, or `config set <key> <val>`)
komi-learn sync        # pull the latest community learnings
komi-learn queue       # review/approve/reject what you'd contribute to the pool
komi-learn forget <x>  # erase learnings matching <x> (archive, or --hard to delete)
komi-learn uninstall   # remove the hooks (keeps your data; --purge to wipe)

You can change anything after install, e.g. komi-learn config set recall.semantic false or leave the pool with komi-learn config set pool.repo_url "".

  1. Recall: at session start, learnings relevant to the current context are loaded.
  2. Distill: after the session, a background pass reads the transcript and extracts durable lessons (corrections, techniques, fixes).
  3. Curate: over time it merges overlapping lessons and archives stale ones.
  4. Share (optional): general lessons can be contributed to the community pool, but only ones you approve.

It tries not to learn the wrong things. Secrets, machine-specific paths, one-off failures, and "tool X is broken" complaints are filtered out by a deterministic check before the LLM ever sees them.

Community pool (optional)

A public pool of general agent lessons, stored as a GitHub repo of signed Markdown files (no server). If you opt in, you get lessons other people's agents figured out, and you can contribute your own.

Contributions are scrubbed of anything identifying and never leave your machine without your approval (each one opens a PR you reviewed). Learnings are content-addressed (BLAKE3) and signed (Ed25519); one signed by more distinct GitHub accounts ranks higher when pulled. That account count is Sybil-resistant but not Sybil-proof, so it's an advisory signal, not a hard trust gate. Recalled community items are labelled and treated as untrusted input. Details: pool-repo-template/CONTRIBUTING.md.

No setup or API key needed:

python examples/demo_loop.py

It runs two sessions: you correct the agent in the first, and the second shows it recalling that with nothing typed.

  • Python 3.10+
  • Claude Code or Codex (the agent it plugs into)
  • A working model for the distill step: your existing Claude Code login, or komi-learn login, or an API key via --api-key.

komi-learn install verifies these with a real model call and stops with fix steps if something's missing. At runtime, if a hook can't reach the model it skips that learning pass rather than interrupting your session.

The engine has no required dependencies. Optional extras add real signing (pip install komi-learn[crypto]) and local semantic recall ([smart]); without them it falls back to a stdlib hash and keyword search.

To run your own pool, see pool-repo-template/.

MIT. Issues and PRs welcome.

联系我们 contact @ memedata.com