@nano-step/nano-brain 2026.6.403 → 2026.6.501
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 +97 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,26 @@
|
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
[](https://github.com/nano-step/nano-brain)
|
|
8
8
|
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [What It Does](#what-it-does)
|
|
12
|
+
- [Use Cases](#use-cases)
|
|
13
|
+
- [Key Features](#key-features)
|
|
14
|
+
- [Prerequisites](#prerequisites)
|
|
15
|
+
- [Quick Start](#quick-start)
|
|
16
|
+
- [Verifying Downloads](#verifying-downloads)
|
|
17
|
+
- [Configuration](#configuration)
|
|
18
|
+
- [REST API](#rest-api)
|
|
19
|
+
- [CLI Commands](#cli-commands)
|
|
20
|
+
- [MCP Tools](#mcp-tools)
|
|
21
|
+
- [Search Pipeline](#search-pipeline)
|
|
22
|
+
- [Architecture](#architecture)
|
|
23
|
+
- [Migration from V1](#migration-from-v1)
|
|
24
|
+
- [Tech Stack](#tech-stack)
|
|
25
|
+
- [License](#license)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
9
29
|
## What It Does
|
|
10
30
|
|
|
11
31
|
nano-brain is a persistent memory server for AI coding agents that solves session amnesia. It automatically ingests AI sessions, notes, and codebase files, indexes everything with hybrid search (BM25 + pgvector), and serves memories via MCP tools and REST API. Built in Go with PostgreSQL — single static binary, zero CGO dependencies.
|
|
@@ -81,70 +101,105 @@ Before pushing, run `memory_impact` on your changed files to discover what else
|
|
|
81
101
|
|
|
82
102
|
## Quick Start
|
|
83
103
|
|
|
84
|
-
|
|
104
|
+
> **Let your AI agent set this up for you.** See [SETUP_AGENT.md](docs/SETUP_AGENT.md) — a step-by-step guide your agent can follow to install, configure, and verify nano-brain, checking for missing dependencies and asking before installing anything.
|
|
85
105
|
|
|
86
|
-
|
|
106
|
+
---
|
|
87
107
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"nano-brain": {
|
|
92
|
-
"type": "remote",
|
|
93
|
-
"url": "http://localhost:3100/mcp"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
```
|
|
108
|
+
### Path 1 — Local machine (Ollama + Docker, ~5 min)
|
|
109
|
+
|
|
110
|
+
The fastest way to get started on a single machine.
|
|
98
111
|
|
|
99
|
-
|
|
112
|
+
**Prerequisites:** [Docker](https://docs.docker.com/get-docker/), [Ollama](https://ollama.com/download), Node.js 18+
|
|
100
113
|
|
|
101
114
|
```bash
|
|
115
|
+
# 1. Install nano-brain
|
|
102
116
|
npm install -g @nano-step/nano-brain
|
|
103
117
|
|
|
104
|
-
# Start PostgreSQL + pgvector
|
|
118
|
+
# 2. Start PostgreSQL + pgvector
|
|
105
119
|
docker run -d --name nanobrain-pg -p 5432:5432 \
|
|
106
120
|
-e POSTGRES_USER=nanobrain -e POSTGRES_PASSWORD=nanobrain -e POSTGRES_DB=nanobrain_dev \
|
|
107
121
|
pgvector/pgvector:pg17
|
|
108
122
|
|
|
109
|
-
#
|
|
123
|
+
# 3. Pull embedding model
|
|
110
124
|
ollama pull nomic-embed-text
|
|
111
125
|
|
|
112
|
-
#
|
|
126
|
+
# 4. Verify everything is in order
|
|
113
127
|
nano-brain doctor
|
|
114
128
|
|
|
115
|
-
# Start server
|
|
129
|
+
# 5. Start the server (background)
|
|
116
130
|
nano-brain serve -d
|
|
131
|
+
|
|
132
|
+
# 6. Register your project
|
|
133
|
+
nano-brain init --root=/path/to/your/project
|
|
117
134
|
```
|
|
118
135
|
|
|
119
|
-
|
|
136
|
+
**Add to your MCP client** (Claude Code, OpenCode, Cursor, etc.):
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"mcp": {
|
|
140
|
+
"nano-brain": {
|
|
141
|
+
"type": "http",
|
|
142
|
+
"url": "http://localhost:3100/mcp"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Your AI agent now has persistent memory. It will automatically index your project files and harvest sessions as you work.
|
|
149
|
+
|
|
150
|
+
---
|
|
120
151
|
|
|
152
|
+
### Path 2 — VPS / team server (shared memory across machines)
|
|
153
|
+
|
|
154
|
+
Deploy once, connect from any machine. The whole team shares the same knowledge base.
|
|
155
|
+
|
|
156
|
+
**On the server:**
|
|
121
157
|
```bash
|
|
122
|
-
# Start PostgreSQL + pgvector
|
|
158
|
+
# 1. Start PostgreSQL + pgvector
|
|
123
159
|
docker run -d --name nanobrain-pg -p 5432:5432 \
|
|
124
160
|
-e POSTGRES_USER=nanobrain -e POSTGRES_PASSWORD=nanobrain -e POSTGRES_DB=nanobrain_dev \
|
|
125
161
|
pgvector/pgvector:pg17
|
|
126
162
|
|
|
127
|
-
#
|
|
128
|
-
|
|
163
|
+
# 2. Install and start nano-brain (with auth + public binding)
|
|
164
|
+
npm install -g @nano-step/nano-brain
|
|
165
|
+
nano-brain serve -d --host=0.0.0.0
|
|
129
166
|
|
|
130
|
-
#
|
|
131
|
-
|
|
167
|
+
# 3. Generate a bearer token for your team
|
|
168
|
+
nano-brain auth token
|
|
169
|
+
# → nbt_xxxxxxxxxxxxxxxx
|
|
170
|
+
```
|
|
132
171
|
|
|
133
|
-
|
|
134
|
-
|
|
172
|
+
**On each developer machine** — add to MCP client config:
|
|
173
|
+
```json
|
|
174
|
+
{
|
|
175
|
+
"mcp": {
|
|
176
|
+
"nano-brain": {
|
|
177
|
+
"type": "http",
|
|
178
|
+
"url": "http://YOUR_VPS_IP:3100/mcp",
|
|
179
|
+
"headers": {
|
|
180
|
+
"Authorization": "Bearer nbt_xxxxxxxxxxxxxxxx"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
135
185
|
```
|
|
136
186
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
187
|
+
```bash
|
|
188
|
+
# Register your local project against the remote server
|
|
189
|
+
NANO_BRAIN_SERVER=http://YOUR_VPS_IP:3100 nano-brain init --root=/path/to/project
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
See [Authentication](#authentication-vps--remote-deployment) for role-based tokens (admin / developer / read-only).
|
|
193
|
+
|
|
194
|
+
---
|
|
140
195
|
|
|
141
|
-
###
|
|
196
|
+
### Path 3 — Build from source
|
|
142
197
|
|
|
143
198
|
```bash
|
|
144
199
|
# Build
|
|
145
200
|
CGO_ENABLED=0 go build -o nano-brain ./cmd/nano-brain
|
|
146
201
|
|
|
147
|
-
# Start PostgreSQL + pgvector
|
|
202
|
+
# Start PostgreSQL + pgvector
|
|
148
203
|
docker run -d --name nanobrain-pg -p 5432:5432 \
|
|
149
204
|
-e POSTGRES_USER=nanobrain -e POSTGRES_PASSWORD=nanobrain -e POSTGRES_DB=nanobrain_dev \
|
|
150
205
|
pgvector/pgvector:pg17
|
|
@@ -152,22 +207,22 @@ docker run -d --name nanobrain-pg -p 5432:5432 \
|
|
|
152
207
|
# Start server
|
|
153
208
|
DATABASE_URL="postgres://nanobrain:nanobrain@localhost:5432/nanobrain_dev" ./nano-brain
|
|
154
209
|
|
|
155
|
-
# Register workspace
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
210
|
+
# Register workspace and check status
|
|
211
|
+
./nano-brain init --root=/path/to/project
|
|
212
|
+
./nano-brain status
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
159
216
|
|
|
160
|
-
|
|
161
|
-
curl -X POST http://localhost:3100/api/v1/write \
|
|
162
|
-
-H "Content-Type: application/json" \
|
|
163
|
-
-d '{"workspace":"<hash>","source_path":"notes/decision.md","content":"# Decision\nUse PostgreSQL.","tags":["decision"]}'
|
|
217
|
+
### Via npx (no global install)
|
|
164
218
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
-d '{"workspace":"<hash>","query":"database decision"}'
|
|
219
|
+
```bash
|
|
220
|
+
npx @nano-step/nano-brain@latest doctor
|
|
221
|
+
npx @nano-step/nano-brain@latest serve -d
|
|
169
222
|
```
|
|
170
223
|
|
|
224
|
+
> Also available as `npx nano-brain@latest`. Do NOT run from the nano-brain source directory — npm will resolve the local package instead of the registry.
|
|
225
|
+
|
|
171
226
|
## Verifying Downloads
|
|
172
227
|
|
|
173
228
|
Every release ships a `SHA256SUMS` asset alongside the four platform binaries.
|