Skip to main content

A continuous, zero-friction learning layer for AI agents — learns about you and improves its own skills across every session, with an anonymized, provenance-verified global knowledge pool.

Project description

komi-learn

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.

Install

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 .

Commands

komi-learn doctor      # check the install and what to fix
komi-learn update      # upgrade komi-learn + the agent's hooks (--check to only look)
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 reclassify  # re-scan memory; move newly-confidential learnings to private (.local)
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 "".

How it works

  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.

Try it offline

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.

Requirements

  • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

komi_learn-0.5.0.tar.gz (197.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

komi_learn-0.5.0-py3-none-any.whl (163.3 kB view details)

Uploaded Python 3

File details

Details for the file komi_learn-0.5.0.tar.gz.

File metadata

  • Download URL: komi_learn-0.5.0.tar.gz
  • Upload date:
  • Size: 197.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for komi_learn-0.5.0.tar.gz
Algorithm Hash digest
SHA256 0942d85f5cfc937df105112cf5ffe57af37b5ef6699962687d1b36ebc8f46661
MD5 e391524d5f7c4ef92121f7f997fe0ca1
BLAKE2b-256 e3c79efe4bfad2c2a5e52a9412be0f2ea51c6a85151e0b821af6a0b0f470c8c0

See more details on using hashes here.

File details

Details for the file komi_learn-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: komi_learn-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 163.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for komi_learn-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c88378d9793b90af813e2ad979f791b1d41c3a686ec8ca1a6058158d8546cce
MD5 be681f8838ff0de7884572bc39139204
BLAKE2b-256 d4c1f45985a80af2b32907016cef8d3cb4398845fa25422bdb668077e57db9e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page