project-brain 0.8.2 → 0.10.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 +18 -1
- package/package.json +6 -6
- package/templates/module-doc.md +13 -0
- package/templates/project.claude.md +17 -0
- package/templates/rules.claude.md +7 -0
- package/templates/rules.codex.md +7 -0
- package/templates/rules.gemini.md +7 -0
package/README.md
CHANGED
|
@@ -133,7 +133,7 @@ You talk to your **AI assistant** in natural language; it picks the right tool.
|
|
|
133
133
|
|
|
134
134
|
Tips to maximize value:
|
|
135
135
|
|
|
136
|
-
- **Structural and lexical tools work without Ollama.** `find_symbol` / `find_callers` / `find_callees` / `impact` / `trace_path` query the local SQLite graph, and `search_code` queries the local FTS index — all work even with embeddings unavailable.
|
|
136
|
+
- **Structural and lexical tools work without Ollama.** `find_symbol` / `find_callers` / `find_callees` / `impact` / `trace_path` query the local SQLite graph, and `search_code` queries the local FTS index — all work even with embeddings unavailable. `search_context` itself degrades gracefully too: with no Ollama it falls back to a BM25 lexical floor (code-aware query expansion over the local FTS index) and marks the result `degraded: true, mode: "lexical"` instead of failing — conceptual recall is reduced, so start Ollama for full semantic search when you can.
|
|
137
137
|
- **Keep the index fresh automatically.** The git hook re-syncs on commit and the file watcher re-indexes on save while `serve` runs — no manual step. Run `project-brain sync` after big external changes.
|
|
138
138
|
- **Prefer `expand_context` over re-reading files.** `search_context` returns a `chunk_id`; expanding it is cheaper than the assistant reading the whole file.
|
|
139
139
|
- **Lead with the exact name when you have it.** "find_symbol X" / "who calls X" is faster and more precise than a semantic search.
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-brain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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",
|
|
@@ -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.0",
|
|
47
|
+
"project-brain-linux-x64": "0.10.0",
|
|
48
|
+
"project-brain-linux-arm64": "0.10.0",
|
|
49
|
+
"project-brain-windows-x64": "0.10.0",
|
|
50
|
+
"project-brain-windows-arm64": "0.10.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/bun": "latest",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Project: {{projectId}}
|
|
2
|
+
|
|
3
|
+
This project is indexed with [project-brain](https://github.com/jcsoftdev/project-brain).
|
|
4
|
+
|
|
5
|
+
## project-brain MCP
|
|
6
|
+
|
|
7
|
+
You have access to the `project-brain` MCP server for codebase knowledge retrieval.
|
|
8
|
+
|
|
9
|
+
{{tools}}
|
|
10
|
+
|
|
11
|
+
When answering questions about this codebase, run `search_context` first to find semantically relevant context before reading files directly — and reach for the structural tools when you know the exact symbol, caller, or want the impact of a change.
|
|
12
|
+
|
|
13
|
+
### Project Context
|
|
14
|
+
|
|
15
|
+
- **Project ID**: {{projectId}}
|
|
16
|
+
- **Stack**: {{stack}}
|
|
17
|
+
{{modules}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## project-brain MCP
|
|
2
|
+
|
|
3
|
+
You have access to the `project-brain` MCP server for codebase knowledge retrieval.
|
|
4
|
+
|
|
5
|
+
{{tools}}
|
|
6
|
+
|
|
7
|
+
When answering questions about the codebase, run `search_context` first for fuzzy/conceptual questions, and use the structural tools (`find_symbol`/`find_callers`/`find_callees`/`impact`) for exact symbols, callers, and change impact — before reading files directly.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## project-brain MCP
|
|
2
|
+
|
|
3
|
+
You have access to `project-brain` MCP tools for codebase knowledge retrieval.
|
|
4
|
+
|
|
5
|
+
{{tools}}
|
|
6
|
+
|
|
7
|
+
When answering codebase questions, prefer `search_context` for fuzzy/conceptual lookups and the structural tools for exact symbols, callers, and change impact — faster and more precise than reading files directly.
|