project-brain 0.11.0 → 0.12.0
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 +11 -5
- package/bin/project-brain +9 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -154,10 +154,14 @@ project-brain setup
|
|
|
154
154
|
Initialize a project. Detects the stack, writes a `CLAUDE.md` with MCP instructions, installs a git hook, scaffolds module stubs in `docs/modules/`, and indexes the project.
|
|
155
155
|
|
|
156
156
|
```bash
|
|
157
|
-
project-brain init [--skip-index]
|
|
157
|
+
project-brain init [--skip-index] [--no-embed] [--embed-model=<key>]
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
- `--skip-index` — skip the initial index pass (useful when Ollama is not yet running)
|
|
161
|
+
- `--no-embed` — index for keyword search only, no embedding model (equivalent to `BRAIN_EMBED_MODEL=none`)
|
|
162
|
+
- `--embed-model=<key>` — pin the embedding model non-interactively (registry key or raw Ollama model name)
|
|
163
|
+
|
|
164
|
+
When run in a terminal (and neither flag nor `BRAIN_EMBED_MODEL` is set), `init` interactively asks which embedding model to use — including the option to skip embeddings entirely for a lexical-only project. Non-interactive runs (CI, scripts, non-TTY) skip the prompt and fall back to the registry default.
|
|
161
165
|
|
|
162
166
|
### `sync`
|
|
163
167
|
|
|
@@ -172,9 +176,11 @@ project-brain sync
|
|
|
172
176
|
Full re-index — drops and rebuilds the entire vector index for the current project.
|
|
173
177
|
|
|
174
178
|
```bash
|
|
175
|
-
project-brain reindex
|
|
179
|
+
project-brain reindex [--no-embed] [--embed-model=<key>]
|
|
176
180
|
```
|
|
177
181
|
|
|
182
|
+
Same `--no-embed`/`--embed-model=<key>` flags as `init` (see above). Since a full rebuild is already a deliberate action, `reindex` also interactively asks which model to use when run in a terminal without a flag/env override — defaulting to whatever model the project is currently indexed with.
|
|
183
|
+
|
|
178
184
|
### `health`
|
|
179
185
|
|
|
180
186
|
Check system health: Ollama availability, LanceDB status, and staleness of the index.
|
|
@@ -215,7 +221,7 @@ BRAIN_HTTP_TOKEN=your-secret project-brain serve --http [--port 3000]
|
|
|
215
221
|
| `BRAIN_HTTP_PORT` | `3000` | Port for HTTP server mode |
|
|
216
222
|
| `BRAIN_HTTP_TOKEN` | — | **Required** for `serve --http`. Bearer secret. |
|
|
217
223
|
| `BRAIN_DATA_DIR` | `~/.project-brain/data` | LanceDB + structural graph data directory |
|
|
218
|
-
| `BRAIN_EMBED_MODEL` | `qwen3-embedding:0.6b` | Ollama embedding model (registry keys: `qwen3-embedding`, `nomic-text`; or any raw Ollama model name) |
|
|
224
|
+
| `BRAIN_EMBED_MODEL` | `qwen3-embedding:0.6b` | Ollama embedding model (registry keys: `qwen3-embedding`, `nomic-text`; or any raw Ollama model name; `none` disables embeddings — lexical/keyword search only, no Ollama needed) |
|
|
219
225
|
| `OLLAMA_HOST` | `http://127.0.0.1:11434` | Ollama server URL |
|
|
220
226
|
| `BRAIN_NO_UPDATE_CHECK` | — | Set to `1` to disable the update-available notice |
|
|
221
227
|
|
|
@@ -226,13 +232,13 @@ BRAIN_HTTP_TOKEN=your-secret project-brain serve --http [--port 3000]
|
|
|
226
232
|
| Variable | Default | Range | Effect |
|
|
227
233
|
|---|---|---|---|
|
|
228
234
|
| `BRAIN_EMBED_BATCH_SIZE` | `64` | `1`–`512` | Texts per Ollama embed request. Lower it if Ollama times out under load. |
|
|
229
|
-
| `BRAIN_EMBED_CONCURRENCY` | `
|
|
235
|
+
| `BRAIN_EMBED_CONCURRENCY` | `1` | `1`–`16` | Concurrent embed requests. Defaults to `1` — a single local Ollama instance is GPU-compute-bound, so concurrency>1 adds no throughput, only false-timeout risk. Raise it only against a genuine multi-host pool (`BRAIN_OLLAMA_HOSTS`) or remote inference API where separate hardware actually runs requests in parallel. |
|
|
230
236
|
| `BRAIN_OLLAMA_HOSTS` | — | comma-separated URLs | Pool of Ollama hosts for round-robin embedding (e.g. `http://127.0.0.1:11434,http://127.0.0.1:11435`). Falls through to the next host on failure; only `null`s when every host fails. |
|
|
231
237
|
| `BRAIN_EMBED_MODEL` | `qwen3-embedding:0.6b` | model name | Override the embedding model (see table above). |
|
|
232
238
|
|
|
233
239
|
A partial or total embed failure makes `sync`/`reindex` exit non-zero (`1`) — check the exit code in automation (CI, git hooks), not just stderr text.
|
|
234
240
|
|
|
235
|
-
Leaving `BRAIN_EMBED_BATCH_SIZE`/`BRAIN_EMBED_CONCURRENCY` unset does not mean "always use the defaults above" — each unset knob is auto-detected from machine resources at sync time (available
|
|
241
|
+
Leaving `BRAIN_EMBED_BATCH_SIZE`/`BRAIN_EMBED_CONCURRENCY` unset does not mean "always use the defaults above" — each unset knob is auto-detected from machine resources at sync time (available free memory, and whether another model is already loaded in Ollama alongside the embed model, which risks VRAM contention). A log line like `[sync] auto-tuned embed config: concurrency=1 batchSize=16 (vram-contention)` explains why. Set either var explicitly to pin it — env values always win over auto-detection.
|
|
236
242
|
|
|
237
243
|
`.project-brain/manifest.db` (plus its `-wal`/`-shm` sidecars) replaces the old `hashes.json` incremental-sync manifest. It is gitignored already — if you have a stale `hashes.json` around, it migrates automatically on first sync and is renamed to `hashes.json.bak`.
|
|
238
244
|
|
package/bin/project-brain
CHANGED
|
@@ -35,7 +35,15 @@ const ext = process.platform === "win32" ? ".exe" : "";
|
|
|
35
35
|
// Propagate the child's exit code/signal quietly instead of letting Node
|
|
36
36
|
// print a stack trace that buries the child's own error message.
|
|
37
37
|
try {
|
|
38
|
-
execFileSync(join(pkgDir, "bin", `project-brain-native${ext}`), process.argv.slice(2), {
|
|
38
|
+
execFileSync(join(pkgDir, "bin", `project-brain-native${ext}`), process.argv.slice(2), {
|
|
39
|
+
stdio: "inherit",
|
|
40
|
+
// lancedb's native addon reads this once at process start, not lazily —
|
|
41
|
+
// it must already be in the CHILD's OS environment before it boots.
|
|
42
|
+
// Setting process.env mid-process (in this parent, or inside cli.ts)
|
|
43
|
+
// is too late and the "vector index statistics include centroids" WARN
|
|
44
|
+
// still fires.
|
|
45
|
+
env: { ...process.env, LANCE_INCLUDE_VECTOR_CENTROIDS: process.env.LANCE_INCLUDE_VECTOR_CENTROIDS ?? "false" },
|
|
46
|
+
});
|
|
39
47
|
} catch (err) {
|
|
40
48
|
if (err && typeof err.status === "number") process.exit(err.status);
|
|
41
49
|
if (err && err.signal) process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-brain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
|
|
6
6
|
"author": "jcsoftdev",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"zod": "^4.4.3"
|
|
45
45
|
},
|
|
46
46
|
"optionalDependencies": {
|
|
47
|
-
"project-brain-darwin-arm64": "0.
|
|
48
|
-
"project-brain-linux-x64": "0.
|
|
49
|
-
"project-brain-linux-arm64": "0.
|
|
50
|
-
"project-brain-windows-x64": "0.
|
|
51
|
-
"project-brain-windows-arm64": "0.
|
|
47
|
+
"project-brain-darwin-arm64": "0.12.0",
|
|
48
|
+
"project-brain-linux-x64": "0.12.0",
|
|
49
|
+
"project-brain-linux-arm64": "0.12.0",
|
|
50
|
+
"project-brain-windows-x64": "0.12.0",
|
|
51
|
+
"project-brain-windows-arm64": "0.12.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/bun": "latest",
|