Skip to content

v0.4.3 — agentbrain rules: install memory discipline into any client

Choose a tag to compare

@2672243194 2672243194 released this 22 Aug 12:52
· 5 commits to main since this release

The discipline-installer release

Registering an MCP server makes the memory tools available — but most clients
only call them if a rule file tells them to. That was the last manual gap:
you had to hand-write "query the vault at task start" into every client. Now
one command does it.

agentbrain rules — install the memory discipline anywhere

Run it in any project root:

agentbrain rules                              # print the discipline block (generic)
agentbrain rules --agent claude --write       # CLAUDE.md
agentbrain rules --agent codex --write        # AGENTS.md
agentbrain rules --agent trae --write         # .trae/rules/project_rules.md
agentbrain rules --agent cursor --write       # .cursor/rules/agentbrain.mdc (alwaysApply)

The block installs the full three-phase workflow:

  • Task startmemory_query (top_k=5) with the task topic; read hits first
  • Mid-task — re-query on a new subtask, an error, or a topic switch the
    initial query didn't cover (plain continuation re-queries nothing — token
    discipline)
  • Wrap-upmemory_ingest each distinct reusable lesson, with user confirmation
  • Secrets — never enter the vault; ${ENV:VAR_NAME} placeholders instead

Safety properties, locked by tests:

  • Existing rule files are never overwritten — if you already have
    CLAUDE.md or .trae/rules/project_rules.md with your own content, the
    block is appended. Your rules stay byte-identical.
  • Idempotent — a marker detects prior installation; re-runs are no-ops.

Also in this release

  • ONBOARDING.md now suggests the owner run rules --write after wiring up a
    new agent's MCP, closing the loop: onboarding → tools available → discipline
    installed.

Verification

  • 95 tests (8 new: block rendering per agent, file creation, append-not-overwrite
    on pre-existing user rules, idempotency, unknown-agent error path)
  • CLI smoke test: agentbrain rules prints the block; --write paths verified
    on tmp fixtures
  • Wheel + sdist built, twine check PASSED, published on PyPI:
    https://pypi.org/project/mnemosyne-lite/0.4.3/
pip install --upgrade mnemosyne-lite