Zum Hauptinhalt springen
N

AccreMind (dsh-plugin)

ninthmonee/accremind/packages/dsh-plugin

Captures engineering experience from a coding session into a local Markdown knowledge base and hands the relevant parts back at the start of each turn; ships a CLI, a standalone workbench and a DeepSeek Harness adapter.

Installation

dsh plugin --profile web add github:ninthmonee/accremind

Dieses Plugin befindet sich im Unterverzeichnis packages/dsh-plugin des Repositorys.

README

AccreMindAccreMind

Models are always superseded by the next generation. Knowledge is not.

Turn the experience scattered across your projects into reusable knowledge assets.

English · 简体中文

CI License: MIT Node.js Core: host-agnostic DSH plugin

AccreMind is a local-first knowledge base for AI-assisted engineering. It turns the experience scattered across your projects — the decisions, the abandoned routes, the domain rules and shared conventions, the traps already fallen into, and how all of it connects — into Markdown knowledge assets you can commit, review and reuse. Then it puts them back in front of the model and the developer right before the next change.

Everything stays on your machine: Markdown is the source of truth, node:sqlite (WAL + FTS5 trigram) is only ever a rebuildable index. No background service, no external vector store, no telemetry.


Table of contents

The problem

Model context rolls over. Human memory decays. Documentation keeps the conclusion and throws away the reason.

The knowledge that actually cost a team something — "retrying this endpoint double-charges", "this library cannot be dynamically imported under SSR since 3.x", "we tried the queue-based design and reverted it" — lives in a chat thread, a postmortem, or one person's head. It is exactly the knowledge that is missing at the moment the next change is written, and exactly the knowledge an AI assistant cannot infer from the repository.

AccreMind stores that delta and nothing else.

How it works

Three moments, one knowledge base:

MomentWhat happens
Before a changeEntries that match the turn are injected as references — id plus one-line summary, explicitly marked as material, not instructions
During a changeTouching a file that an entry watches unfolds the full entry: preconditions, counterexamples, how to verify, where the evidence is
After a changeA turn-tail receipt lists what was used, with one-click "helpful / not helpful / inaccurate" feedback

Host model

AccreMind does not belong to any one host. The engine, @accremind/core, is a zero-dependency Node.js library — it imports nothing but node:* built-ins — and it is driven by three front doors that share the same public API:

Front doorPackageNeeds a host?
Plugin for DeepSeek Harness (DSH)@accremind/dsh-pluginYes — the first host integration, and the most complete one
Command lineaccremind (in @accremind/core)No
Standalone workbench@accremind/webuiNo

DSH is the first adapter, not the design centre: turn hooks, tools, the sidebar panel and skill export are the surface a host can offer, and every one of them is a thin mapping onto the kernel. Adding another host — an IDE extension, a server — means writing an adapter that calls the public API and expresses the same three layers in that host's own vocabulary.

The DSH integration does carry DSH-shaped defaults: per-user state lives in ~/.dsh/accremind/ (override it with globalDir) and exported skills land in .dsh/skills/<slug>/SKILL.md. Those paths are conventions of the adapter, not of the engine's data model — the knowledge itself is plain Markdown in the repository.

What we accumulate

"The experience scattered across projects" is not a slogan here — it is six concrete kinds of knowledge, each with a home in the store:

KindWhat it looks like in practiceEntry typeLayer
Decisions and their reasoningwhy this design, what it cost, what it rules out next timedecisionproject
Traps and abandoned routes"retrying this endpoint double-charges"; "we tried the queue design and reverted it"pitfallproject
Domain rulesbusiness invariants, temporal rules, what a settled order may never becomemodel / guidelinedomain
Shared conventionsnaming, error envelope, migration pattern, review expectationsguideline / processproject, and team_rule once accepted as a team norm
Shared-tech gotchas"this library cannot be dynamically imported under SSR since 3.x" — true in every repositorymodel / pitfallshared_tech
Process knowledgehow a release, rollout or incident is actually handled hereprocessproject / personal

Two properties make this a body of knowledge rather than a pile of notes:

  • Relations are part of the record. An entry states what it supersedes, which shared-tech entry it specializes, which team rule it overrides, and which tags and domains it belongs to. A specialised pair is never served together, so refinement replaces contradiction instead of adding to it.
  • Scope decides who gets it. A personal entry stays with you, project stays in the repository, domain and shared_tech travel to other repositories, and team_rule is organisation-wide — it is only ever proposed by a person, never written by automatic capture, and is exempt from automatic demotion.

