convez.ai
AgenteAutomaçãoIntermediário
KorenKrita

Nokori — Camada de Memória Comportamental para Agentes

KorenKrita/nokori

Transforma correções em regras que o agente lembra e aplica sozinho

Ver no GitHub
InicialPluginScore · de 0 a 100

Nokori é uma camada de memória local que transforma correções em regras de comportamento duráveis para Claude Code e Cursor. Armazena tudo localmente em SQLite e recupera regras relevantes automaticamente durante sessões, bloqueando ações perigosas antes que o agente as execute.

Instalação

$npx convez-ai KorenKrita/nokori

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
2
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 mês
Versão
v0.5.54
Issues abertas
9
Contribuidores
1

Casos de uso

  • Prevenir erros repetidos (force pushes, migrações esquecidas, comandos em produção)
  • Manter preferências comportamentais consistentes entre projetos e sessões
  • Bloquear automaticamente ações perigosas com base em histórico de correções

Veredito

Solução sofisticada e bem-arquitetada para um problema real: agentes esquecendo correções entre sessões. A abordagem local-first com SQLite é prudente, mas requer disciplina do usuário para alimentar o sistema com feedback estruturado. Ideal para desenvolvedores que trabalham com Claude Code/Cursor em workflows críticos.

README

A tradução para o português deste README ainda está na fila.

Nokori 残り


What experience leaves behind runs deeper than memory.

Nokori (残り) means what remains: the thing still standing in place after the noise dies down.

Every session ends, and every correction you made evaporates with it. In the next session the agent wakes a stranger again, the same stranger who force-pushes, forgets to run the migration, types a dangerous command straight at the production database.

Nokori refuses to let it forget. It settles every "don't do that" you ever said into recallable behavioral rules: when your words drift back toward that scene, the rule surfaces on its own inside the agent's context. New rules first live as candidates underwater, collecting evidence in the background. Only after the cold path and posthoc evidence trust them can the sharpest ones become Gate-eligible and block the first risky tool call before the agent touches your files.

Your data stays on your machine, in SQLite, the whole way through. Retrieval during a chat never touches a model. Only the post-session extract calls an LLM, and even then it is fed nothing but compressed session fragments. Want it fully offline? Point the endpoint at a local Ollama.


Who is it for

Before / After

Without NokoriWith Nokori
The same correction is repeated every sessionThe correction becomes a durable behavioral rule
Risky tool calls rely on the agent remembering contextTrusted Gate rules can block before the tool runs
Preferences vanish with the chat windowRules stay local and follow you across projects
Retrieval means waiting on a modelHot-path recall is deterministic file I/O + scoring

One minute overview

You correct Claude / Cursor
    └─▶ Nokori carves a rule (what scene + what to do)
            └─▶ Next time your words drift near that scene
                    └─▶ The rule auto-writes into the agent's context (reminder)
                            └─▶ If it later becomes trusted + gate_eligible:
                                 block once before the first matching tool call (Gate)

During a chat Nokori only does retrieval and small file I/O, never making you wait on a model. The LLM is only called after the session closes, when it extracts new rules from the transcript at its own pace.


Quick install

Four commands. Local memory. No hosted database.

Prerequisites: Python >= 3.11, Claude Code or Cursor already installed

# Recommended: pipx with local semantic retrieval
brew install pipx && pipx ensurepath
pipx install "nokori[local-embed]"

# Register hooks
nokori install --all        # or --cursor / default is Claude Code only

# Verify
nokori health
# Minimal install (BM25 only, no local model)
pipx install nokori

# Dedicated venv
python3 -m venv ~/.local/venvs/nokori
~/.local/venvs/nokori/bin/pip install "nokori[local-embed]"
echo 'export PATH="$HOME/.local/venvs/nokori/bin:$PATH"' >> ~/.zshrc

# From source
git clone https://github.com/KorenKrita/nokori.git && cd nokori
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[local-embed,dev]"

Full installation guide (Cursor config, updating, uninstalling) in Installation


Quick start

# 1. Add a candidate rule
nokori add \
  --trigger "Force pushing to a shared branch" \
  --action "Use --force-with-lease, or push to a new branch" \
  --severity high_risk

# 2. Verify the shadow match
nokori test "I'll just git push --force this branch"

# 3. Run maintenance (let evidence move rules forward)
nokori maintain

# 4. Rule out of date? Dismiss it
nokori dismiss <short_id>

Just open Claude Code or Cursor and work as usual. When a rule matches, the agent sees the injected reminder before it replies. For trusted + gate_eligible rules, the first sensitive tool call is blocked once.


Core features


Documentation

GuideWhat it gives you
🚀 Installationpipx install, Cursor config, updates, uninstalling
🧠 Architectureflywheel mechanism, hook timing, injection vs Gate, Shadow Pool
⚙️ Configurationconfig.toml, environment variables, full reference
🔎 Retrieval EngineBM25, embeddings, RRF fusion, injection tiers
🌱 Rule Lifecyclestate machine, promotion evidence, maintenance tasks
🧊 Automatic Extractioncold-path pipeline, merge strategy, async mode
🛡️ Gate Mechanismtwo-layer matching, configuration, prompt-hash safety
⌨️ CLI Referenceall commands and options
🖥️ Web UIvisual dashboard features and development

Relationship with existing systems

SystemRelationship
CLAUDE.mdComplementary. Nokori doesn't touch your CLAUDE.md; it handles the dynamic "when X, do Y"
Claude Code auto-memoryNo conflict. Memory leans factual, Nokori leans behavioral rules
Other memory pluginsHooks can coexist, but avoid stacking many context-injection plugins

Data storage

All data lives in one local directory, ~/.nokori/. There is no network sync. Rules store behavioral descriptions, not your source code. Only the cold-path extract calls an LLM; point the endpoint at a local Ollama for fully offline operation.


Development

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[local-embed,dev]"
python -m pytest tests/

Project constraints: hot-path hooks use only stdlib + urllib (no LLM calls between prompt and reply), all hooks wrapped in top-level try/except fail-open. Base install includes fastapi + uvicorn for the web dashboard.


License

MIT

Ver o original no GitHub

Bom para

Relacionados