@nano-step/nano-brain 2026.5.3008 → 2026.5.3102
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 +6 -58
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -147,34 +147,9 @@ summarization:
|
|
|
147
147
|
When `summarization.enabled: true`, nano-brain automatically generates structured markdown summaries of each harvested session using an OpenAI-compatible LLM provider. Summaries are:
|
|
148
148
|
|
|
149
149
|
- Stored in PostgreSQL under collection `session-summary` for semantic search via the standard query/vsearch API (PG is the source of truth)
|
|
150
|
-
- Optionally written to disk as Markdown files for Obsidian-compatible access (see [Disk persistence](#disk-persistence-obsidian-compatible) below)
|
|
151
150
|
- Idempotent — unchanged sessions are skipped; re-harvested sessions overwrite old summaries
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
By default, summaries are written to disk as Markdown files at the path configured in
|
|
156
|
-
`summarization.output_dir` (default: `~/.nano-brain/summaries`). The file layout is:
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
<output_dir>/<workspace_name>/<source>_<slugified-title>_<YYYY-MM-DD>.md
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
Files are byte-identical to the `documents.content` field in PostgreSQL — disk is a
|
|
163
|
-
derivative view, DB is source of truth. Disk write failures (permission denied, disk
|
|
164
|
-
full) log a WARN but do not roll back the DB transaction.
|
|
165
|
-
|
|
166
|
-
To opt out (DB-only persistence):
|
|
167
|
-
|
|
168
|
-
```yaml
|
|
169
|
-
summarization:
|
|
170
|
-
write_to_disk: false
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
To backfill historical summaries already in the DB:
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
nano-brain backfill-summaries
|
|
177
|
-
```
|
|
152
|
+
> **Note**: as of `harvest-summary-only` (May 2026), summaries are no longer written to disk as `.md` files. The legacy `output_dir` YAML key is silently ignored for backward compat. Any pre-existing files under `~/.nano-brain/summaries/` are stale artifacts and can be safely deleted.
|
|
178
153
|
|
|
179
154
|
**Quick setup with ai-proxy:**
|
|
180
155
|
|
|
@@ -200,25 +175,13 @@ Large sessions (100K+ tokens) are handled via map-reduce chunking — no session
|
|
|
200
175
|
|
|
201
176
|
| Variable | Description |
|
|
202
177
|
|----------|-------------|
|
|
203
|
-
| `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). |
|
|
204
178
|
| `DATABASE_URL` | PostgreSQL connection string |
|
|
205
179
|
| `VOYAGE_API_KEY` | Voyage AI API key |
|
|
206
180
|
| `OPENCODE_DB_ROOT` | OpenCode per-project DB root directory (multi-DB mode) |
|
|
207
181
|
| `OPENCODE_DB_PATH` | OpenCode single SQLite database path |
|
|
208
182
|
| `OPENCODE_STORAGE_DIR` | OpenCode session directory (legacy) |
|
|
209
183
|
| `NANO_BRAIN_SUMMARIZE_API_KEY` | API key for the summarization LLM provider |
|
|
210
|
-
| `NANO_BRAIN_*` | Override any config
|
|
211
|
-
|
|
212
|
-
**Docker example** — run the server in a container against a host PostgreSQL:
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
# /path/to/container-config.yml uses host.docker.internal for DB/Ollama
|
|
216
|
-
docker run -d \
|
|
217
|
-
-e NANO_BRAIN_CONFIG=/etc/nano-brain/config.yml \
|
|
218
|
-
-v /path/to/container-config.yml:/etc/nano-brain/config.yml:ro \
|
|
219
|
-
-p 3100:3100 \
|
|
220
|
-
nano-brain:latest
|
|
221
|
-
```
|
|
184
|
+
| `NANO_BRAIN_*` | Override any config (e.g., `NANO_BRAIN_SERVER_PORT=3100`) |
|
|
222
185
|
|
|
223
186
|
## REST API
|
|
224
187
|
|
|
@@ -230,7 +193,6 @@ docker run -d \
|
|
|
230
193
|
| GET | `/api/status` | Server status with version, uptime, workspace stats |
|
|
231
194
|
| POST | `/api/v1/init` | Register workspace |
|
|
232
195
|
| GET | `/api/v1/workspaces` | List all workspaces (with doc counts) |
|
|
233
|
-
| DELETE | `/api/v1/workspaces/:hash` | Permanently delete a workspace + cascade docs/chunks/embeddings |
|
|
234
196
|
| GET | `/api/v1/wake-up` | Workspace briefing |
|
|
235
197
|
| POST | `/api/harvest` | Trigger session harvesting |
|
|
236
198
|
| POST | `/api/reload-config` | Hot-reload configuration |
|
|
@@ -251,8 +213,6 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
251
213
|
| PUT | `/api/v1/collections/:name` | Rename collection |
|
|
252
214
|
| DELETE | `/api/v1/collections/:name` | Remove collection |
|
|
253
215
|
| GET | `/api/v1/tags` | List tags with counts |
|
|
254
|
-
| POST | `/api/v1/get` | Get single document by source_path or id |
|
|
255
|
-
| POST | `/api/v1/multi-get` | Batch fetch documents by paths or ids |
|
|
256
216
|
| POST | `/api/v1/reindex` | Queue reindex (202) |
|
|
257
217
|
| POST | `/api/v1/update` | Queue update (202) |
|
|
258
218
|
| POST | `/api/v1/summarize` | Trigger LLM summarization of harvested sessions |
|
|
@@ -271,21 +231,13 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
271
231
|
|---------|-------------|
|
|
272
232
|
| `nano-brain` (no args) | Start HTTP server (default: port 3100) |
|
|
273
233
|
| `nano-brain init --root=<path>` | Register workspace |
|
|
274
|
-
| `nano-brain workspaces list` | List registered workspaces with doc counts |
|
|
275
|
-
| `nano-brain workspaces remove --workspace=<hash> [--dry-run\|--force]` | Permanently delete a workspace + all its documents/chunks/embeddings |
|
|
276
234
|
| `nano-brain write` | Write document via CLI |
|
|
277
|
-
| `nano-brain query
|
|
278
|
-
| `nano-brain search
|
|
279
|
-
| `nano-brain vsearch
|
|
280
|
-
| `nano-brain wake-up --workspace=<hash>` | Workspace briefing (collections, stats, recent memories) |
|
|
281
|
-
| `nano-brain get <source_path\|uuid> --workspace=<hash>` | Fetch a single document by source_path or UUID |
|
|
282
|
-
| `nano-brain tags --workspace=<hash>` | List all tags with document counts |
|
|
283
|
-
| `nano-brain multi-get --workspace=<hash> --paths=p1,p2` | Fetch multiple documents in one round-trip |
|
|
235
|
+
| `nano-brain query` | Hybrid search |
|
|
236
|
+
| `nano-brain search` | BM25 keyword search |
|
|
237
|
+
| `nano-brain vsearch` | Vector similarity search |
|
|
284
238
|
| `nano-brain collection add\|remove\|list` | Manage collections |
|
|
285
239
|
| `nano-brain harvest` | Trigger session harvesting |
|
|
286
|
-
| `nano-brain backfill-summaries [--dry-run] [--workspace=] [--since=]` | Export existing DB summaries to disk (.md files for Obsidian etc.) |
|
|
287
240
|
| `nano-brain cleanup-stale-raw [--dry-run]` | Delete pre-#192 raw OpenCode session docs superseded by summaries |
|
|
288
|
-
| `nano-brain cleanup-orphan-workspaces [--dry-run]` | Delete documents/chunks under workspace_hash values not registered in `workspaces`. Run BEFORE migration 00011 (issue #238). |
|
|
289
241
|
| `nano-brain bench generate\|run\|compare\|stress` | Benchmarking suite |
|
|
290
242
|
| `nano-brain db:migrate` | Run pending goose migrations |
|
|
291
243
|
| `nano-brain db:migrate --from-v1 <path>` | Import V1 SQLite data |
|
|
@@ -296,7 +248,7 @@ Workspace is passed in the JSON body for POST, query param for GET.
|
|
|
296
248
|
|
|
297
249
|
## MCP Tools
|
|
298
250
|
|
|
299
|
-
nano-brain exposes
|
|
251
|
+
nano-brain exposes 9 tools via MCP (Model Context Protocol):
|
|
300
252
|
|
|
301
253
|
| Tool | Description |
|
|
302
254
|
|------|-------------|
|
|
@@ -309,10 +261,6 @@ nano-brain exposes 13 tools via MCP (Model Context Protocol):
|
|
|
309
261
|
| `memory_status` | Server and embedding status |
|
|
310
262
|
| `memory_update` | Trigger re-embedding |
|
|
311
263
|
| `memory_wake_up` | Workspace briefing |
|
|
312
|
-
| `memory_graph` | Knowledge graph view (module → function → dep) |
|
|
313
|
-
| `memory_trace` | Call chain trace from entry point |
|
|
314
|
-
| `memory_impact` | Cross-file change impact analysis |
|
|
315
|
-
| `memory_symbols` | Symbol search (functions, types, constants) |
|
|
316
264
|
|
|
317
265
|
### MCP Configuration
|
|
318
266
|
|