project-brain 0.9.0 → 0.10.1
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 +17 -0
- package/bin/project-brain +11 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -219,6 +219,23 @@ BRAIN_HTTP_TOKEN=your-secret project-brain serve --http [--port 3000]
|
|
|
219
219
|
| `OLLAMA_HOST` | `http://127.0.0.1:11434` | Ollama server URL |
|
|
220
220
|
| `BRAIN_NO_UPDATE_CHECK` | — | Set to `1` to disable the update-available notice |
|
|
221
221
|
|
|
222
|
+
## Tuning (environment variables)
|
|
223
|
+
|
|
224
|
+
`sync`/`reindex` throughput and resilience are tunable independently of the model:
|
|
225
|
+
|
|
226
|
+
| Variable | Default | Range | Effect |
|
|
227
|
+
|---|---|---|---|
|
|
228
|
+
| `BRAIN_EMBED_BATCH_SIZE` | `64` | `1`–`512` | Texts per Ollama embed request. Lower it if Ollama times out under load. |
|
|
229
|
+
| `BRAIN_EMBED_CONCURRENCY` | `3` | `1`–`16` | Concurrent embed requests. Set to `1` on shared/VRAM-constrained GPUs. |
|
|
230
|
+
| `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
|
+
| `BRAIN_EMBED_MODEL` | `qwen3-embedding:0.6b` | model name | Override the embedding model (see table above). |
|
|
232
|
+
|
|
233
|
+
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
|
+
|
|
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 cores/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
|
+
|
|
237
|
+
`.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
|
+
|
|
222
239
|
## Update notifications
|
|
223
240
|
|
|
224
241
|
The CLI checks (at most once a day, in the background) whether a newer `project-brain` is published on npm and prints a one-line notice when one is available. It is fail-silent, adds zero latency (the check runs in a detached process; the current command reads only a cached result), and is skipped in CI. Disable it with `BRAIN_NO_UPDATE_CHECK=1`.
|
package/bin/project-brain
CHANGED
|
@@ -30,4 +30,14 @@ try {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
33
|
-
execFileSync
|
|
33
|
+
// execFileSync throws whenever the child exits non-zero — a legitimate,
|
|
34
|
+
// expected outcome now that sync/reindex exit 1 on partial embed failure.
|
|
35
|
+
// Propagate the child's exit code/signal quietly instead of letting Node
|
|
36
|
+
// print a stack trace that buries the child's own error message.
|
|
37
|
+
try {
|
|
38
|
+
execFileSync(join(pkgDir, "bin", `project-brain-native${ext}`), process.argv.slice(2), { stdio: "inherit" });
|
|
39
|
+
} catch (err) {
|
|
40
|
+
if (err && typeof err.status === "number") process.exit(err.status);
|
|
41
|
+
if (err && err.signal) process.exit(1);
|
|
42
|
+
throw err; // genuine spawn failure (ENOENT, EACCES) — keep the diagnostic
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-brain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
|
|
6
6
|
"author": "jcsoftdev",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"zod": "^4.4.3"
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
|
-
"project-brain-darwin-arm64": "0.
|
|
47
|
-
"project-brain-linux-x64": "0.
|
|
48
|
-
"project-brain-linux-arm64": "0.
|
|
49
|
-
"project-brain-windows-x64": "0.
|
|
50
|
-
"project-brain-windows-arm64": "0.
|
|
46
|
+
"project-brain-darwin-arm64": "0.10.1",
|
|
47
|
+
"project-brain-linux-x64": "0.10.1",
|
|
48
|
+
"project-brain-linux-arm64": "0.10.1",
|
|
49
|
+
"project-brain-windows-x64": "0.10.1",
|
|
50
|
+
"project-brain-windows-arm64": "0.10.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/bun": "latest",
|