What is deliberately not accumulated

  • Anything the code, tests or existing docs already say.
  • Diffs and file listings that git log regenerates for free.
  • Machine-local paths and one-off environment noise.
  • Unverified guesses: they wait in needs_confirmation for a human, and are dropped if nobody vouches for them.

How a candidate is filtered

Only a knowledge_delta — the part a reader could not reconstruct from the code and the existing docs — is accepted. Every candidate goes through five-way triage:

DispositionMeaning
index_onlyAlready discoverable in code/docs; index it for retrieval, do not store a card
link_existingDuplicate of an entry we already have; link to it instead
knowledge_candidateA real delta; promote into a Markdown card
needs_confirmationPlausible but unverified; park it until a human decides
discardEmpty delta, a guess, or a machine-local path; drop it

New cards start in probation. They become verified only after being surfaced by real turns and validated — no silent self-promotion.

Three injection layers

LayerFires onDefault budgetRole
Resident rulesStart of every turn500 tokensTeam hard constraints; byte-stable so the KV cache survives
Turn radarEach turn, by query300 tokensMatching entries by id, marked as reference material
Tool guardReading/writing a watched file240 / 1500 tokensUnfolds the full entry when the same file is touched

All three are read-only reference material. They never override host rules and have no execution authority.

Features

  • Local-first, two-tier storage — team knowledge lives in .accremind/ inside the repo (commit it, review it in PRs); drafts, queues, indexes and per-user retrieval logs live in ~/.dsh/accremind/. The index can be rebuilt from the Markdown at any time.
  • Five-way triage — index_only / link_existing / knowledge_candidate / needs_confirmation / discard, so code-recoverable input never pollutes the base.
  • Shadow probation — new entries are used quietly, then promoted on independent validation. Repeated exposure without feedback archives them.
  • Staleness and symbol anchors — entries record watch_paths and symbol-anchor hashes. Code changes or an expired review window push the entry into a re-check queue; a counterexample suspends it immediately. Formatting-only edits do not raise false alarms.
  • Rule documents — domain / business_rules / project_norms / project_profile are indexed by ## section, with import, change proposals, accept/reject and a change log, written to .accremind/docs/ and reviewed with the code.
  • Cross-repository knowledge — repository identity comes from .accremind/repo.json, then origin, then a path hash. Entries in the domain and shared_tech layers surface across repositories in the same domain.
  • Structured relations — an entry can declare what it supersedes, which shared-tech entry it specializes, and which team rule it overrides, and it shares controlled tags and domains with related knowledge. Relations are honoured at serving time — a specialised pair is never delivered together — so the structure survives instead of decaying into prose links.
  • Receipts and offline evaluation — every turn keeps a redacted question plus feedback; accremind eval replays real feedback and the real questions written in .accremind/eval/cases.jsonl, and reports three arms side by side: nothing shown at all (off), resident team rules only (rulesOnly), and the full reminder path. lift is what the last one adds over the first two. --grid sweeps parameters, --apply writes back only when the score improves.
  • Workbench — seven views covering overview, library, candidate review, rule documents, governance, turn receipts and a Git radar. A verified entry can be exported to .dsh/skills/<slug>/SKILL.md.
  • Self-improvement, unattended and reversible — configurable via autoEvolve: { tune: false, demote: false }:
    • Auto-tuning runs one minute after a session opens, at most once a week per repository. It only applies when there are ≥ 30 labelled samples, the score improves by ≥ 0.03, recall drops by no more than 0.02, and rejected entries do not surface more often. It then enters an observation window and rolls itself back if either the adjusted feedback or the real "does not apply" rate gets worse. Every step is recorded in ~/.dsh/accremind/tuning-history.jsonl and can be undone.
    • Demotion moves a verified entry back to probation when at least two sessions in the current revision flag it as "not applicable" at ≥ 25% of exposures, or when it has been surfaced in ≥ 40 sessions over 30 days and never opened, quoted or confirmed. Suspended entries archive after 30 days untouched; probation drafts after 60. Team norms, entries confirmed on the current revision, and counterexample-backed entries are exempt. Every action lands in the overview's needs your attention list with a one-click undo.

Quick start

git clone https://github.com/ninthmonee/AccreMind.git
cd AccreMind
pnpm install
pnpm build      # builds core, plugin and the inlined workbench bundle
pnpm verify     # build + full test suite + workbench artifact fingerprint

Then link the plugin into a DSH profile:

pnpm install:dsh                      # desktop profile by default
pnpm install:dsh -- --profile web     # or a specific profile

From the plugin marketplace

