Local-first memory and coordination for AI coding agents.
Version: 6.3.0
Agent Shadow Brain gives tools like Codex, Claude Code, Cursor, Cline, OpenCode, Aider, and related MCP clients a shared local memory layer. It stores compact, source-backed lessons about projects, recalls them later, generates fresh-session briefings, audits memory quality, and exports JSONL training/eval packs.
It does not change model weights by itself. It helps agents work better by giving them relevant, current, source-linked context before and during complex work.
Recall confidence scoring, plus the 6.2.0 dashboard upgrade for clarity and visibility.
-
Recall confidence. Every recalled memory now carries a blended confidence score (high/medium/low) so an agent can weight what it trusts. The score combines keyword relevance, recency (30-day half-life), author-assigned importance, cross-agent corroboration, and prior usage. Exposed via
GlobalBrain.recallScored(), theglobal_recall_scoredMCP tool, and a color-coded badge in the dashboard. -
Quieter automation. Fixed a GitHub Actions bot that opened duplicate milestone/momentum issues; notifiers are now idempotent and verify against GitHub before posting.
-
Simple by default, Advanced on demand. The dashboard opens with eight plain-English tabs (Home, Brain Map, Memories, Ask the Brain, Activity, Connected Tools, Brain Health, Settings). Flip to Advanced to reveal every feature β nothing was removed, just tidied.
-
Brain Map. An interactive graph of everything the brain remembers β memories, projects, tools, and tags β sized by importance (PageRank) and linked by shared context. Zoom, pan, click a node for details, and watch it grow live as new memories arrive.
-
Realtime activity. Memory writes, reflections, and tool events stream live over WebSocket instead of polling, with a live pulse on Home.
-
Live Network. A refreshed animation of your tools talking to the brain, with flowing signal pulses.
-
Two-way knowledge seeding. Quick-Save captures knowledge in one click; "Hand to Agent" generates a ready briefing to pass context back to any tool.
-
Plain-language everywhere. Cryptic feature names rewritten (e.g. Calibration β Accuracy, Pre-Mortem β Risk Check, Tokens β Cost & Usage), each with a hover description.
- Stores cross-project and cross-agent memories in a local JSON brain at
~/.shadow-brain/global.json. - Recalls memories by project, agent, category, and keywords.
- Generates source-backed resume packs for fresh sessions, account switches, context compaction, and handoffs.
- Audits memory quality: source coverage, stale entries, duplicates, low-quality notes, recall health.
- Creates verified memory seed drafts from dashboard/API, then requires user, agent, or dual approval before writing to durable memory.
- Exports JSONL rows for evals, distillation, or local fine-tuning pipelines.
- Provides CLI, dashboard API, and MCP tool surfaces.
- Includes safety helpers such as hook audit, detach, and action firewall checks.
- Works without telemetry and without an API key for local memory features.
- It does not secretly train GPT, Claude, Gemini, or any remote model.
- It does not guarantee perfect recall.
- It does not replace project docs, tests, source control, or human review.
- It does not make every listed agent automatically available. Agent support depends on local installation and hook/config compatibility.
- It does not publish or sync data unless you explicitly use export, sync, or other sharing commands.
npm install -g @theihtisham/agent-shadow-brainCLI binaries:
shadow-brain --help
asb --helpYou can also run without global install:
npx @theihtisham/agent-shadow-brain@latest --helpStart by auditing before attaching hooks:
shadow-brain audit-hooks .
shadow-brain live-brain status .Only attach after you review what will be changed:
shadow-brain attach-all .Detach later if needed:
shadow-brain detach-all .The 6.0.3 release focuses on practical long-memory improvement for agents.
shadow-brain live-brain status .Shows:
- memory count
- average memory quality
- source coverage
- stale memories
- duplicate clusters
- recall eval score
- recommended cleanup actions
JSON output:
shadow-brain live-brain status . --jsonGenerate a markdown briefing for a fresh agent session:
shadow-brain live-brain brief . -o SHADOW_BRAIN_AGENT_BRIEF.mdThe briefing includes:
- rules for agents
- top source-backed memories
- memory warnings
- recall health
- commands agents should run next
Check whether the brain can retrieve useful memories for common agent tasks:
shadow-brain live-brain eval .Custom eval queries use pipe separators:
shadow-brain live-brain eval . --queries "current blocker|do not repeat|verified command"List concrete cleanup and learning actions:
shadow-brain live-brain hygiene .This highlights missing sources, stale memories, duplicates, weak recall, and missing project-scoped memories.
Export source-backed memories as JSONL:
shadow-brain live-brain train-pack . --out shadow-brain-training.jsonlThis is useful for:
- retrieval evals
- local distillation experiments
- supervised fine-tuning datasets
- memory regression tests
The export is only data preparation. You choose the downstream training/eval tool.
Recall from the global brain:
shadow-brain global recall --query "current blocker next step" --json --limit 8Show global stats:
shadow-brain global statsCreate a source-backed resume seed:
shadow-brain resume-seed . -o SHADOW_BRAIN_RESUME_SEED.mdShow what a project has learned:
shadow-brain timeline . --limit 30Create a cross-agent handoff packet:
shadow-brain handoff codex claude-code . --task "continue release verification"Record a durable memory from a script:
node tools/record-global-memory.mjs ^
--project-dir "." ^
--project-name "my-project" ^
--agent codex ^
--category "project.lesson" ^
--importance 0.8 ^
--tags "memory,release" ^
--sources "README.md,CHANGELOG.md" ^
--content "Keep release notes source-backed and verify npm metadata before publish."Start the local dashboard:
shadow-brain dash . --no-open --port 7341For a fast UI/API-only launch on a large repo:
shadow-brain dash . --no-open --no-analysis --host 127.0.0.1 --port 7341Open:
http://127.0.0.1:7341
The v6 dashboard includes a Live Brain tab for memory health, source coverage, recall evals, hygiene actions, top memories, and the generated agent briefing.
It also includes:
- Memory Browser intelligence cards for total memories, source coverage, fresh learning, seed queue, top categories, agent coverage, and top tags.
- Memory Seeder for controlled research-to-memory workflows. Drafts stay out of the global brain until approval is complete.
- Token Economy accuracy split: current runtime agent is shown separately from historical model spend, so old Claude/Cursor spend records do not imply the dashboard is running that agent.
The dashboard now streams brain activity live over its WebSocket instead of polling. Memory writes, dreams, seed drafts/commits, collisions, sub-agent spawns, and consolidation cycles appear the instant they happen.
- Live Pulse card on the Overview with a streaming mini-feed and an events/min rate.
- Activity Log tab with filter chips, a pulsing LIVE badge, pause/resume, clear, search, and an events/min sparkline.
- Connection indicator in the header β green when the realtime socket is live, amber while reconnecting.
- Cross-process aware: a memory written by an agent in a different terminal is picked up by watching
~/.shadow-brain/global.json, so the feed reflects the whole machine, not just this process.
Polling remains as a 15-second reconciliation fallback; live events arrive in well under a second.
A new Intelligence tab turns the brain into an interactive graph. Every memory, project, agent, and tag is a node in a force-directed Memory Constellation, sized by importance (PageRank blended with each memory's own score) and linked by project, author, tags, and shared-tag relatedness.
- Interactive: scroll to zoom, drag to pan, click a node to focus its neighborhood and open a detail drawer; hover for a tooltip.
- Filters + search by node type (memory / project / agent / tag).
- Live: new memories pulse into the graph over the realtime stream.
- Analytics strip: source-coverage gauge, agent-contribution and category charts, tag cloud, and a recent-memory feed.
- Works instantly on your existing
~/.shadow-brain/global.jsonβ no project analysis or setup step.
Several previously sparse tabs were also rebuilt with real visualizations: Pre-Mortem (risk matrix + failure cards), Attention (weighted heat bars), Calibration (Brier/trust chart), Reputation (trust rings), Causal Chains (node-link DAG), and Branch Brains (stat cards).
Constellation API:
GET /api/v6/memory-graph
Memory seeding API:
GET /api/v6/seed-drafts
POST /api/v6/seed-draft
POST /api/v6/seed-approve
POST /api/v6/seed-reject
POST /api/v6/seed-commit
GET /api/v6/memory-intelligence
Useful API endpoints:
GET/POST /api/v6/live-brain
GET/POST /api/v6/resume-pack
GET/POST /api/v6/ww2br-recall
GET/POST /api/v6/memory-browser
Example:
curl "http://127.0.0.1:7341/api/v6/live-brain?projectDir=C:/path/to/project"The MCP server exposes memory and agent-control tools for compatible clients.
New in 6.3.0:
global_recall_scoredβ recall with a per-memory confidence score (recency, author importance, cross-agent corroboration, prior usage, keyword relevance). Results are ranked by confidence so agents can weight memories instead of trusting every hit equally. SupportsminConfidenceto drop low-trust hits.
New in 6.0.3:
live_brain_statuslive_brain_brieflive_brain_train_pack
Existing useful tools include:
global_recallglobal_recall_scoredglobal_statsglobal_timelinesubconscious_injectagent_handofffirewall_check
Start MCP from the dashboard API or existing CLI/server integration, depending on your setup.
Recommended workflow for complex work:
- Run
shadow-brain live-brain status <project>. - Generate or read a live briefing.
- Verify current project docs and source files.
- Work normally.
- Record only durable, source-backed lessons after proof.
- Run recall evals when memory quality starts to drift.
Good memories are short, action-oriented, and source-backed:
[lesson:release-readme-v1] Before publishing, verify package.json version, package-lock root version, README install commands, build output, and npm pack contents.
Sources: package.json; package-lock.json; README.md
Tags: release,npm,verification
Bad memories are vague:
Make project better.
Default global brain:
~/.shadow-brain/global.json
Project-local generated files may include:
SHADOW_BRAIN_AGENT_BRIEF.md
SHADOW_BRAIN_RESUME_SEED.md
shadow-brain-training.jsonl
Do not store secrets, API keys, passwords, private keys, or raw credentials in memory content, metadata, tags, prompts, reports, or exported training data.
npm install
npm run build
npm testFocused tests:
npx vitest run tests/brain/live-brain.test.ts tests/brain/context-continuity.test.tsOn Windows PowerShell, if execution policy blocks npm.ps1, use:
npm.cmd run build
npx.cmd vitest run tests\brain\live-brain.test.tsFor a 6.0.3 release:
npm run build
npm test
npm pack --dry-runThen publish only after verifying the package contents:
npm publish --access publicGitHub release should include:
- this README
CHANGELOG.mddocs/launch/RELEASE_NOTES_v6.0.3.mddocs/launch/RELEASE_CHECKLIST_v6.0.3.md- build/test output
- npm package dry-run output
MIT




