@nano-step/nano-brain 2026.5.2903 → 2026.5.3006
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/README.md +31 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -175,13 +175,25 @@ Large sessions (100K+ tokens) are handled via map-reduce chunking — no session
|
|
|
175
175
|
|
|
176
176
|
| Variable | Description |
|
|
177
177
|
|----------|-------------|
|
|
178
|
+
| `NANO_BRAIN_CONFIG` | Path to YAML config file (12-factor; useful in Docker/k8s). Precedence: `--config` flag > `NANO_BRAIN_CONFIG` > `~/.nano-brain/config.yml`. Leading/trailing whitespace is stripped. If the env-pointed file does not exist, a `WARNING:` is printed to stderr and defaults are used (operator can spot typos). |
|
|
178
179
|
| `DATABASE_URL` | PostgreSQL connection string |
|
|
179
180
|
| `VOYAGE_API_KEY` | Voyage AI API key |
|
|
180
181
|
| `OPENCODE_DB_ROOT` | OpenCode per-project DB root directory (multi-DB mode) |
|
|
181
182
|
| `OPENCODE_DB_PATH` | OpenCode single SQLite database path |
|
|
182
183
|
| `OPENCODE_STORAGE_DIR` | OpenCode session directory (legacy) |
|
|
183
184
|
| `NANO_BRAIN_SUMMARIZE_API_KEY` | API key for the summarization LLM provider |
|
|
184
|
-
| `NANO_BRAIN_*` | Override any config (e.g., `NANO_BRAIN_SERVER_PORT=3100`) |
|
|
185
|
+
| `NANO_BRAIN_*` | Override any config field (e.g., `NANO_BRAIN_SERVER_PORT=3100`) |
|
|
186
|
+
|
|
187
|
+
**Docker example** — run the server in a container against a host PostgreSQL:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# /path/to/container-config.yml uses host.docker.internal for DB/Ollama
|
|
191
|
+
docker run -d \
|
|
192
|
+
-e NANO_BRAIN_CONFIG=/etc/nano-brain/config.yml \
|
|
193
|
+
-v /path/to/container-config.yml:/etc/nano-brain/config.yml:ro \
|
|
194
|
+
-p 3100:3100 \
|
|
195
|
+
nano-brain:latest
|
|
196
|
+
```
|
|
185
197
|
|
|
186
198
|
## REST API
|
|
187
199
|
|
|
@@ -193,6 +205,7 @@ Large sessions (100K+ tokens) are handled via map-reduce chunking — no session
|
|
|
193
205
|
| GET | `/api/status` | Server status with version, uptime, workspace stats |
|
|
194
206
|
| POST | `/api/v1/init` | Register workspace |
|
|
195
207
|
| GET | `/api/v1/workspaces` | List all workspaces (with doc counts) |
|
|
208
|
+
| DELETE | `/api/v1/workspaces/:hash` | Permanently delete a workspace + cascade docs/chunks/embeddings |
|
|
196
209
|
| GET | `/api/v1/wake-up` | Workspace briefing |
|
|
197
210
|
| POST | `/api/harvest` | Trigger session harvesting |
|
|
198
211
|
| POST | `/api/reload-config` | Hot-reload configuration |
|
|
@@ -213,6 +226,8 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
213
226
|
| PUT | `/api/v1/collections/:name` | Rename collection |
|
|
214
227
|
| DELETE | `/api/v1/collections/:name` | Remove collection |
|
|
215
228
|
| GET | `/api/v1/tags` | List tags with counts |
|
|
229
|
+
| POST | `/api/v1/get` | Get single document by source_path or id |
|
|
230
|
+
| POST | `/api/v1/multi-get` | Batch fetch documents by paths or ids |
|
|
216
231
|
| POST | `/api/v1/reindex` | Queue reindex (202) |
|
|
217
232
|
| POST | `/api/v1/update` | Queue update (202) |
|
|
218
233
|
| POST | `/api/v1/summarize` | Trigger LLM summarization of harvested sessions |
|
|
@@ -231,13 +246,20 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
231
246
|
|---------|-------------|
|
|
232
247
|
| `nano-brain` (no args) | Start HTTP server (default: port 3100) |
|
|
233
248
|
| `nano-brain init --root=<path>` | Register workspace |
|
|
249
|
+
| `nano-brain workspaces list` | List registered workspaces with doc counts |
|
|
250
|
+
| `nano-brain workspaces remove --workspace=<hash> [--dry-run\|--force]` | Permanently delete a workspace + all its documents/chunks/embeddings |
|
|
234
251
|
| `nano-brain write` | Write document via CLI |
|
|
235
|
-
| `nano-brain query` | Hybrid search |
|
|
236
|
-
| `nano-brain search` | BM25 keyword search |
|
|
237
|
-
| `nano-brain vsearch` | Vector similarity search |
|
|
252
|
+
| `nano-brain query [--scope=all] [--tags=t1,t2]` | Hybrid search (BM25 + vector + RRF + recency) |
|
|
253
|
+
| `nano-brain search [--scope=all] [--tags=t1,t2]` | BM25 keyword search |
|
|
254
|
+
| `nano-brain vsearch [--scope=all] [--tags=t1,t2]` | Vector similarity search |
|
|
255
|
+
| `nano-brain wake-up --workspace=<hash>` | Workspace briefing (collections, stats, recent memories) |
|
|
256
|
+
| `nano-brain get <source_path\|uuid> --workspace=<hash>` | Fetch a single document by source_path or UUID |
|
|
257
|
+
| `nano-brain tags --workspace=<hash>` | List all tags with document counts |
|
|
258
|
+
| `nano-brain multi-get --workspace=<hash> --paths=p1,p2` | Fetch multiple documents in one round-trip |
|
|
238
259
|
| `nano-brain collection add\|remove\|list` | Manage collections |
|
|
239
260
|
| `nano-brain harvest` | Trigger session harvesting |
|
|
240
261
|
| `nano-brain cleanup-stale-raw [--dry-run]` | Delete pre-#192 raw OpenCode session docs superseded by summaries |
|
|
262
|
+
| `nano-brain cleanup-orphan-workspaces [--dry-run]` | Delete documents/chunks under workspace_hash values not registered in `workspaces`. Run BEFORE migration 00011 (issue #238). |
|
|
241
263
|
| `nano-brain bench generate\|run\|compare\|stress` | Benchmarking suite |
|
|
242
264
|
| `nano-brain db:migrate` | Run pending goose migrations |
|
|
243
265
|
| `nano-brain db:migrate --from-v1 <path>` | Import V1 SQLite data |
|
|
@@ -248,7 +270,7 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
248
270
|
|
|
249
271
|
## MCP Tools
|
|
250
272
|
|
|
251
|
-
nano-brain exposes
|
|
273
|
+
nano-brain exposes 13 tools via MCP (Model Context Protocol):
|
|
252
274
|
|
|
253
275
|
| Tool | Description |
|
|
254
276
|
|------|-------------|
|
|
@@ -261,6 +283,10 @@ nano-brain exposes 9 tools via MCP (Model Context Protocol):
|
|
|
261
283
|
| `memory_status` | Server and embedding status |
|
|
262
284
|
| `memory_update` | Trigger re-embedding |
|
|
263
285
|
| `memory_wake_up` | Workspace briefing |
|
|
286
|
+
| `memory_graph` | Knowledge graph view (module → function → dep) |
|
|
287
|
+
| `memory_trace` | Call chain trace from entry point |
|
|
288
|
+
| `memory_impact` | Cross-file change impact analysis |
|
|
289
|
+
| `memory_symbols` | Symbol search (functions, types, constants) |
|
|
264
290
|
|
|
265
291
|
### MCP Configuration
|
|
266
292
|
|