The package is published as @accremind/dsh-plugin; the index URL for DSH's Custom plugin indexes is:

https://raw.githubusercontent.com/ninthmonee/AccreMind/main/market/index.json

Add it under Plugins → Experimental plugins → Custom plugin indexes, then install AccreMind from Discover. Release mechanics are documented in docs/market-publishing.md.

Host integrations

DeepSeek Harness (DSH)

The reference adapter. After installation an AccreMind panel appears in the sidebar, entries are injected as the conversation needs them, and a receipt is appended to each turn. Six tools are available to the model:

ToolPurpose
accremind_captureSubmit a candidate and run five-way triage
accremind_searchSearch by keyword, kind, layer or file path
accremind_getFetch full text, preconditions, verification steps and evidence
accremind_validateRecord a success or failure for this use; failure suspends the entry
accremind_export_skillFreeze a verified entry into a DSH skill document
accremind_propose_doc_changePropose a change to a rule document for human review

Standalone workbench

The same UI runs without DSH (port 3180, loopback only):

pnpm ui -- --port 3180
ViewWhat it answers
OverviewWhat needs my attention, how healthy is the base
LibraryBrowse, search and summarise every entry
ReviewCompare baseline against delta, check evidence
Rule documentsDomain, business rules, project norms and pending proposals
GovernanceStaleness re-checks, counterexamples, settings
ReceiptsWhich entries each turn actually used
Git radarScan commit history for high-signal experience

For UI work use pnpm dev:webui (Vite HMR). Before releasing, always run pnpm verify: check:webui compares the packages/webui sources with the inlined artifact so a UI change cannot silently miss the published bundle.

Team knowledge base, domains and mounting scope

Where a piece of knowledge belongs decides who gets reminded of it. AccreMind mounts knowledge in three layers:

Mounted toBest forStored inReminded to
This project projectProject norms, project profile, business rules that only apply to this repository<repo>/.accremind/docs/This repository; can be narrowed to one sub-project
Domain domainDomain descriptions, business rules shared across projectsTeam knowledge base (this repository when none is mounted)Every project in that domain, sub-domains included
Personal personalPersonal preferences (answer style, habits)~/.dsh/accremind/personal/docs/<user>/Only you; never committed

The team knowledge base is a separate Git repository for what the team shares and no single project owns:

