Skip to content

Commit 0e7f48b

Browse files
committed
no-mistakes(document): align static-model, engine-path and profile docs with code
1 parent 91cc406 commit 0e7f48b

5 files changed

Lines changed: 31 additions & 28 deletions

File tree

README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ The model is not bundled with any client — it needs a local model directory
117117
- Otherwise fetch the prebuilt one with `scripts/fetch-static-model.sh`, or
118118
distill your own from any sentence-transformer (Apache-2.0 Jina-Code by
119119
default) in ~30 s on CPU: `python scripts/distill_static_model.py`.
120-
- In VS Code set `codegraph.staticModelPath` to the model directory; in
121-
JetBrains use *Settings → Tools → CodeGraph → Embeddings → Static model
122-
directory*. Both IDE clients pass it to the server as
123-
`CODEGRAPH_STATIC_MODEL`.
120+
- A model in the default location needs no IDE setting: both IDE clients leave
121+
`CODEGRAPH_STATIC_MODEL` unset and let the engine resolve it. To use a model
122+
kept somewhere else, set `codegraph.staticModelPath` in VS Code, or
123+
*Settings → Tools → CodeGraph → Embeddings → Static model directory* in
124+
JetBrains; each client then passes that path as `CODEGRAPH_STATIC_MODEL`.
124125

125126
#### `CODEGRAPH_SKIP_MEMORY_CHECK` — force the embedding model past the RAM gate
126127

@@ -151,19 +152,10 @@ The full 42-tool surface is convenient but inflates the agent's prompt-context c
151152

152153
### VS Code settings
153154

