project-brain 0.33.0 → 0.34.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 CHANGED
@@ -256,7 +256,21 @@ The CLI commands exit 0 for any executed query — including legitimate empty re
256
256
 
257
257
  Curated knowledge (the *why* behind the code) lives in an OKF bundle rather than in these tools — see [`okf`](#okf--knowledge-bundles-the-why-not-the-what).
258
258
 
259
- Routing: exact symbol → `find_symbol`; who-calls → `find_callers`; what-it-calls → `find_callees`; "what breaks if I change X" → `impact`; "how does A end up calling B" → `trace_path`; fuzzy/conceptual → `search_context` then `expand_context`; exact string/identifier you can type verbatim → `search_code`. The canonical tool list lives in `src/constants.ts` (`TOOL_CATALOG`) and is rendered into both the MCP server instructions and the per-project `CLAUDE.md`.
259
+ Routing: exact symbol → `find_symbol`; who-calls → `find_callers`; what-it-calls → `find_callees`; "what breaks if I change X" → `impact`; "how does A end up calling B" → `trace_path`; fuzzy/conceptual → `search_context` then `expand_context`; exact string/identifier you can type verbatim → `search_code`. The canonical tool list lives in `src/constants.ts` (`TOOL_CATALOG`) and is rendered into the MCP server instructions plus the global rules files for hosts not proven to surface those instructions to the model. Claude Code IS proven to surface them (they land in context on every MCP connection), so its global and per-project `CLAUDE.md` point at that live copy instead of re-embedding the catalog.
260
+
261
+ ## Reranking (optional)
262
+
263
+ `search_context` can rerank its retrieved pool with [TypeSafe](https://typesafe.ai)'s Jev model before the usual threshold/MMR/budget steps run, scoring every candidate's relevance to the query with a single call. Measured on a bench of 332 mined queries (30 candidates each): recall@1 goes from 66.0% to 84.3%, and MRR from 0.761 to 0.894, at p50 0.60s and $0.15 for the whole bench.
264
+
265
+ It is opt-in and sends data off-machine: **the query text and every candidate's code/doc snippet are sent to `api.typesafe.ai`.** Enable it only if that is acceptable for your codebase.
266
+
267
+ To enable it:
268
+
269
+ - Run `project-brain setup` and select the reranker unit when prompted (you'll be asked for a token), or
270
+ - Pass `--reranker-token <token>` to `project-brain setup` for a non-interactive install, or
271
+ - Set the `TYPESAFE_API_KEY` environment variable (checked before the file either way).
272
+
273
+ With no token configured, nothing changes — zero network calls, identical result order. Any failure (timeout, non-2xx, a malformed response) falls back silently to the normal, unreranked order rather than surfacing an error. `project-brain health` reports `reranker: configured` once a token resolves.
260
274
 
261
275
  ## Recipes — get the most out of it
262
276
 
@@ -545,6 +559,7 @@ BRAIN_HTTP_TOKEN=your-secret project-brain serve --http [--port 3000]
545
559
  | `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) |
546
560
  | `OLLAMA_HOST` | `http://127.0.0.1:11434` | Ollama server URL |
547
561
  | `BRAIN_NO_UPDATE_CHECK` | — | Set to `1` to disable the update-available notice |
562
+ | `TYPESAFE_API_KEY` | — | Opt-in Jev reranker token — see [Reranking (optional)](#reranking-optional). Checked before `~/.project-brain/reranker.json`. |
548
563
 
549
564
  ## Tuning (environment variables)
550
565
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-brain",
3
- "version": "0.33.0",
3
+ "version": "0.34.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",
@@ -49,11 +49,11 @@
49
49
  "zod": "^4.4.3"
50
50
  },
51
51
  "optionalDependencies": {
52
- "project-brain-darwin-arm64": "0.33.0",
53
- "project-brain-linux-x64": "0.33.0",
54
- "project-brain-linux-arm64": "0.33.0",
55
- "project-brain-windows-x64": "0.33.0",
56
- "project-brain-windows-arm64": "0.33.0"
52
+ "project-brain-darwin-arm64": "0.34.0",
53
+ "project-brain-linux-x64": "0.34.0",
54
+ "project-brain-linux-arm64": "0.34.0",
55
+ "project-brain-windows-x64": "0.34.0",
56
+ "project-brain-windows-arm64": "0.34.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/bun": "latest",
@@ -4,11 +4,7 @@ This project is indexed with [project-brain](https://github.com/jcsoftdev/projec
4
4
 
5
5
  ## project-brain MCP
6
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.
7
+ You have access to the `project-brain` MCP server for codebase knowledge retrieval. Once connected, the server's own instructions describe the full tool catalog, routing (`search_context` for fuzzy/conceptual questions vs. the structural tools for exact symbols, callers, and change impact), and workflow — that copy always matches the tools actually registered, so it is not repeated here.
12
8
 
13
9
  ### Project Context
14
10
 
@@ -1,7 +1,3 @@
1
1
  ## project-brain MCP
2
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.
3
+ You have access to the `project-brain` MCP server for codebase knowledge retrieval. Once connected, the server's own instructions describe the full tool catalog, routing (`search_context` for fuzzy/conceptual questions vs. the structural tools — `find_symbol`/`find_callers`/`find_callees`/`impact` — for exact symbols, callers, and change impact), and workflow. That copy is generated from the same source as this file and always matches the tools actually registered, so it is not repeated here. Not seeing it? Reconnect or run `project-brain setup` again.