<team knowledge base>/
├── domains/<domain>.json        # one file per domain: name, aliases, parent, owners
├── members/<repo>.json          # one file per repository: its domains (core / consumer, optionally per sub-project)
├── docs/<category>/*.md          # domain documents + changes.ndjson + CHANGELOG.md
└── feedback/<repo>/<user hash>.json  # per-person usage counts (counts only, never prompts)
pnpm accremind team set ~/code/team-knowledge     # mount; otherwise ~/.dsh/accremind/knowledge/ on this machine
pnpm accremind domains add refund --parent payment --aliases refund --owners lead@example.com
pnpm accremind domains join refund                   # this repository joins as a core project
pnpm accremind domains join payment --role consumer   # caller only: sees rules meant for everyone, not core-only details
pnpm accremind subprojects add pay --paths services/pay/ --domains payment --owners pay-dev@example.com
pnpm accremind docs import refund.md --category business_rules --scope domain --domains refund [--audience core]
pnpm accremind docs import norms.md --category project_norms --subproject pay
pnpm accremind docs import my-prefs.md --category personal_preferences
  • A domain can contain many projects, and a project can join many domains; rules from a parent domain reach projects in its sub-domains.
  • The catalog is split per domain and per repository member file, so two people adding a domain or joining one never edit the same file and Git merges stay clean. An older domains.json is split automatically on the first change.
  • With a team knowledge base mounted, importing into a domain that is not in the catalog is refused (to prevent spelling forks); pass --new-domain when it really is new. The workbench import dialog can create the domain (optionally with a parent) and make this repository join it.
  • The workbench importer accepts Markdown uploads (multi-select, drag and drop) and direct paste.
  • Mounting to "this project" can target another project: the open one by default, another registered on this machine, or any folder picked from the browser.
  • Domains and memberships built on this machine before a team knowledge base existed are carried over once on mount; files the team already has win.
  • AccreMind only writes files — it never commits or pushes for you. The rule documents page shows how many changes in .accremind/ and the team knowledge base are uncommitted, unpushed or unpulled.
  • The rule documents page filters by mounting scope, domain (sub-domains and aliases included) and storage location, and full-text searches section content; the library filters entries by domain and sub-project.
  • Personal preferences follow the person: switching between the local identity and the host login moves them to the current identity.
  • When rules collide: team rules > project norms and experience > domain rules > personal preferences. Personal preferences are resident but last.
  • When an entry's evidence cites a document section (D:<doc>#<section>) and that section is edited or deleted, the entry goes back for review automatically.
  • Turn receipts state why each reminder matched; reporting "does not apply" lets you pick a reason (wrong domain, not this project or sub-project, wrong version, outdated, unrelated to this question).

Project-level settings live in .accremind/repo.json and are reviewed with the repository:

{
  "domains": ["refund", "payment:consumer"],
  "owners": ["team-lead@example.com"],
  "projects": [{ "id": "pay", "paths": ["services/pay/"], "domains": ["refund"], "owners": ["pay-dev@example.com"] }],
  "settings": {
    "budgets": { "turnRadarTokens": 400 },
    "tuning": { "textSaturation": 6 },
    "autoDemotion": { "demoteUnusedShownSessions": 12 }
  }
}

Keeping a repository out uses the same settings block, reviewed with the repository and effective for everyone who clones it:

{
  "settings": {
    "enabled": false,
    "excludePaths": ["vendor/", "dist/", "third_party/protobuf/"]
  }
}
  • enabled: false pauses the whole repository: no injected rules, no reminders, no file guard, no capture, no automatic tuning. Read-only commands such as accremind search and accremind digest keep working.
  • excludePaths only excludes prefixes inside the repository (vendored trees, generated code): those files get no file guard and stay out of the turn's changed-file signals. Absolute paths, ~ paths and entries containing .. are ignored.
  • From the CLI: accremind repo pause / repo resume / repo exclude vendor/ dist/ / repo unexclude vendor/; plain accremind repo prints the current scope.
  • The switches are re-read every turn, so a change applies on the next turn without restarting the host.

A project with a custom settings.tuning opts out of automatic tuning. Owners decide who the to-do belongs to: experience looks for the domain owner → sub-project owner → repository owner, and the workbench can show "only mine"; pnpm accremind digest prints the last seven days (pending, automatic demotions, document changes, tuning, reminder quality), addressing the reader by their Git user name.

Where the data lives

PathContents
<repo>/.accremind/entries/Verified experience cards (Markdown, with revisions and evidence)
<repo>/.accremind/evidence/Evidence attachments
<repo>/.accremind/rules/Resident rules
<repo>/.accremind/docs/The four rule document kinds and their change log
<repo>/.accremind/repo.jsonRepository identity, business domains, sub-projects, owners and project settings (commit this)
<team knowledge base>/Domain catalog, domain documents and team usage counts (a separate Git repository)
~/.dsh/accremind/knowledge.jsonWhere the team knowledge base is mounted (ACCREMIND_KNOWLEDGE_ROOT overrides)
~/.dsh/accremind/personal/docs/Personal preference documents, per user
~/.dsh/accremind/probation/Probation drafts (never written into the repo)
~/.dsh/accremind/queue/Auto-capture and evaluation queues
~/.dsh/accremind/index/Rebuildable SQLite index
~/.dsh/accremind/{personal,domain,shared-tech}/Cross-repository knowledge layers
~/.dsh/accremind/{registry,users,workspaces}/Repository registry, user identity, per-repository retrieval logs

CLI

pnpm accremind status                     # overview + staleness sweep
pnpm accremind search "order retry" --scope auto --file packages/core/src/store/local-store.ts
pnpm accremind get K-XXXX                 # full entry
pnpm accremind rebuild                    # rebuild the index from Markdown
pnpm accremind bootstrap --top 10         # scan Git history for high-signal commits
pnpm accremind bootstrap --extract        # hand them to the model for triage
pnpm accremind migrate                    # cross-repo migration rehearsal; --apply, --rollback
pnpm accremind repo --domains payments,ledger:consumer [--new-domain]
pnpm accremind repo                       # current scope: paused? which prefixes are excluded?
pnpm accremind repo pause | resume        # pause the whole repository / resume it
pnpm accremind repo exclude vendor/ dist/ # exclude repository prefixes (unexclude reverts)
pnpm accremind team [set <dir> | unset]  # team knowledge base
pnpm accremind domains [list | add | join | leave]
pnpm accremind subprojects [list | add <id> --paths a/,b/ | remove <id>]
pnpm accremind docs import ./adr --category business_rules --scope domain --domains refund
pnpm accremind docs list --scope domain --domain payment   # also --category, --query
pnpm accremind docs search partial refund
pnpm accremind docs proposals             # pending document and vocabulary proposals
pnpm accremind docs accept <proposal-id>
pnpm accremind eval                       # replay feedback + cases.jsonl, with off / rulesOnly baselines
pnpm accremind eval --grid --apply        # replay feedback, tune, write back only if better
pnpm accremind eval auto                  # run one tuning cycle now (incl. observation verdict)
pnpm accremind eval history               # tuning history and observation state
pnpm accremind eval rollback              # undo the last tuning
pnpm accremind usage [--days 7]           # model calls and tokens spent on extraction and topic tagging
pnpm accremind demotions [--all]          # automatic demotion / archive records
pnpm accremind demotions restore K-XXXX   # undo a demotion or archive
pnpm accremind digest [--days 7] [--json]   # recent digest: pending, automatic changes, document changes, reminder quality, model usage
pnpm accremind ui --port 3180

Every command accepts --repo and --global-dir, defaulting to the current directory and ~/.dsh/accremind.

Model access (optional)

Retrieval, reminders, file guards and the staleness sweep are entirely local and need no key. Only extraction (bootstrap --extract, extraction in the workbench, and auto-capture when enabled) calls a model. The plugin reuses the host's llm service by default; an external endpoint can be configured with environment variables:

cp .env.example .env
# ACCREMIND_LLM_BASE_URL / ACCREMIND_LLM_MODEL / ACCREMIND_LLM_API_KEY
# or DEEPSEEK_API_KEY / OPENAI_API_KEY

Keys are only sent to the service they belong to: a custom ACCREMIND_LLM_BASE_URL pointing at another host never receives a DeepSeek or OpenAI key.

Design principles

#PrincipleWhat it means in the implementation
1Only the deltaBaseline answer is generated from code and docs first; triage drops anything reconstructible
2Local-first, Markdown is the source of truthEvery entry is a reviewable card; SQLite is a rebuildable index
3Reference, not instructionInjected inside read-only tags, sanitised, marked as material; no host override, no execution
4Evidence and freshness before conclusionsEntries carry evidence locations and symbol anchors; code drift queues a re-check
5AI proposes, humans decideProbation before verification; rule documents and vocabularies only change on human acceptance
6Respect the context budgetPer-layer token budgets; byte-stable resident block for KV cache; silence when relevance is uncertain
7Self-improvement you can audit and undoRetrieval parameters auto-tune and auto-roll-back; knowledge content is never rewritten automatically

How it compares

AccreMindAGENTS.md / CLAUDE.mdWiki / ADRChat-memory assistants
What is storedOnly the delta code cannot give backWhatever gets pasted inDecisions, rarely the trapsPast conversation turns
Where it livesMarkdown cards in the repo + local indexOne flat file, hand-editedProse, human search onlyUsually cloud embeddings
When it reaches the modelThree budgeted momentsEvery turn, whole fileWhen a human reads itSimilarity match
FreshnessSymbol anchors, watch paths, re-check queueNoneManualNone
VerificationProbation → verified on real useNoneReview, if anyNone
Leaves your machineNoNoDependsUsually yes

Non-goals

  • Not a general-purpose chat memory or a personal note app.
  • Not a code knowledge graph or an index of your repository's structure.
  • Not a replacement for ADRs — it complements them by keeping what ADRs usually omit.
  • It never writes code, never runs commands, and never overrides the host's rules.

Requirements

  • Node.js ≥ 24 — node:sqlite with FTS5 trigram tokenisation.
  • DeepSeek Harness ≥ 0.2.2-rc.5 — only if you use the plugin; declared as engines.dsh, and DSH refuses to install or start the bundle below that range. The CLI and the standalone workbench need nothing but Node.js.

Development

pnpm build          # build core, plugin and the workbench artifact
pnpm build:webui    # rebuild only the workbench and write it back inline
pnpm test           # node:test (builds first)
pnpm verify         # build + tests + artifact fingerprint — run before every PR
pnpm typecheck      # kernel + workbench type checks
pnpm pack:check     # verify the published package shape (incl. host compatibility)
pnpm market:index   # regenerate market/index.json

CI runs pnpm verify, pnpm pack:check and the market index check on every push. See CONTRIBUTING.md for the full workflow.

Documentation

Deep-dive documents are currently written in Chinese; English translations are tracked in docs/README.md.

Contributing

Issues and pull requests are welcome. Read CONTRIBUTING.md first — it covers the local setup, the checks a PR must pass, and the commit conventions. This project follows the Contributor Covenant.

License

MIT © 2026 AccreMind contributors

Ähnliche Plugins