@nano-step/nano-brain 2026.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/command/nano-brain-init.md +13 -0
- package/.opencode/command/nano-brain-reindex.md +11 -0
- package/.opencode/command/nano-brain-status.md +12 -0
- package/AGENTS.md +41 -0
- package/AGENTS_SNIPPET.md +44 -0
- package/CHANGELOG.md +186 -0
- package/README.md +298 -0
- package/SKILL.md +109 -0
- package/bin/cli.js +29 -0
- package/commands/nano-brain-init.md +36 -0
- package/commands/nano-brain-reindex.md +31 -0
- package/commands/nano-brain-status.md +32 -0
- package/index.html +929 -0
- package/nano-brain +4 -0
- package/opencode-mcp.json +9 -0
- package/openspec/changes/archive/2026-02-16-fix-mcp-server-bugs/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-02-16-fix-mcp-server-bugs/design.md +68 -0
- package/openspec/changes/archive/2026-02-16-fix-mcp-server-bugs/proposal.md +27 -0
- package/openspec/changes/archive/2026-02-16-fix-mcp-server-bugs/specs/mcp-integration-testing/spec.md +50 -0
- package/openspec/changes/archive/2026-02-16-fix-mcp-server-bugs/specs/mcp-server/spec.md +40 -0
- package/openspec/changes/archive/2026-02-16-fix-mcp-server-bugs/specs/search-pipeline/spec.md +29 -0
- package/openspec/changes/archive/2026-02-16-fix-mcp-server-bugs/tasks.md +37 -0
- package/openspec/changes/archive/2026-02-23-workspace-scoped-memory-and-storage-limits/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-02-23-workspace-scoped-memory-and-storage-limits/design.md +111 -0
- package/openspec/changes/archive/2026-02-23-workspace-scoped-memory-and-storage-limits/proposal.md +30 -0
- package/openspec/changes/archive/2026-02-23-workspace-scoped-memory-and-storage-limits/specs/mcp-server/spec.md +33 -0
- package/openspec/changes/archive/2026-02-23-workspace-scoped-memory-and-storage-limits/specs/storage-limits/spec.md +90 -0
- package/openspec/changes/archive/2026-02-23-workspace-scoped-memory-and-storage-limits/specs/workspace-scoping/spec.md +66 -0
- package/openspec/changes/archive/2026-02-23-workspace-scoped-memory-and-storage-limits/tasks.md +199 -0
- package/openspec/changes/codebase-indexing/.openspec.yaml +2 -0
- package/openspec/changes/codebase-indexing/design.md +169 -0
- package/openspec/changes/codebase-indexing/proposal.md +30 -0
- package/openspec/changes/codebase-indexing/specs/codebase-collection/spec.md +187 -0
- package/openspec/changes/codebase-indexing/specs/mcp-server/spec.md +36 -0
- package/openspec/changes/codebase-indexing/tasks.md +56 -0
- package/openspec/changes/fix-session-harvest-workspace-scoping/.openspec.yaml +2 -0
- package/openspec/changes/fix-session-harvest-workspace-scoping/design.md +84 -0
- package/openspec/changes/fix-session-harvest-workspace-scoping/proposal.md +26 -0
- package/openspec/changes/fix-session-harvest-workspace-scoping/specs/workspace-scoping/spec.md +65 -0
- package/openspec/changes/fix-session-harvest-workspace-scoping/tasks.md +33 -0
- package/openspec/changes/performance-and-search-quality/.openspec.yaml +2 -0
- package/openspec/changes/performance-and-search-quality/proposal.md +37 -0
- package/openspec/specs/mcp-integration-testing/spec.md +50 -0
- package/openspec/specs/mcp-server/spec.md +75 -0
- package/openspec/specs/search-pipeline/spec.md +29 -0
- package/openspec/specs/storage-limits/spec.md +94 -0
- package/openspec/specs/workspace-scoping/spec.md +70 -0
- package/package.json +37 -0
- package/site/build.js +66 -0
- package/site/partials/_api.html +83 -0
- package/site/partials/_compare.html +100 -0
- package/site/partials/_config.html +23 -0
- package/site/partials/_features.html +43 -0
- package/site/partials/_footer.html +6 -0
- package/site/partials/_hero.html +9 -0
- package/site/partials/_how-it-works.html +26 -0
- package/site/partials/_models.html +18 -0
- package/site/partials/_quick-start.html +15 -0
- package/site/partials/_stats.html +1 -0
- package/site/partials/_tech-stack.html +13 -0
- package/site/script.js +12 -0
- package/site/shell.html +44 -0
- package/site/styles.css +548 -0
- package/src/chunker.ts +427 -0
- package/src/codebase.ts +425 -0
- package/src/collections.ts +217 -0
- package/src/embeddings.ts +325 -0
- package/src/expansion.ts +79 -0
- package/src/harvester.ts +306 -0
- package/src/index.ts +778 -0
- package/src/reranker.ts +103 -0
- package/src/search.ts +294 -0
- package/src/server.ts +876 -0
- package/src/storage.ts +221 -0
- package/src/store.ts +653 -0
- package/src/types.ts +215 -0
- package/src/watcher.ts +389 -0
- package/test/chunker.test.ts +479 -0
- package/test/cli.test.ts +309 -0
- package/test/codebase-chunker.test.ts +446 -0
- package/test/codebase.test.ts +678 -0
- package/test/collections.test.ts +571 -0
- package/test/harvester.test.ts +636 -0
- package/test/integration.test.ts +219 -0
- package/test/llm.test.ts +322 -0
- package/test/search.test.ts +572 -0
- package/test/server.test.ts +541 -0
- package/test/storage.test.ts +302 -0
- package/test/store.test.ts +530 -0
- package/test/watcher.test.ts +717 -0
- package/test/workspace.test.ts +239 -0
- package/tsconfig.json +19 -0
- package/vitest.config.ts +16 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Initialize nano-brain persistent memory for the current workspace.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run these MCP tools in order:
|
|
6
|
+
|
|
7
|
+
1. `memory_status` — check if already initialized (codebase docs > 0 means skip to step 4)
|
|
8
|
+
2. `memory_index_codebase` — index source files from workspace root
|
|
9
|
+
3. `memory_update` — reindex sessions and curated notes
|
|
10
|
+
4. `memory_status` — show final state
|
|
11
|
+
|
|
12
|
+
Report: document counts, pending embeddings, and whether AGENTS.md snippet exists.
|
|
13
|
+
If pending embeddings > 0, note they process in background.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rescan codebase and refresh all nano-brain indexes after branch switch or code changes.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run these MCP tools:
|
|
6
|
+
|
|
7
|
+
1. `memory_index_codebase` — rescan source files (detects new, changed, and deleted files via content hash)
|
|
8
|
+
2. `memory_update` — refresh session and note indexes
|
|
9
|
+
3. `memory_status` — show updated counts and pending embeddings
|
|
10
|
+
|
|
11
|
+
Use after: branch switch, pull, major code changes, or when search results seem stale.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show nano-brain memory health and statistics.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run `memory_status` and present a clean summary.
|
|
6
|
+
|
|
7
|
+
Highlight: total docs, pending embeddings, collection breakdown, embedding server connectivity.
|
|
8
|
+
|
|
9
|
+
Suggest actions if:
|
|
10
|
+
- 0 codebase docs → "Run `/nano-brain-init`"
|
|
11
|
+
- Pending embeddings > 0 → "Processing in background"
|
|
12
|
+
- Embedding server unreachable → "Check Ollama: `ollama serve`"
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!-- OPENCODE-MEMORY:START -->
|
|
2
|
+
<!-- Managed block - do not edit manually. Updated by: npx nano-brain init -->
|
|
3
|
+
|
|
4
|
+
## Memory System (nano-brain)
|
|
5
|
+
|
|
6
|
+
This project uses **nano-brain** for persistent context across sessions.
|
|
7
|
+
|
|
8
|
+
### Quick Reference
|
|
9
|
+
|
|
10
|
+
| I want to... | Command |
|
|
11
|
+
|--------------|---------|
|
|
12
|
+
| Recall past work on a topic | `memory_query("topic")` |
|
|
13
|
+
| Find exact error/function name | `memory_search("exact term")` |
|
|
14
|
+
| Explore a concept semantically | `memory_vsearch("concept")` |
|
|
15
|
+
| Save a decision for future sessions | `memory_write("decision context")` |
|
|
16
|
+
| Check index health | `memory_status` |
|
|
17
|
+
|
|
18
|
+
### Session Workflow
|
|
19
|
+
|
|
20
|
+
**Start of session:** Check memory for relevant past context before exploring the codebase.
|
|
21
|
+
```
|
|
22
|
+
memory_query("what have we done regarding {current task topic}")
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**End of session:** Save key decisions, patterns discovered, and debugging insights.
|
|
26
|
+
```
|
|
27
|
+
memory_write("## Summary\n- Decision: ...\n- Why: ...\n- Files: ...")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### When to Search Memory vs Codebase
|
|
31
|
+
|
|
32
|
+
- **"Have we done this before?"** → `memory_query` (searches past sessions)
|
|
33
|
+
- **"Where is this in the code?"** → grep / ast-grep (searches current files)
|
|
34
|
+
- **"How does this concept work here?"** → Both (memory for past context + grep for current code)
|
|
35
|
+
|
|
36
|
+
<!-- OPENCODE-MEMORY:END -->
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!-- OPENCODE-MEMORY:START -->
|
|
2
|
+
<!-- Managed block - do not edit manually. Updated by: npx nano-brain init -->
|
|
3
|
+
|
|
4
|
+
## Memory System (nano-brain)
|
|
5
|
+
|
|
6
|
+
This project uses **nano-brain** for persistent context across sessions.
|
|
7
|
+
|
|
8
|
+
### Quick Reference
|
|
9
|
+
|
|
10
|
+
All commands use the CLI via Bash tool:
|
|
11
|
+
|
|
12
|
+
| I want to... | Command |
|
|
13
|
+
|--------------|---------|
|
|
14
|
+
| Recall past work on a topic | `npx nano-brain query "topic"` |
|
|
15
|
+
| Find exact error/function name | `npx nano-brain search "exact term"` |
|
|
16
|
+
| Explore a concept semantically | `npx nano-brain vsearch "concept"` |
|
|
17
|
+
| Save a decision for future sessions | Create file in `~/.nano-brain/memory/`, then `npx nano-brain update` |
|
|
18
|
+
| Check index health | `npx nano-brain status` |
|
|
19
|
+
|
|
20
|
+
### Session Workflow
|
|
21
|
+
|
|
22
|
+
**Start of session:** Check memory for relevant past context before exploring the codebase.
|
|
23
|
+
```
|
|
24
|
+
npx nano-brain query "what have we done regarding {current task topic}"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**End of session:** Save key decisions, patterns discovered, and debugging insights.
|
|
28
|
+
```bash
|
|
29
|
+
cat > ~/.nano-brain/memory/$(date +%Y-%m-%d)-summary.md << 'EOF'
|
|
30
|
+
## Summary
|
|
31
|
+
- Decision: ...
|
|
32
|
+
- Why: ...
|
|
33
|
+
- Files: ...
|
|
34
|
+
EOF
|
|
35
|
+
npx nano-brain update
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### When to Search Memory vs Codebase
|
|
39
|
+
|
|
40
|
+
- **"Have we done this before?"** → `npx nano-brain query` (searches past sessions)
|
|
41
|
+
- **"Where is this in the code?"** → grep / ast-grep (searches current files)
|
|
42
|
+
- **"How does this concept work here?"** → Both (memory for past context + grep for current code)
|
|
43
|
+
|
|
44
|
+
<!-- OPENCODE-MEMORY:END -->
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2026.1.14] - 2026-03-03
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Keyed memory tools**: 3 new MCP tools for updatable, topic-keyed memories that replace previous values on the same key — solving the long-standing problem of `memory_write` being append-only with no way to supersede stale knowledge.
|
|
8
|
+
- `memory_set(key, content)`: Write or update a keyed memory. Writes to `~/.nano-brain/memory/keys/{slug}.md` using `writeFileSync` (overwrite, not append). Leverages existing `insertDocument` upsert logic — FTS triggers rebuild search index on hash change, embedding pipeline handles orphaned vectors automatically.
|
|
9
|
+
- `memory_delete(key)`: Delete a keyed memory entry from disk and deactivate it in the search index. Returns informational message (not error) if key doesn't exist.
|
|
10
|
+
- `memory_keys()`: List all keyed memory entries with names and last-modified timestamps. Handles missing/empty directory gracefully.
|
|
11
|
+
- **`memory_write` unchanged**: Existing chronological daily logging continues to work as before. Keyed memories are a complementary mechanism, not a replacement.
|
|
12
|
+
## [2026.1.13] - 2026-02-28
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **Workspace-scoped session indexing**: Session documents were indexed with the current workspace's `projectHash` instead of extracting it from the session file's directory path (`sessions/{hash}/*.md`). This caused all sessions from every workspace to be tagged as belonging to the current workspace, defeating workspace-scoped search. Added `extractProjectHashFromPath()` utility and fixed all 4 indexing code paths (watcher, init, update, memory_update tool).
|
|
17
|
+
|
|
18
|
+
## [2026.1.12] - 2026-02-24
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **Session harvesting on Linux/Docker**: Harvester hardcoded `~/.opencode/storage` (macOS path). On Linux, OpenCode follows XDG and stores sessions at `~/.local/share/opencode/storage`. Added `resolveOpenCodeStorageDir()` that checks XDG path first and falls back to `~/.opencode/storage`, so harvesting now works on both platforms.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- **Expanded built-in codebase exclude patterns**: `BUILTIN_EXCLUDE_PATTERNS` grew from 12 to 55 patterns covering all major ecosystems — prevents accidental indexing of large generated directories that cause OOM and DB bloat:
|
|
27
|
+
- **JS/TS**: `.pnpm-store`, `.yarn`, `bower_components`, `out`, `.svelte-kit`, `.astro`, `.remix`, `.turbo`, `.vercel`, `.cache`, `.parcel-cache`, `.vite`, `storybook-static`, `*.min.css`, `*.tsbuildinfo`, `.eslintcache`
|
|
28
|
+
- **Python**: `.venv`, `venv`, `env`, `.conda`, `*.egg-info`, `.mypy_cache`, `.ruff_cache`, `.pytest_cache`, `htmlcov`, `.tox`
|
|
29
|
+
- **Java/JVM**: `.gradle`, `.mvn`, `*.class`, `*.jar`, `*.war`
|
|
30
|
+
- **Ruby**: `gems`, `.bundle`
|
|
31
|
+
- **PHP**: `storage/framework`, `bootstrap/cache`
|
|
32
|
+
- **Mobile**: `Pods`, `*.xcworkspace`, `DerivedData`, `generated`
|
|
33
|
+
- **DevOps**: `.terraform`, `terraform.tfstate*`
|
|
34
|
+
- **Logs/tmp**: `logs`, `log`, `tmp`, `temp`, `*.log`
|
|
35
|
+
- **Test coverage**: `coverage`, `.nyc_output`, `lcov-report`
|
|
36
|
+
- **Version control**: `.svn`, `.hg`
|
|
37
|
+
|
|
38
|
+
## [2026.1.11] - 2026-02-24
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- **MCP singleton guard**: Multiple nano-brain MCP server instances would pile up (OpenCode respawns MCP servers on reconnect), causing SQLite lock contention and Ollama timeout errors. New PID-based singleton guard ensures only one instance runs — new instances kill the previous one, and old instances detect they've been superseded and exit gracefully.
|
|
43
|
+
- **Ollama auto-reconnect**: If Ollama is unreachable at MCP server startup, the server falls back to local GGUF embeddings and now retries Ollama every 60 seconds. When Ollama becomes available, the embedding provider is hot-swapped without restart.
|
|
44
|
+
|
|
45
|
+
## [2026.1.10] - 2026-02-24
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- **Ollama timeout issues in Docker**: Increased health check timeout from 3s to 10s to handle Docker networking latency. Added 30s timeout to `embed()` and 60s timeout to `embedBatch()` — previously these had no timeout and could hang indefinitely.
|
|
50
|
+
|
|
51
|
+
## [2026.1.9] - 2026-02-24
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- **Consolidated all data paths under `~/.nano-brain/`**: DB, models, config, sessions, and memory now all live under `~/.nano-brain/` instead of scattered across `~/.cache/nano-brain/` and `~/.config/nano-brain/`. This fixes data loss in Docker containers where `~/.cache` was an ephemeral anonymous volume.
|
|
56
|
+
- **New directory layout**:
|
|
57
|
+
```
|
|
58
|
+
~/.nano-brain/
|
|
59
|
+
├── config.yml # Configuration (was ~/.config/nano-brain/config.yml)
|
|
60
|
+
├── data/ # SQLite databases (was ~/.cache/nano-brain/)
|
|
61
|
+
├── models/ # Embedding models (was ~/.cache/nano-brain/models/)
|
|
62
|
+
├── memory/ # Curated notes
|
|
63
|
+
└── sessions/ # Harvested sessions
|
|
64
|
+
```
|
|
65
|
+
- **Cleanup command**: After upgrading, remove old paths with `rm -rf ~/.cache/nano-brain ~/.config/nano-brain`
|
|
66
|
+
|
|
67
|
+
## [2026.1.8] - 2026-02-24
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
|
|
71
|
+
- **`init` no longer hangs on large collections**: Init now only indexes core collections (memory, sessions) and defers other collections to the MCP watcher. Previously, scanning a large project collection (e.g., thousands of source files) would block init indefinitely.
|
|
72
|
+
- **`init` caps embedding at 50 documents**: Embeds first 50 docs for quick startup, reports remaining count, and defers the rest to the MCP server's background embedding interval. Previously tried to embed all documents synchronously.
|
|
73
|
+
- **Per-collection progress logging**: Init now shows per-collection file counts and new/skipped stats.
|
|
74
|
+
|
|
75
|
+
## [2026.1.7] - 2026-02-24
|
|
76
|
+
|
|
77
|
+
### Fixed
|
|
78
|
+
|
|
79
|
+
- **CLI per-workspace DB resolution**: CLI commands (`status`, `search`, `init`, etc.) now resolve the same per-workspace database as the MCP server (`{dirName}-{hash}.sqlite`). Previously CLI always read `default.sqlite`, showing stale data from the old global DB.
|
|
80
|
+
- **"Chunks" → "Embedded" label**: Status output renamed misleading "Chunks" count (which counted `content_vectors` rows) to "Embedded" — accurately reflecting what it measures.
|
|
81
|
+
|
|
82
|
+
## [2026.1.6] - 2026-02-24
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
|
|
86
|
+
- **Per-workspace codebase config**: Global config now supports a `workspaces` map, allowing different codebase settings (enabled, extensions, exclude) per project. `init --root=/path` creates a workspace entry with codebase enabled by default.
|
|
87
|
+
- **`getWorkspaceConfig()` resolver**: Resolution order: workspace map → top-level `codebase` fallback → default (enabled). Existing configs with top-level `codebase` continue working without migration.
|
|
88
|
+
- **`setWorkspaceConfig()` helper**: Programmatic API for adding/updating workspace entries in config.
|
|
89
|
+
|
|
90
|
+
### Changed
|
|
91
|
+
|
|
92
|
+
- **`init` writes workspace entries**: Instead of a single global `codebase` field, `handleInit()` now adds per-workspace entries to the `workspaces` map. Multiple `init --root=` calls for different projects coexist.
|
|
93
|
+
- **Server resolves workspace config**: `startServer()` uses `getWorkspaceConfig()` to resolve codebase config for the current workspace instead of reading the top-level `codebase` field.
|
|
94
|
+
|
|
95
|
+
## [2026.1.4] - 2026-02-23
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
|
|
99
|
+
- **Slash commands**: 3 OpenCode slash commands shipped in `commands/` dir — `/nano-brain-init` (first-time setup), `/nano-brain-status` (health check), `/nano-brain-reindex` (rescan after branch switch). Installed to both global and project `.opencode/command/` during `init`.
|
|
100
|
+
- **Slash command auto-install in `init`**: `handleInit()` copies slash command `.md` files from the package's `commands/` directory to global (`~/.config/opencode/.opencode/command/`) and project-level (`.opencode/command/`) directories.
|
|
101
|
+
|
|
102
|
+
### Changed
|
|
103
|
+
|
|
104
|
+
- **SKILL.md rewritten**: Cut from 153 lines to 45. Concise tool selection table, slash command reference, collection filtering, complementary tools note. No redundant parameter docs.
|
|
105
|
+
|
|
106
|
+
## [2026.1.3] - 2026-02-23
|
|
107
|
+
|
|
108
|
+
### Added
|
|
109
|
+
|
|
110
|
+
- **`init` command**: Full self-initializing setup via `npx nano-brain init --root=/path`. Creates config with auto-detected Ollama URL, indexes codebase, harvests sessions, indexes collections, generates embeddings, and injects AGENTS.md snippet. One command to go from zero to fully operational.
|
|
111
|
+
- **Ollama embedding support**: Configurable embedding provider in `~/.config/nano-brain/config.yml`. Supports Ollama API with auto-detected URL (localhost:11434 natively, host.docker.internal:11434 in Docker). User-overridable model and URL.
|
|
112
|
+
- **Embedding server health in `status`**: `npx nano-brain status` and MCP `memory_status` tool now show embedding server connectivity, model availability, and available models.
|
|
113
|
+
- **`checkOllamaHealth()` utility**: Probes Ollama API for connectivity and model availability, used by both `init` and `status`.
|
|
114
|
+
|
|
115
|
+
### Fixed
|
|
116
|
+
|
|
117
|
+
- **ESM `require()` bug in Docker detection**: `detectOllamaUrl()` used `require('fs')` inside an ESM module, which silently failed and always returned localhost even inside Docker. Fixed by using ESM `import { accessSync, readFileSync } from 'fs'`.
|
|
118
|
+
- **sqlite-vec `INSERT OR REPLACE` bug**: sqlite-vec virtual tables don't support `INSERT OR REPLACE` — they treat it as plain `INSERT`, causing `UNIQUE constraint failed` errors on re-embedding. Fixed with DELETE-then-INSERT pattern.
|
|
119
|
+
- **`init` never generated embeddings**: `handleInit()` indexed documents but never created an embedding provider or called `embedPendingCodebase()`. Documents stayed permanently "pending". Fixed by adding embedding step after indexing.
|
|
120
|
+
|
|
121
|
+
## [2026.1.0] - 2026-02-23
|
|
122
|
+
|
|
123
|
+
### Added
|
|
124
|
+
|
|
125
|
+
- **AI agent routing instructions (SKILL.md)**: Enhanced SKILL.md with trigger phrases, when-to-use rules, tool selection guide, collection filtering, and integration patterns for orchestrator and subagent workflows. Agents now auto-route to memory for recall, past decisions, cross-session context, and repeated patterns.
|
|
126
|
+
- **AGENTS_SNIPPET.md**: Optional managed block for project-level AGENTS.md installation. Provides quick reference table, session workflow (start/end), and memory vs codebase search guidance. Designed for `npx nano-brain init` injection.
|
|
127
|
+
- **`memory_index_codebase` documented**: Added to SKILL.md, README, and site API reference.
|
|
128
|
+
- **`workspace` parameter documented**: Added to search tool docs showing workspace scoping.
|
|
129
|
+
|
|
130
|
+
## [0.3.0] - 2026-02-23
|
|
131
|
+
|
|
132
|
+
### Added
|
|
133
|
+
|
|
134
|
+
- **Codebase indexing**: Opt-in source code indexing via `codebase: { enabled: true }` in config.yml. Indexes source files from the current workspace into the search pipeline for semantic code search.
|
|
135
|
+
- **Source code chunker**: Line-based chunking with structural boundary detection (function/class/type definitions, import blocks). Same 900-token target and 15% overlap as markdown chunker. Metadata headers (`File:`, `Language:`, `Lines:`) prepended to each chunk.
|
|
136
|
+
- **Project type auto-detection**: Detects project type from marker files (package.json, pyproject.toml, go.mod, Cargo.toml, etc.) and selects appropriate file extensions to index. Falls back to all common extensions.
|
|
137
|
+
- **Exclude pattern merging**: Combines exclude patterns from three sources: config `codebase.exclude`, `.gitignore`, and built-in defaults (node_modules, .git, dist, build, etc.).
|
|
138
|
+
- **Codebase storage budget**: Independent `codebase.maxSize` (default 2GB) limits codebase storage separately from session storage. Indexing stops when budget is exceeded. Storage usage reported in `memory_status`.
|
|
139
|
+
- **Max file size guard**: Skips files larger than `codebase.maxFileSize` (default 5MB) to avoid indexing generated/minified files.
|
|
140
|
+
- **`memory_index_codebase` MCP tool**: On-demand full codebase scan and index with summary stats (files scanned, indexed, skipped, storage usage).
|
|
141
|
+
- **Codebase stats in `memory_status`**: Shows enabled state, document count, storage used/limit, resolved extensions, and exclude pattern count.
|
|
142
|
+
- **Watcher integration**: File watcher monitors workspace directory for source code changes with exclude patterns, triggering incremental reindex.
|
|
143
|
+
- **`getCollectionStorageSize()`**: New Store method to query per-collection storage usage.
|
|
144
|
+
- **118 new tests**: `codebase.test.ts` (68 tests), `codebase-chunker.test.ts` (50 tests). Total: 428 tests.
|
|
145
|
+
|
|
146
|
+
### Changed
|
|
147
|
+
|
|
148
|
+
- Increased vitest worker heap size to 8GB to prevent OOM during test runs with large test suites.
|
|
149
|
+
|
|
150
|
+
## [0.2.0] - 2026-02-23
|
|
151
|
+
|
|
152
|
+
### Added
|
|
153
|
+
|
|
154
|
+
- **Workspace scoping**: Search results are now scoped to the current workspace by default. Each workspace is identified by a SHA-256 hash of its directory path, matching the harvester convention. Cross-workspace search is available via `workspace: "all"` parameter.
|
|
155
|
+
- **Storage limits**: Configurable `maxSize` (default 2GB), `retention` (default 90d), and `minFreeDisk` (default 100MB) in `config.yml` under a `storage` section. Human-readable values like `500MB`, `30d`, `1y` are supported.
|
|
156
|
+
- **Disk safety guard**: Checks available disk space via `fs.statfsSync()` before writes. Skips harvest/reindex/embed when disk is critically low.
|
|
157
|
+
- **Retention-based eviction**: Automatically deletes harvested session markdown older than the retention period during each harvest cycle.
|
|
158
|
+
- **Size-based eviction**: If total storage exceeds `maxSize` after retention eviction, deletes oldest sessions until under limit. Original OpenCode session JSON is never touched.
|
|
159
|
+
- **Orphan embedding cleanup**: Removes embedding vectors for deleted documents every 10 harvest cycles.
|
|
160
|
+
- **Incremental harvesting**: Tracks session file mtimes in `.harvest-state.json` to skip unchanged files, reducing harvest time from O(all) to O(changed).
|
|
161
|
+
- **`workspace` parameter** on `memory_search`, `memory_vsearch`, and `memory_query` MCP tools. Omit for current workspace, `"all"` for cross-workspace.
|
|
162
|
+
- **Per-workspace stats** in `memory_status` output showing document counts per workspace hash.
|
|
163
|
+
- **45 new tests**: `workspace.test.ts` (18), `storage.test.ts` (27), plus integration tests in `server.test.ts` and `watcher.test.ts`. Total: 310 tests.
|
|
164
|
+
|
|
165
|
+
### Changed
|
|
166
|
+
|
|
167
|
+
- Switched embedding model from EmbeddingGemma-300M (384d) to **nomic-embed-text-v1.5** (768d) for better search quality.
|
|
168
|
+
- Switched reranker from Qwen3-Reranker-0.6B to **bge-reranker-v2-m3** (8192 context) for improved reranking.
|
|
169
|
+
- Updated prompt format to nomic `search_query:`/`search_document:` convention.
|
|
170
|
+
- `documents` table now has a `project_hash` column with automatic migration and backfill on first startup.
|
|
171
|
+
|
|
172
|
+
### Fixed
|
|
173
|
+
|
|
174
|
+
- Crash when session JSON has undefined `slug` field (now falls back to session id).
|
|
175
|
+
|
|
176
|
+
## [0.1.0] - 2026-02-16
|
|
177
|
+
|
|
178
|
+
### Added
|
|
179
|
+
|
|
180
|
+
- Initial release with hybrid search (BM25 + vector + LLM reranking).
|
|
181
|
+
- 8 MCP tools: `memory_search`, `memory_vsearch`, `memory_query`, `memory_get`, `memory_multi_get`, `memory_write`, `memory_status`, `memory_update`.
|
|
182
|
+
- SQLite storage with FTS5 and sqlite-vec.
|
|
183
|
+
- Heading-aware markdown chunking.
|
|
184
|
+
- YAML-configured collections with auto-indexing via chokidar.
|
|
185
|
+
- OpenCode session harvesting (JSON to markdown).
|
|
186
|
+
- GGUF model inference via node-llama-cpp.
|
package/README.md
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# nano-brain
|
|
2
|
+
|
|
3
|
+
Persistent memory system for AI coding agents. Hybrid search (BM25 + vector + LLM reranking) across past sessions, codebase, curated notes, and daily logs.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
An MCP server that gives AI coding agents persistent memory across sessions. Indexes markdown documents, past sessions, and daily logs into a searchable SQLite database with FTS5 and vector embeddings. Provides 10 MCP tools for search, retrieval, and memory management using a sophisticated hybrid search pipeline with query expansion, RRF fusion, and neural reranking.
|
|
8
|
+
|
|
9
|
+
Inspired by [QMD](https://github.com/tobi/qmd) and [OpenClaw](https://github.com/openclaw/openclaw).
|
|
10
|
+
|
|
11
|
+
## Architecture
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
User Query
|
|
15
|
+
│
|
|
16
|
+
▼
|
|
17
|
+
┌─────────────────┐
|
|
18
|
+
│ Query Expansion │ ← qmd-query-expansion-1.7B (GGUF)
|
|
19
|
+
│ (optional) │ generates 2-3 query variants
|
|
20
|
+
└────────┬────────┘
|
|
21
|
+
│
|
|
22
|
+
┌────┴────┐
|
|
23
|
+
▼ ▼
|
|
24
|
+
┌────────┐ ┌──────────┐
|
|
25
|
+
│ BM25 │ │ Vector │
|
|
26
|
+
│ (FTS5) │ │(sqlite- │
|
|
27
|
+
│ │ │ vec) │
|
|
28
|
+
└───┬────┘ └────┬─────┘
|
|
29
|
+
│ │
|
|
30
|
+
▼ ▼
|
|
31
|
+
┌─────────────────┐
|
|
32
|
+
│ RRF Fusion │ ← k=60, original query 2× weight
|
|
33
|
+
│ │
|
|
34
|
+
└────────┬────────┘
|
|
35
|
+
│
|
|
36
|
+
▼
|
|
37
|
+
┌─────────────────┐
|
|
38
|
+
│ LLM Reranking │ ← bge-reranker-v2-m3 (GGUF)
|
|
39
|
+
│ (optional) │
|
|
40
|
+
└────────┬────────┘
|
|
41
|
+
│
|
|
42
|
+
▼
|
|
43
|
+
┌─────────────────┐
|
|
44
|
+
│ Position-Aware │ ← top 3: 75/25, 4-10: 60/40, 11+: 40/60
|
|
45
|
+
│ Blending │ (RRF weight / rerank weight)
|
|
46
|
+
└────────┬────────┘
|
|
47
|
+
│
|
|
48
|
+
▼
|
|
49
|
+
Final Results
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## How It Works
|
|
53
|
+
|
|
54
|
+
### Storage Layer
|
|
55
|
+
|
|
56
|
+
- **SQLite** via better-sqlite3 for document metadata and content
|
|
57
|
+
- **FTS5** virtual table with porter stemming for BM25 full-text search
|
|
58
|
+
- **sqlite-vec** extension for vector similarity search (cosine distance)
|
|
59
|
+
- **Content-addressed storage** using SHA-256 hash deduplication
|
|
60
|
+
|
|
61
|
+
### Chunking
|
|
62
|
+
|
|
63
|
+
Heading-aware markdown chunking that respects document structure:
|
|
64
|
+
|
|
65
|
+
- **Target size:** 900 tokens (~3600 characters)
|
|
66
|
+
- **Overlap:** 15% between chunks (~540 characters)
|
|
67
|
+
- **Respects boundaries:** Code fences, headings, paragraphs
|
|
68
|
+
- **Break point scoring:** h1=100, h2=90, h3=80, code-fence=80, hr=60, blank-line=40
|
|
69
|
+
|
|
70
|
+
### Search Pipeline (3 Tiers)
|
|
71
|
+
|
|
72
|
+
**`memory_search`** — BM25 only (fast, exact keyword matching)
|
|
73
|
+
|
|
74
|
+
**`memory_vsearch`** — Vector only (semantic similarity via embeddings)
|
|
75
|
+
|
|
76
|
+
**`memory_query`** — Full hybrid pipeline:
|
|
77
|
+
1. Query expansion generates 2-3 variants (optional)
|
|
78
|
+
2. Parallel BM25 + vector search
|
|
79
|
+
3. RRF fusion (k=60, original query weighted 2×)
|
|
80
|
+
4. LLM reranking with bge-reranker-v2-m3 (optional)
|
|
81
|
+
5. Position-aware blending:
|
|
82
|
+
- Top 3 results: 75% RRF / 25% rerank
|
|
83
|
+
- Ranks 4-10: 60% RRF / 40% rerank
|
|
84
|
+
- Ranks 11+: 40% RRF / 60% rerank
|
|
85
|
+
|
|
86
|
+
### Collections
|
|
87
|
+
|
|
88
|
+
- **YAML-configured** directories of markdown files
|
|
89
|
+
- **Auto-indexing** via chokidar file watcher
|
|
90
|
+
- **Incremental updates** using dirty-flag tracking
|
|
91
|
+
- **Session harvesting** converts OpenCode JSON sessions into searchable markdown
|
|
92
|
+
|
|
93
|
+
## MCP Tools
|
|
94
|
+
|
|
95
|
+
| Tool | Description |
|
|
96
|
+
|------|-------------|
|
|
97
|
+
| `memory_search` | BM25 keyword search (fast) |
|
|
98
|
+
| `memory_vsearch` | Semantic vector search |
|
|
99
|
+
| `memory_query` | Full hybrid search with expansion + reranking |
|
|
100
|
+
| `memory_get` | Retrieve document by path or docid (#abc123) |
|
|
101
|
+
| `memory_multi_get` | Batch retrieve by glob pattern |
|
|
102
|
+
| `memory_write` | Write to daily log (tagged with workspace) |
|
|
103
|
+
| `memory_status` | Index health, collections, model status |
|
|
104
|
+
| `memory_index_codebase` | Index codebase files in current workspace |
|
|
105
|
+
| `memory_update` | Trigger reindex of all collections |
|
|
106
|
+
|
|
107
|
+
## Installation
|
|
108
|
+
```bash
|
|
109
|
+
npm install -g nano-brain
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Quick Start
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Initialize (creates config, indexes codebase, generates embeddings)
|
|
116
|
+
npx nano-brain init --root=/path/to/your/project
|
|
117
|
+
|
|
118
|
+
# Check everything is working
|
|
119
|
+
npx nano-brain status
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Add to your AI agent's MCP config (e.g. `~/.config/opencode/opencode.json`):
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"mcp": {
|
|
126
|
+
"nano-brain": {
|
|
127
|
+
"type": "local",
|
|
128
|
+
"command": ["npx", "nano-brain", "mcp"],
|
|
129
|
+
"enabled": true
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Configuration
|
|
136
|
+
Create `~/.nano-brain/config.yml` (auto-generated by `init`):
|
|
137
|
+
```yaml
|
|
138
|
+
collections:
|
|
139
|
+
memory:
|
|
140
|
+
path: ~/.nano-brain/memory
|
|
141
|
+
pattern: "**/*.md"
|
|
142
|
+
update: auto
|
|
143
|
+
sessions:
|
|
144
|
+
path: ~/.nano-brain/sessions
|
|
145
|
+
pattern: "**/*.md"
|
|
146
|
+
update: auto
|
|
147
|
+
|
|
148
|
+
# Embedding configuration
|
|
149
|
+
embedding:
|
|
150
|
+
provider: ollama
|
|
151
|
+
url: http://localhost:11434 # Auto-detected: localhost natively, host.docker.internal in Docker
|
|
152
|
+
model: nomic-embed-text
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Collection options:**
|
|
156
|
+
- `path` — Directory to index
|
|
157
|
+
- `pattern` — Glob pattern for files
|
|
158
|
+
- `update` — `auto` (watch for changes) or `manual`
|
|
159
|
+
|
|
160
|
+
**Embedding options:**
|
|
161
|
+
- `provider` — `ollama` (default)
|
|
162
|
+
- `url` — Ollama API URL (auto-detected during `init`)
|
|
163
|
+
- `model` — Embedding model name (default: `nomic-embed-text`)
|
|
164
|
+
|
|
165
|
+
**Data directory layout (`~/.nano-brain/`):**
|
|
166
|
+
```
|
|
167
|
+
~/.nano-brain/
|
|
168
|
+
├── config.yml # Configuration
|
|
169
|
+
├── data/ # SQLite databases (per-workspace)
|
|
170
|
+
├── models/ # Embedding model cache
|
|
171
|
+
├── memory/ # Curated notes
|
|
172
|
+
└── sessions/ # Harvested sessions
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## CLI Usage
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Setup
|
|
179
|
+
nano-brain init # Full initialization (config, index, embed, AGENTS.md)
|
|
180
|
+
nano-brain init --root=/path # Initialize for specific project
|
|
181
|
+
# MCP server
|
|
182
|
+
nano-brain mcp # Start MCP server (stdio)
|
|
183
|
+
nano-brain mcp --http # Start MCP server (HTTP, port 8282)
|
|
184
|
+
# Index management
|
|
185
|
+
nano-brain status # Show index health
|
|
186
|
+
nano-brain update # Reindex all collections
|
|
187
|
+
# Search
|
|
188
|
+
nano-brain search "query" # BM25 search
|
|
189
|
+
nano-brain vsearch "query" # Vector search
|
|
190
|
+
nano-brain query "query" # Hybrid search
|
|
191
|
+
# Collections
|
|
192
|
+
nano-brain collection add <name> <path> # Add collection
|
|
193
|
+
nano-brain collection remove <name> # Remove collection
|
|
194
|
+
nano-brain collection list # List collections
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Project Structure
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
src/
|
|
201
|
+
├── index.ts # CLI entry point
|
|
202
|
+
├── server.ts # MCP server (10 tools, stdio/HTTP)
|
|
203
|
+
├── store.ts # SQLite storage (FTS5 + sqlite-vec)
|
|
204
|
+
├── search.ts # Hybrid search pipeline (RRF, reranking, blending)
|
|
205
|
+
├── chunker.ts # Heading-aware markdown chunking
|
|
206
|
+
├── collections.ts # YAML config, collection scanning
|
|
207
|
+
├── embeddings.ts # Embedding providers (Ollama API + GGUF fallback)
|
|
208
|
+
├── reranker.ts # GGUF reranker model (bge-reranker-v2-m3)
|
|
209
|
+
├── expansion.ts # GGUF query expansion (qmd-query-expansion-1.7B)
|
|
210
|
+
├── harvester.ts # OpenCode session → markdown converter
|
|
211
|
+
├── watcher.ts # File watcher (chokidar, dirty flags)
|
|
212
|
+
└── types.ts # TypeScript interfaces
|
|
213
|
+
bin/
|
|
214
|
+
└── cli.js # CLI wrapper
|
|
215
|
+
|
|
216
|
+
test/
|
|
217
|
+
└── *.test.ts # 428 tests (vitest)
|
|
218
|
+
SKILL.md # AI agent routing instructions (auto-loaded by OpenCode)
|
|
219
|
+
AGENTS_SNIPPET.md # Optional project-level AGENTS.md managed block
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Tech Stack
|
|
223
|
+
|
|
224
|
+
- **TypeScript + Node.js** (via tsx)
|
|
225
|
+
- **better-sqlite3** + **sqlite-vec** for storage
|
|
226
|
+
- **@modelcontextprotocol/sdk** for MCP server
|
|
227
|
+
- **node-llama-cpp** for GGUF model inference
|
|
228
|
+
- **chokidar** for file watching
|
|
229
|
+
- **vitest** for testing (428 tests)
|
|
230
|
+
|
|
231
|
+
## Models
|
|
232
|
+
|
|
233
|
+
All models are GGUF format, loaded on-demand:
|
|
234
|
+
|
|
235
|
+
- **Embeddings:** nomic-embed-text-v1.5 (~270MB)
|
|
236
|
+
- **Reranker:** bge-reranker-v2-m3 (~1.1GB)
|
|
237
|
+
- **Query Expansion:** qmd-query-expansion-1.7B (~1GB)
|
|
238
|
+
|
|
239
|
+
Models are downloaded automatically on first use to `~/.nano-brain/models/`.
|
|
240
|
+
|
|
241
|
+
## How nano-brain Compares
|
|
242
|
+
|
|
243
|
+
| | nano-brain | Mem0 / OpenMemory | Zep / Graphiti | OMEGA | Letta (MemGPT) | Claude Native |
|
|
244
|
+
|---|---|---|---|---|---|---|
|
|
245
|
+
| **Search** | Hybrid (BM25 + vector + LLM reranking) | Vector only | Graph traversal + vector | Semantic + BM25 | Agent-managed | Text file read |
|
|
246
|
+
| **Storage** | SQLite (single file) | PostgreSQL + Qdrant | Neo4j | SQLite | PostgreSQL / SQLite | Flat text files |
|
|
247
|
+
| **MCP Tools** | 10 | 4-9 | 9-10 | 12 | 7 | 0 |
|
|
248
|
+
| **Local-First** | Yes (zero cloud) | Requires OpenAI API key | Requires Docker + Neo4j | Yes | Yes | Yes |
|
|
249
|
+
| **AI Models** | Local GGUF (nomic-embed, bge-reranker) | Cloud API (OpenAI) | Cloud API | Local ONNX | Cloud API | None |
|
|
250
|
+
| **Codebase Indexing** | Yes (structural boundary detection) | No | No | No | No | No |
|
|
251
|
+
| **Session Recall** | Yes (auto-harvests past sessions) | No | No | No | No | Limited (CLAUDE.md) |
|
|
252
|
+
| **Query Expansion** | Yes (local LLM) | No | No | No | No | No |
|
|
253
|
+
| **LLM Reranking** | Yes (bge-reranker-v2-m3) | No | No | No | No | No |
|
|
254
|
+
| **Privacy** | 100% local, no data leaves machine | Cloud API calls | Cloud or self-host | 100% local | Self-host or cloud | Local files |
|
|
255
|
+
| **Dependencies** | SQLite + GGUF models (~1.5GB) | Docker + PostgreSQL + Qdrant + OpenAI key | Docker + Neo4j | SQLite + ONNX | PostgreSQL | None |
|
|
256
|
+
| **Pricing** | Free (open source, MIT) | Free tier / Pro $249/mo | Free self-host / Cloud $25-475/mo | Free (Apache-2.0) | Free (Apache-2.0) | Free (with Claude) |
|
|
257
|
+
| **GitHub Stars** | New | ~47K | ~23K | ~25 | ~21K | N/A |
|
|
258
|
+
|
|
259
|
+
### Where nano-brain shines
|
|
260
|
+
|
|
261
|
+
- **Hybrid search pipeline** — the only MCP memory server with BM25 + vector + query expansion + LLM reranking in a single pipeline
|
|
262
|
+
- **Codebase indexing** — index your source files with structural boundary detection, not just conversations
|
|
263
|
+
- **Session recall** — automatically harvests and indexes past AI coding sessions
|
|
264
|
+
- **Zero dependencies** — single SQLite file, local GGUF models, no Docker/PostgreSQL/Neo4j/API keys
|
|
265
|
+
- **Privacy** — 100% local processing, your code and conversations never leave your machine
|
|
266
|
+
|
|
267
|
+
### Consider alternatives if
|
|
268
|
+
|
|
269
|
+
- You need a knowledge graph with temporal reasoning (Zep/Graphiti)
|
|
270
|
+
- You want a full agent framework, not just memory (Letta)
|
|
271
|
+
- You need cloud-hosted memory shared across teams (Mem0 Cloud)
|
|
272
|
+
- You only need basic session notes (Claude native memory)
|
|
273
|
+
|
|
274
|
+
## AI Agent Integration
|
|
275
|
+
|
|
276
|
+
nano-brain ships with a SKILL.md that teaches AI agents when and how to use memory tools. When loaded as an OpenCode skill, agents automatically:
|
|
277
|
+
|
|
278
|
+
- **Check memory before starting work** — recall past decisions, patterns, and context
|
|
279
|
+
- **Save context after completing work** — persist key decisions and debugging insights
|
|
280
|
+
- **Route queries to the right search tool** — BM25 for exact terms, vector for concepts, hybrid for best quality
|
|
281
|
+
|
|
282
|
+
### SKILL.md (Auto-loaded)
|
|
283
|
+
|
|
284
|
+
The skill file at `SKILL.md` provides routing rules, trigger phrases, tool selection guides, and integration patterns. It's automatically loaded when any agent references the `nano-brain` skill.
|
|
285
|
+
|
|
286
|
+
### AGENTS_SNIPPET.md (Optional, project-level)
|
|
287
|
+
|
|
288
|
+
For project-level integration, `AGENTS_SNIPPET.md` provides a managed block that can be injected into a project's `AGENTS.md`:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
npx nano-brain init --root=/path/to/project
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
See [SKILL.md](./SKILL.md) for full routing rules and [AGENTS_SNIPPET.md](./AGENTS_SNIPPET.md) for the project-level snippet.
|
|
295
|
+
|
|
296
|
+
## License
|
|
297
|
+
|
|
298
|
+
MIT
|