154-
```jsonc
155-
{
156-
"codegraph.indexOnStartup": true,
157-
"codegraph.indexPaths": ["/path/to/project-a", "/path/to/project-b"],
158-
"codegraph.excludePatterns": ["**/cmake-build-debug/**", "**/generated/**"],
159-
"codegraph.embeddingModel": "bge-small", // or "static" for ~100× faster indexing
160-
"codegraph.staticModelPath": "", // required when embeddingModel is "static": the model2vec model dir
161-
"codegraph.maxFileSizeKB": 1024,
162-
"codegraph.codeLens.enabled": true, // caller / test / complexity counts above functions
163-
"codegraph.hover.enabled": true, // the same stats on hover
164-
"codegraph.debug": false
165-
}
166-
```
155+
The `codegraph.*` settings are documented once, next to the extension that
156+
reads them:
157+
158+
**[vscode/README.md — Configuration](vscode/README.md#configuration)**
167159

168160
Full-body embeddings are enabled by default. Function body text is captured at parse time with zero I/O overhead.
169161

mcp-package/README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ npx codegraph-mcp-fetch-engine # --force re-downloads an engine that is
2222
```
2323

2424
For air-gapped machines, or if you vendor the binary yourself, set
25-
`CODEGRAPH_SKIP_BINARY_FETCH=1` to skip the download and place the engine at
26-
`<package>/bin/codegraph-server-<platform>-<arch>` (`.exe` on Windows) yourself -
27-
that is the path `codegraph-mcp` launches.
25+
`CODEGRAPH_SKIP_BINARY_FETCH=1` to skip the download and supply the engine one
26+
of two ways:
27+
28+
- place it at `<package>/bin/codegraph-server-<platform>-<arch>` (`.exe` on
29+
Windows) - the path `codegraph-mcp` launches by default; or
30+
- point `CODEGRAPH_SERVER_PATH` at the engine wherever it already lives. This
31+
wins over the bundled path, and `codegraph-mcp` fails with a clear message
32+
rather than falling back if nothing is there.
2833

2934
## Usage
3035

@@ -62,13 +67,17 @@ Pass flags after `--`:
6267
}
6368
```
6469

70+
Leave the transport out of `args`: `codegraph-mcp` already puts the engine in
71+
MCP (stdio) mode, so `--mcp`, `--stdio` and `--connect` are dropped from
72+
whatever the client passes rather than forwarded twice.
73+
6574
| Flag | Default | Description |
6675
|------|---------|-------------|
6776
| `--workspace <path>` | current dir | Directories to index (repeatable) |
6877
| `--exclude <dir>` || Directories to skip (repeatable) |
69-
| `--embedding-model <model>` | `bge-small` | `bge-small`, `jina-code-v2`, `granite-97m` (32K, multilingual), or `static` (model2vec, ~100× faster indexing, ~90% of BGE quality; needs a local model dir via `CODEGRAPH_STATIC_MODEL`) |
78+
| `--embedding-model <model>` | `bge-small` | `bge-small`, `jina-code-v2`, `granite-97m` (32K, multilingual), or `static` (model2vec, ~100× faster indexing, ~90% of BGE quality; needs a local model dir - this install downloads one to `~/.codegraph/static_models/jina-code-static-256`, or point `CODEGRAPH_STATIC_MODEL` elsewhere) |
7079
| `--max-files <n>` | 5000 | Maximum files to index |
71-
| `--profile <name>` | `all` | Scope tool surface: `core` (8), `graph` (16), `memory` (14), `security` (pro), `all` (42) |
80+
| `--profile <name>` | `all` | Scope tool surface: `core` (8), `graph` (17), `memory` (14), `security` (pro), `all` (42) |
7281
| `--graph-only` | off | Skip embeddings — graph + structural tools only. No ONNX model load, 10-50× faster indexing. For CI / one-shot graph queries. |
7382
| `--run-tool <name>` || One-shot: index, run a single tool, print result, exit. No MCP handshake. Pair with `--tool-args '<json>'`. |
7483

scripts/fetch-static-model.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
#
1010
# The model is no longer staged into the VS Code extension bundle: the VSIX
1111
# excludes bin/** (see vscode/.vscodeignore), so a copy placed there would be
12-
# dropped at package time. IDE users point codegraph.staticModelPath at the
13-
# directory this script writes instead.
12+
# dropped at package time. The IDE clients leave CODEGRAPH_STATIC_MODEL unset
13+
# unless the user names a directory, so the default path this script writes is
14+
# what they pick up - no per-client setting needed.
1415
#
1516
# Usage: scripts/fetch-static-model.sh [DEST_DIR] [MODEL_NAME]
1617
# DEST_DIR default ~/.codegraph/static_models/<MODEL_NAME>

vscode/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ CodeGraph's Symbols and Memories views live in the CodeGraph activity-bar contai
6262
"codegraph.indexPaths": ["/path/to/project-a", "/path/to/project-b"],
6363
"codegraph.excludePatterns": ["**/cmake-build-debug/**", "**/generated/**"],
6464
"codegraph.embeddingModel": "bge-small", // or "static" for ~100× faster indexing
65-
"codegraph.staticModelPath": "", // required when embeddingModel is "static": the model2vec model dir
65+
"codegraph.staticModelPath": "", // only to override the default model2vec model dir
6666
"codegraph.maxFileSizeKB": 1024,
6767
"codegraph.codeLens.enabled": true, // caller / test / complexity counts above functions
6868
"codegraph.hover.enabled": true, // the same stats on hover
@@ -71,7 +71,8 @@ CodeGraph's Symbols and Memories views live in the CodeGraph activity-bar contai
7171
```
7272

7373
The static (model2vec) model is not bundled with the extension.
74-
Distill one with [`scripts/distill_static_model.py`](https://github.com/codegraph-ai/codegraph/blob/main/scripts/distill_static_model.py), or reuse the copy the `@astudioplus/codegraph-mcp` npm install puts in `~/.codegraph/static_models/jina-code-static-256`, and point `codegraph.staticModelPath` at it.
74+
The engine looks for it in `~/.codegraph/static_models/jina-code-static-256`, which is where the `@astudioplus/codegraph-mcp` npm install puts it, so a model in that location needs no setting at all.
75+
Set `codegraph.staticModelPath` only to point at a model somewhere else - for instance one you distilled yourself with [`scripts/distill_static_model.py`](https://github.com/codegraph-ai/codegraph/blob/main/scripts/distill_static_model.py).
7576

7677
Full-body embeddings are enabled by default. Function body text is captured at parse time with zero I/O overhead.
7778

vscode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,15 @@
304304
"enumDescriptions": [
305305
"BGE-Small-EN-v1.5 (384d) — fast, good quality with full-body embeddings. ~127MB download.",
306306
"Jina Code V2 (768d) — 6x slower indexing, no quality advantage with full-body embeddings. ~642MB download.",
307-
"Static (model2vec, 256d) — ~100x faster indexing, no ONNX runtime or 1.5GB RAM gate, ~90% of BGE quality in hybrid search. Requires a local model dir in codegraph.staticModelPath."
307+
"Static (model2vec, 256d) — ~100x faster indexing, no ONNX runtime or 1.5GB RAM gate, ~90% of BGE quality in hybrid search. Needs a local model dir: ~/.codegraph/static_models/jina-code-static-256 by default, or codegraph.staticModelPath."
308308
],
309309
"description": "Embedding model for semantic search and code similarity"
310310
},
311311
"codegraph.staticModelPath": {
312312
"type": "string",
313313
"default": "",
314314
"scope": "resource",
315-
"description": "Directory of the model2vec static model (config.json + tokenizer.json + model.safetensors). Required when embeddingModel is 'static' - the model is not bundled with the extension. Installing @astudioplus/codegraph-mcp from npm puts a copy in ~/.codegraph/static_models/jina-code-static-256, or distill one with scripts/distill_static_model.py."
315+
"description": "Directory of the model2vec static model (config.json + tokenizer.json + model.safetensors). Only set this to use a model outside the default location: left empty, the engine resolves ~/.codegraph/static_models/jina-code-static-256, which is where installing @astudioplus/codegraph-mcp from npm puts it. The model is not bundled with the extension - distill one with scripts/distill_static_model.py if you have neither."
316316
},
317317
"codegraph.fullBodyEmbedding": {
318318
"type": "boolean",

0 commit comments

Comments
 (0)