@zokizuan/satori-mcp 4.11.17 → 6.2.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 +34 -190
- package/{LICENSE → assets/potion/linux-x64/MODEL2VEC_RS_LICENSE} +1 -1
- package/assets/potion/linux-x64/MODEL_CARD.md +110 -0
- package/assets/potion/linux-x64/manifest.json +61 -0
- package/assets/potion/linux-x64/model/config.json +4 -0
- package/assets/potion/linux-x64/model/model.safetensors +0 -0
- package/assets/potion/linux-x64/model/tokenizer.json +1 -0
- package/assets/potion/linux-x64/satori-potion +0 -0
- package/dist/config.d.ts +68 -7
- package/dist/config.js +301 -9
- package/dist/core/backend-diagnostics.d.ts +17 -0
- package/dist/core/backend-diagnostics.js +44 -0
- package/dist/core/bounded-source-selector.d.ts +73 -0
- package/dist/core/bounded-source-selector.js +443 -0
- package/dist/core/call-graph.d.ts +6 -16
- package/dist/core/call-graph.js +83 -161
- package/dist/core/canonical-json.d.ts +2 -0
- package/dist/core/canonical-json.js +23 -0
- package/dist/core/canonical-symbol-identity.d.ts +9 -0
- package/dist/core/canonical-symbol-identity.js +54 -0
- package/dist/core/capabilities.js +8 -6
- package/dist/core/completion-proof.d.ts +33 -11
- package/dist/core/completion-proof.js +270 -39
- package/dist/core/current-source-symbols.d.ts +71 -4
- package/dist/core/current-source-symbols.js +199 -84
- package/dist/core/embedding-provider-diagnostics.d.ts +17 -0
- package/dist/core/embedding-provider-diagnostics.js +80 -0
- package/dist/core/handlers.d.ts +110 -17
- package/dist/core/handlers.js +1381 -186
- package/dist/core/indexing-recovery.js +14 -36
- package/dist/core/inspectable-source.d.ts +55 -0
- package/dist/core/inspectable-source.js +215 -0
- package/dist/core/manage-indexing-handlers.d.ts +8 -6
- package/dist/core/manage-indexing-handlers.js +602 -94
- package/dist/core/manage-maintenance-handlers.d.ts +6 -3
- package/dist/core/manage-maintenance-handlers.js +179 -21
- package/dist/core/manage-types.d.ts +14 -1
- package/dist/core/manage-types.js +6 -0
- package/dist/core/mutation-lease.d.ts +10 -0
- package/dist/core/mutation-lease.js +22 -0
- package/dist/core/navigation-handlers.d.ts +13 -7
- package/dist/core/navigation-handlers.js +20 -40
- package/dist/core/prepared-read-cache.d.ts +28 -0
- package/dist/core/prepared-read-cache.js +96 -0
- package/dist/core/prepared-relationship-traversal.d.ts +23 -0
- package/dist/core/prepared-relationship-traversal.js +158 -0
- package/dist/core/python-call-fallback.d.ts +1 -1
- package/dist/core/python-call-fallback.js +128 -8
- package/dist/core/registry-file-outline.js +7 -12
- package/dist/core/relationship-backed-call-graph.d.ts +6 -10
- package/dist/core/relationship-backed-call-graph.js +89 -49
- package/dist/core/relationship-continuation.d.ts +49 -0
- package/dist/core/relationship-continuation.js +167 -0
- package/dist/core/relationship-evidence.d.ts +93 -0
- package/dist/core/relationship-evidence.js +104 -0
- package/dist/core/runtime-owner.d.ts +3 -0
- package/dist/core/runtime-owner.js +8 -0
- package/dist/core/search/exact-registry.d.ts +1 -1
- package/dist/core/search-candidate-survival.d.ts +37 -0
- package/dist/core/search-candidate-survival.js +216 -0
- package/dist/core/search-constants.d.ts +11 -0
- package/dist/core/search-constants.js +11 -0
- package/dist/core/search-disclosure.d.ts +18 -0
- package/dist/core/search-disclosure.js +123 -0
- package/dist/core/search-exact-fast-path.d.ts +9 -4
- package/dist/core/search-exact-fast-path.js +262 -70
- package/dist/core/search-exact-registry-hit.d.ts +12 -24
- package/dist/core/search-exact-registry-hit.js +37 -50
- package/dist/core/search-execution.d.ts +54 -6
- package/dist/core/search-execution.js +575 -147
- package/dist/core/search-frontdoor.d.ts +11 -3
- package/dist/core/search-frontdoor.js +93 -31
- package/dist/core/search-group-ordering.js +18 -15
- package/dist/core/search-group-results.d.ts +38 -28
- package/dist/core/search-group-results.js +283 -181
- package/dist/core/search-grouping.d.ts +4 -0
- package/dist/core/search-grouping.js +33 -6
- package/dist/core/search-lexical-scoring.d.ts +18 -0
- package/dist/core/search-navigation.d.ts +1 -4
- package/dist/core/search-navigation.js +4 -126
- package/dist/core/search-owner-resolution.d.ts +4 -0
- package/dist/core/search-owner-resolution.js +108 -35
- package/dist/core/search-policy.d.ts +19 -0
- package/dist/core/search-policy.js +28 -0
- package/dist/core/search-query-planning.d.ts +3 -1
- package/dist/core/search-query-planning.js +199 -18
- package/dist/core/search-query-support.d.ts +5 -5
- package/dist/core/search-query-support.js +134 -44
- package/dist/core/search-ranking-policy.js +11 -0
- package/dist/core/search-rerank-policy.d.ts +32 -0
- package/dist/core/search-rerank-policy.js +96 -0
- package/dist/core/search-response-envelopes.d.ts +6 -5
- package/dist/core/search-response-envelopes.js +123 -14
- package/dist/core/search-response-helpers.d.ts +17 -35
- package/dist/core/search-response-helpers.js +193 -153
- package/dist/core/search-result-finalization.d.ts +18 -4
- package/dist/core/search-result-finalization.js +302 -111
- package/dist/core/search-result-set-cache.d.ts +89 -0
- package/dist/core/search-result-set-cache.js +163 -0
- package/dist/core/search-types.d.ts +258 -149
- package/dist/core/search-types.js +1 -1
- package/dist/core/snapshot.d.ts +18 -2
- package/dist/core/snapshot.js +246 -57
- package/dist/core/source-continuation-fingerprint.d.ts +49 -0
- package/dist/core/source-continuation-fingerprint.js +117 -0
- package/dist/core/symbol-context-composer.d.ts +180 -0
- package/dist/core/symbol-context-composer.js +902 -0
- package/dist/core/symbol-context-public-contract.d.ts +788 -0
- package/dist/core/symbol-context-public-contract.js +276 -0
- package/dist/core/sync.d.ts +49 -2
- package/dist/core/sync.js +455 -35
- package/dist/core/tool-response-builders.d.ts +8 -0
- package/dist/core/tool-response-builders.js +32 -0
- package/dist/core/tracked-root-readiness.d.ts +15 -1
- package/dist/core/tracked-root-readiness.js +70 -10
- package/dist/core/vector-backend-maintenance.js +44 -13
- package/dist/core/warnings.d.ts +4 -0
- package/dist/core/warnings.js +4 -0
- package/dist/embedding.d.ts +3 -3
- package/dist/embedding.js +20 -3
- package/dist/server/provider-runtime.d.ts +21 -2
- package/dist/server/provider-runtime.js +214 -89
- package/dist/server/start-server.d.ts +10 -8
- package/dist/server/start-server.js +26 -16
- package/dist/telemetry/search.d.ts +14 -1
- package/dist/test-state-root.d.ts +2 -0
- package/dist/test-state-root.js +9 -0
- package/dist/tools/call_graph.d.ts +22 -0
- package/dist/tools/call_graph.js +5 -5
- package/dist/tools/continue_search.d.ts +3 -0
- package/dist/tools/continue_search.js +39 -0
- package/dist/tools/list_codebases.js +38 -8
- package/dist/tools/manage_index.js +54 -8
- package/dist/tools/read_file.d.ts +471 -0
- package/dist/tools/read_file.js +283 -133
- package/dist/tools/registry.js +2 -0
- package/dist/tools/search_codebase.js +142 -12
- package/dist/tools/setup-errors.js +3 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,59 +1,29 @@
|
|
|
1
1
|
# @zokizuan/satori-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The MCP server for [Satori](https://github.com/ham-zax/satori): freshness-aware hybrid code search, symbol navigation, advisory call graphs, bounded source reads, and index lifecycle management.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Most users should install Satori through `@zokizuan/satori-cli`. The installer writes a stable local launcher and configures supported MCP clients; this package does not manage client configuration by itself.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx -y @zokizuan/satori-cli@latest install --client all
|
|
10
|
+
npx -y @zokizuan/satori-cli@latest install --client all --runtime offline
|
|
11
11
|
npx -y @zokizuan/satori-cli@latest doctor
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
The
|
|
14
|
+
The local Potion runtime currently supports Linux x64, including Windows through WSL2. Connected Voyage and explicit local Ollama configurations are also available. See the [main README](https://github.com/ham-zax/satori#quick-start) for runtime choices.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Direct package execution is intended for inspection and custom harnesses:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
npx -y @zokizuan/satori-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Profiles control indexing breadth, not search scope. `default` is safe-broad, `minimal` indexes source plus docs/text, and `all-text` indexes additional UTF-8 text files under the size limit. `search_codebase` still defaults to `scope=runtime`.
|
|
23
|
-
|
|
24
|
-
The repo-local config shape is:
|
|
25
|
-
|
|
26
|
-
```toml
|
|
27
|
-
[index]
|
|
28
|
-
profile = "minimal"
|
|
19
|
+
npx -y @zokizuan/satori-mcp@latest --help
|
|
29
20
|
```
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Profile behavior:
|
|
34
|
-
|
|
35
|
-
- `default`: source, docs/text, config, scripts, infra/query files, and known extensionless files such as `Dockerfile`, `Makefile`, `Justfile`, `Taskfile`, `Procfile`, `Jenkinsfile`, and `.dockerignore`.
|
|
36
|
-
- `minimal`: source plus docs/text only.
|
|
37
|
-
- `all-text`: default plus unknown UTF-8 text files under the size limit. `SATORI_ALL_TEXT_MAX_BYTES` can override the text-file cap.
|
|
38
|
-
|
|
39
|
-
All profiles still honor `.gitignore`, `.satoriignore`, and the hard denylist for secrets, lockfiles, generated output, dependency folders, binaries, bundles, logs, database dumps, source maps, and snapshots. `satori.toml` is treated as an index-policy control file; search freshness and `manage_index action="sync"` can reconcile ordinary profile/ignore changes, while incompatible fingerprints still return `requires_reindex`.
|
|
40
|
-
|
|
41
|
-
Codex installs write two companion artifacts by default: the first-party `satori` skill under `~/.codex/skills` and a marked Satori guidance block in `~/.codex/AGENTS.md`. The AGENTS block tells Codex to use Satori for semantic ownership/context discovery first, then use exact navigation and reads for proof.
|
|
22
|
+
Do not use `npx` as the resident MCP command when the CLI installer supports your client; package resolution can exceed normal MCP startup timeouts.
|
|
42
23
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Advanced direct execution is available through the package bin:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npx -y @zokizuan/satori-mcp@4.11.17 --help
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Use direct package execution for inspection, smoke tests, or unsupported harnesses. For supported clients, prefer `satori-cli install` so startup does not depend on package-manager resolution.
|
|
52
|
-
|
|
53
|
-
## Agent Workflow
|
|
24
|
+
## Workflow
|
|
54
25
|
|
|
55
26
|
```text
|
|
56
|
-
list_codebases
|
|
57
27
|
manage_index action="create" path="/absolute/path/to/repo"
|
|
58
28
|
search_codebase path="/absolute/path/to/repo" query="where is auth refresh handled"
|
|
59
29
|
file_outline path="/absolute/path/to/repo" file="src/auth.ts"
|
|
@@ -61,173 +31,47 @@ call_graph path="/absolute/path/to/repo" symbolRef={...} direction="both"
|
|
|
61
31
|
read_file path="/absolute/path/to/repo/src/auth.ts" start_line=1 end_line=160
|
|
62
32
|
```
|
|
63
33
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- Public paths for tools are **absolute filesystem paths**. Relative paths are rejected (not CWD-resolved).
|
|
67
|
-
- `search_codebase` starts with `scope=runtime`, `resultMode=grouped`, `groupBy=symbol`, `rankingMode=auto_changed_first`.
|
|
68
|
-
- `search_codebase` is the sync-on-read freshness tool; other tools may gate compatibility but do not replace it.
|
|
69
|
-
- Grouped search is symbol-owned: chunks are supporting evidence for an owner symbol, not the final navigation unit.
|
|
70
|
-
- Exact symbol navigation uses `symbolInstanceId`. `symbolKey` is stable-ish candidate lookup only, not exact identity.
|
|
71
|
-
- Ready/`indexed` means searchable-readable, not automatically symbol-rich. Check `manage_index status` `symbolQuality` or Ready-line `symbolQuality=…` before treating outline/graph as rich navigation evidence (`symbol_rich` \| `mixed` \| `symbol_sparse` \| `search_only` \| `unknown` — observed registry evidence, not a parser diagnosis).
|
|
72
|
-
- Index profiles still honor `.satoriignore`, `.gitignore`, `satori.toml`, and the hard denylist for secrets, lockfiles, generated output, dependencies, binaries, bundles, logs, and database dumps.
|
|
73
|
-
- `read_file` only reads under tracked searchable roots (`indexed` / `sync_completed`); it is not a general host filesystem reader. Relative paths and root escapes are denied.
|
|
74
|
-
- Prefer `recommendedNextAction` when present; if `callGraphHint.supported=false`, follow `navigationFallback` args rather than inventing spans.
|
|
75
|
-
- `requires_reindex` means reindex first, then retry the original call (do not substitute `sync`).
|
|
76
|
-
- `manage_index action="clear"` is destructive and should be explicit. `repair` reports structured proof across collection, snapshot, marker, fingerprint, payload, stale remote chunks, and navigation. Only no related collection routes to create; existing incompatible, incomplete, stale, malformed, or unprovable generations route to reindex. Backend failures preserve partial proof when available and should be diagnosed before retrying repair. Successful repair may write a fresh completion marker and rebuild navigation, but never re-embeds or rewrites source chunks.
|
|
77
|
-
- After changing `EMBEDDING_PROVIDER`, `EMBEDDING_MODEL`, embedding dimension, `HYBRID_MODE`, vector backend settings, or the Satori runtime version, restart **all** Satori MCP clients before running `manage_index create`, `reindex`, `sync`, `clear`, or `repair`.
|
|
78
|
-
- Satori records live runtime owners in `~/.satori/runtime/owners.json` and blocks those index mutations with `status="blocked"` / `reason="runtime_owner_conflict"` if another live Satori MCP runtime has a different fingerprint, package version, or config identity.
|
|
79
|
-
- On `runtime_owner_conflict`, the manage envelope lists conflicting **pids**, **versions**, and conflict reasons, plus a concrete `hints.nextStep`. MCP tools never kill other processes. Stop the listed host clients (or only orphaned Satori MCP node PIDs), leave a single package version/config running, then retry. `manage_index status` and `list_codebases` also show a compact **Runtime owners** line (live pids/versions); multi-version means mutations may block. `satori-cli doctor` reports multi-version live owners.
|
|
80
|
-
- A separate canonical-root mutation lease permits multiple readers but only one create/reindex/sync/repair/clear writer across processes. Contention returns `reason="mutation_in_progress"`; `manage_index status` exposes `hints.activeMutation`. Leases do not have a time-based expiry, and a live owner is never evicted by age alone.
|
|
81
|
-
- `zillizDropCollection` is fail-closed: Satori must prove the selected collection's owning codebase root and lease both affected roots before deletion. Unknown ownership or an active writer leaves the collection and local snapshot unchanged.
|
|
82
|
-
- Grouped `search_codebase` results with supported call graph attach **`inboundRecovery`**: a ready-to-run `must:` search to verify callers before blast-radius edits (`call_graph` inbound stays advisory/low).
|
|
83
|
-
|
|
84
|
-
## Navigation Sidecars
|
|
85
|
-
|
|
86
|
-
Completed full indexes write a derived symbol registry and relationship sidecar. Files remain the source of truth; the registry is the deterministic navigation view for the indexed snapshot.
|
|
87
|
-
|
|
88
|
-
- The symbol registry stores candidate owner keys, exact symbol instances, file-owner fallback symbols, and outline records used by grouped search, `file_outline`, and exact reads.
|
|
89
|
-
- The relationship sidecar stores conservative `CALLS v0` edges plus TypeScript/JavaScript `IMPORTS`/`EXPORTS v0` edges with manifest compatibility gates.
|
|
90
|
-
- Runtime navigation still serves canonical JSON sidecars by default. When the default shared runtime store is created at process startup, `SATORI_NAVIGATION_BACKEND=sqlite` can opt that shared store into SQLite-backed reads only after SQLite proves parity with the canonical JSON symbol registry and relationship sidecars. If canonical JSON is missing or incompatible, SQLite is not served as truth; if SQLite is missing, stale, incompatible, or parity-mismatched while JSON is compatible, runtime falls back to JSON with a warning. When the default shared runtime store is created with `SATORI_NAVIGATION_DUAL_READ=1`, JSON remains the serving backend and the runtime emits once-per-root parity mismatch warnings without changing the served result.
|
|
91
|
-
- `CALLS v0` is heuristic/name-based. Same-file unique targets can be high confidence; cross-file name-only targets start low and are upgraded when IMPORTS/EXPORTS evidence supports them, or when the imported file has a unique same-name target (class methods without top-level EXPORTS). Generic names like `push`/`get` stay suppressed without EXPORTS. Ambiguous same-name targets are skipped.
|
|
92
|
-
- `IMPORTS`/`EXPORTS v0` records only resolvable relative module edges and unambiguous local export declarations. Package imports, unresolved paths, ambiguous exports, and multiline module syntax are skipped.
|
|
93
|
-
- `call_graph` uses compatible relationship sidecars as the canonical source for symbol-owned traversal.
|
|
94
|
-
- Successful incremental sync reuses changed-file symbol output, preserves unchanged registry state, and recomputes relationships against the merged registry without re-splitting unchanged files. If changed-file indexing stops early, navigation state is cleared instead of publishing a mixed generation.
|
|
95
|
-
|
|
96
|
-
## Runtime Requirements
|
|
97
|
-
|
|
98
|
-
Configure an embedding provider and Milvus-compatible backend before indexing. Supported embedding providers are OpenAI, VoyageAI, Gemini, and Ollama. Changing provider, model, dimension, vector store, or schema requires a reindex because those values are part of the index fingerprint.
|
|
99
|
-
|
|
100
|
-
MCP startup, `tools/list`, and installer operations are lazy with respect to provider credentials. Missing provider values become `MISSING_PROVIDER_CONFIG` only when a provider-backed tool call needs them.
|
|
101
|
-
|
|
102
|
-
Installer-managed client config starts the resident launcher. Runtime provider settings come from the MCP client's environment and are exposed in native client config:
|
|
103
|
-
|
|
104
|
-
- Codex writes active `env_vars` forwarding plus an optional commented `[mcp_servers.satori.env]` template in `~/.codex/config.toml`.
|
|
105
|
-
- Claude Code writes `mcpServers.satori.env` in `~/.claude.json` with `${VAR:-}` pass-through values.
|
|
106
|
-
- OpenCode writes `mcp.satori.environment` in `~/.config/opencode/opencode.json` with `{env:VAR}` pass-through values.
|
|
107
|
-
|
|
108
|
-
Users who want literal values in a client config can replace the generated pass-through value for that client. In Codex, uncomment or add this table outside the installer-managed launcher block so reinstalls keep edits:
|
|
109
|
-
|
|
110
|
-
```toml
|
|
111
|
-
[mcp_servers.satori.env]
|
|
112
|
-
EMBEDDING_PROVIDER = "VoyageAI"
|
|
113
|
-
EMBEDDING_MODEL = "voyage-code-3"
|
|
114
|
-
EMBEDDING_OUTPUT_DIMENSION = "1024"
|
|
115
|
-
VOYAGEAI_API_KEY = "pa-..."
|
|
116
|
-
VOYAGEAI_RERANKER_MODEL = "rerank-2.5"
|
|
117
|
-
MILVUS_ADDRESS = "https://your-zilliz-endpoint"
|
|
118
|
-
MILVUS_TOKEN = "your-zilliz-token"
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
Cloud-quality setup:
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
EMBEDDING_PROVIDER=VoyageAI
|
|
125
|
-
EMBEDDING_MODEL=voyage-code-3
|
|
126
|
-
EMBEDDING_OUTPUT_DIMENSION=1024
|
|
127
|
-
VOYAGEAI_API_KEY=your-api-key
|
|
128
|
-
VOYAGEAI_RERANKER_MODEL=rerank-2.5
|
|
129
|
-
MILVUS_ADDRESS=your-milvus-endpoint
|
|
130
|
-
MILVUS_TOKEN=your-milvus-token
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
The full generated tool reference below is kept in the npm README for MCP clients and package consumers.
|
|
134
|
-
|
|
135
|
-
<!-- TOOLS_START -->
|
|
136
|
-
|
|
137
|
-
## Tool Reference
|
|
138
|
-
|
|
139
|
-
### `manage_index`
|
|
140
|
-
|
|
141
|
-
Manage index lifecycle operations (create/reindex/sync/status/clear/repair) for a codebase path. repair rebuilds local readiness only when existing vector payload and trusted runtime fingerprint proof match. Repair responses may include optional `repairProof` evidence for collection, snapshot, marker, fingerprint, payload, staleRemoteChunks, and navigation. No related collection routes to create; an existing incompatible, incomplete, stale, malformed, or unprovable generation routes to reindex; backend failures preserve partial proof when collection began and should be diagnosed before retrying repair. Successful repair may write a fresh completion marker and rebuild navigation, but it does not re-embed or rewrite source chunks. Ignore-rule edits in repo-root .satoriignore/.gitignore reconcile automatically in the normal sync path. Use action="sync" for immediate convergence and action="reindex" for full rebuild recovery (preflight may block unnecessary ignore-only reindex churn unless allowUnnecessaryReindex=true). Successful sync responses include `syncStats` with `added`, `removed`, and `modified` counts; consume those fields instead of parsing `humanText`. create/reindex return the kickoff response immediately and do not poll to terminal state; use action="status" to observe progress. Status may include `languageCapabilities`, which combines declared claims with compatible symbol-registry and relationship-sidecar evidence for indexed languages. Mutation responses may include a durable `operation` receipt with `id`, canonical root, generation, accepted time, current phase, last durable transition, runtime fingerprint, and writer identity. Status returns the latest persisted receipt after restart. In a status envelope, top-level `action` remains `status` while `operation.action` names the observed mutation. Terminal phases are `completed`, `failed`, and `blocked`; `operation` is absent when no durable operation exists or contention was rejected before lease acquisition.
|
|
142
|
-
|
|
143
|
-
| Parameter | Type | Required | Default | Description |
|
|
144
|
-
|---|---|---|---|---|
|
|
145
|
-
| `action` | enum("create", "reindex", "sync", "status", "clear", "repair") | yes | | Required operation to run. |
|
|
146
|
-
| `path` | string | yes | | ABSOLUTE filesystem path to the target codebase (relative paths are rejected). |
|
|
147
|
-
| `force` | boolean | no | | Only for action='create'. Force rebuild from scratch. |
|
|
148
|
-
| `allowUnnecessaryReindex` | boolean | no | | Only for action='reindex'. Override preflight block when reindex is detected as unnecessary ignore-only churn. |
|
|
149
|
-
| `customExtensions` | array<string> | no | | Only for action='create'. Additional file extensions to include. |
|
|
150
|
-
| `ignorePatterns` | array<string> | no | | Only for action='create'. Additional ignore patterns to apply. |
|
|
151
|
-
| `zillizDropCollection` | string | no | | Only for action='create'. Zilliz-only: drop this Satori-managed collection before creating the new index. |
|
|
152
|
-
|
|
153
|
-
### `search_codebase`
|
|
34
|
+
Public paths are absolute. Search is freshness-aware; exact reads are limited to indexed searchable roots. Follow `recommendedNextAction` when returned, and reindex before retrying a request that reports `requires_reindex`.
|
|
154
35
|
|
|
155
|
-
|
|
36
|
+
## Measured Performance
|
|
156
37
|
|
|
157
|
-
|
|
158
|
-
|---|---|---|---|---|
|
|
159
|
-
| `path` | string | yes | | ABSOLUTE filesystem path to an indexed codebase or subdirectory (relative paths are rejected). |
|
|
160
|
-
| `query` | string | yes | | Natural-language query. |
|
|
161
|
-
| `scope` | enum("runtime", "mixed", "docs") | no | `"runtime"` | Search scope policy. runtime includes source/runtime code and tests while excluding docs/generated/artifacts/landing/fixtures; docs returns documentation paths only (not tests); mixed includes all. Docs scope skips reranker by policy in the current tool surface. |
|
|
162
|
-
| `resultMode` | enum("grouped", "raw") | no | `"grouped"` | Output mode. grouped returns merged search groups, raw returns chunk hits. |
|
|
163
|
-
| `groupBy` | enum("symbol", "file") | no | `"symbol"` | Grouping strategy in grouped mode. |
|
|
164
|
-
| `rankingMode` | enum("default", "auto_changed_first") | no | `"auto_changed_first"` | Ranking policy. auto_changed_first boosts files changed in the current git working tree when available. |
|
|
165
|
-
| `limit` | integer | no | `50` | Maximum groups (grouped mode) or chunks (raw mode). |
|
|
166
|
-
| `debug` | boolean | no | `false` | Optional debug payload toggle for score and fusion breakdowns. |
|
|
38
|
+
A checksum-sealed Potion/LanceDB run on Satori published 488 files and 10,830 chunks in 34.46 seconds on CPU. The later representative delta run measured 154.543 ms warm-search p95, 185.662 ms zero-change synchronization p95, and 789–865 ms p95 for one-file add/edit/delete operations.
|
|
167
39
|
|
|
168
|
-
|
|
40
|
+
On 30 frozen positive retrieval tasks, Potion placed the required owner in the top five on 23 tasks versus Voyage on 25. Potion's observed median search latency was 94.64 ms versus 1,009.46 ms for Voyage in that paired run, but the provider latency observations were descriptive and Potion showed weaker Java and configuration/runtime retrieval.
|
|
169
41
|
|
|
170
|
-
|
|
42
|
+
In a fresh two-task OpenCode comparison where both arms answered correctly, Satori used 16 tool calls and returned 76,113 tool-output bytes versus 25 calls and 96,801 bytes for native `grep` / `glob` / `read`. Wall time was 51.65 versus 96.04 seconds; total model tokens were effectively unchanged. This is a small exploratory context-route result, not a universal token-reduction claim.
|
|
171
43
|
|
|
172
|
-
|
|
173
|
-
|---|---|---|---|---|
|
|
174
|
-
| `path` | string | yes | | ABSOLUTE filesystem path to the indexed codebase root or subdirectory (relative paths are rejected). |
|
|
175
|
-
| `symbolRef` | object | yes | | Symbol reference from a grouped search result callGraphHint. |
|
|
176
|
-
| `direction` | enum("callers", "callees", "both") | no | `"both"` | Traversal direction from the starting symbol. |
|
|
177
|
-
| `depth` | integer | no | `1` | Traversal depth (max 3). |
|
|
178
|
-
| `limit` | integer | no | `20` | Maximum number of returned edges. |
|
|
179
|
-
|
|
180
|
-
### `file_outline`
|
|
181
|
-
|
|
182
|
-
Return a sidecar-backed symbol outline for one file, including call_graph jump handles.
|
|
183
|
-
|
|
184
|
-
| Parameter | Type | Required | Default | Description |
|
|
185
|
-
|---|---|---|---|---|
|
|
186
|
-
| `path` | string | yes | | ABSOLUTE filesystem path to the indexed codebase root (relative paths are rejected). |
|
|
187
|
-
| `file` | string | yes | | Repo-relative file path inside the codebase root (not absolute; resolved only against that root). |
|
|
188
|
-
| `start_line` | integer | no | | Optional start line filter (1-based, inclusive). |
|
|
189
|
-
| `end_line` | integer | no | | Optional end line filter (1-based, inclusive). |
|
|
190
|
-
| `limitSymbols` | integer | no | `500` | Maximum number of returned symbols after line filtering. |
|
|
191
|
-
| `resolveMode` | enum("outline", "exact") | no | `"outline"` | Outline mode returns all symbols (windowed/limited). Exact mode resolves deterministic symbol matches in this file. |
|
|
192
|
-
| `symbolIdExact` | string | no | | Used with resolveMode="exact": exact symbol identifier match in the target file. On symbol-owned flows, pass the symbol's symbolInstanceId. |
|
|
193
|
-
| `symbolLabelExact` | string | no | | Used with resolveMode="exact": exact symbol label match in the target file. |
|
|
194
|
-
|
|
195
|
-
### `read_file`
|
|
196
|
-
|
|
197
|
-
Read file content under an indexed/searchable Satori codebase root only (not a general host filesystem reader). Requires an absolute path whose canonical real path is inside a tracked root with status indexed or sync_completed. Supports optional 1-based inclusive line ranges and safe truncation.
|
|
198
|
-
|
|
199
|
-
| Parameter | Type | Required | Default | Description |
|
|
200
|
-
|---|---|---|---|---|
|
|
201
|
-
| `path` | string | yes | | ABSOLUTE path to the file under an indexed/searchable codebase root (relative paths are rejected). |
|
|
202
|
-
| `start_line` | integer | no | | Optional start line (1-based, inclusive). |
|
|
203
|
-
| `end_line` | integer | no | | Optional end line (1-based, inclusive). |
|
|
204
|
-
| `mode` | enum("plain", "annotated") | no | `"plain"` | Output mode. plain returns text only; annotated returns content plus sidecar-backed outline metadata. |
|
|
205
|
-
| `open_symbol` | object | no | | Optional deterministic symbol jump request for this file path. Uses exact symbol resolution within `path` when symbolId/symbolLabel is provided, and only uses direct span opens when no symbol identity fields are supplied. On symbol-owned flows, symbolId should carry the symbolInstanceId. |
|
|
206
|
-
|
|
207
|
-
### `list_codebases`
|
|
208
|
-
|
|
209
|
-
List tracked codebases and their indexing state.
|
|
44
|
+
<!-- TOOLS_START -->
|
|
210
45
|
|
|
211
|
-
|
|
46
|
+
## Tools
|
|
212
47
|
|
|
48
|
+
| Tool | Purpose |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `manage_index` | Create, synchronize, inspect, repair, reindex, or clear a repository index. Use status and repair guidance instead of guessing whether an index is ready. |
|
|
51
|
+
| `search_codebase` | Run freshness-aware hybrid search and return symbol-owned evidence. Start here for behavior, ownership, configuration, or path discovery. |
|
|
52
|
+
| `continue_search` | Reveal more of one frozen result set without rerunning retrieval. Use it when the initial disclosure is relevant but incomplete. |
|
|
53
|
+
| `call_graph` | Inspect advisory callers, callees, imports, and exports when supported. Verify inbound leads before blast-radius changes. |
|
|
54
|
+
| `file_outline` | List the indexed symbols and spans in one file. Use it to choose an exact owner before reading implementation. |
|
|
55
|
+
| `read_file` | Read a bounded source span or one exact indexed symbol. Large ranges are compacted so agent UIs receive structure instead of implementation floods. |
|
|
56
|
+
| `list_codebases` | List known indexed repositories, readiness, and runtime-owner state. Use it to discover existing publications before creating another one. |
|
|
213
57
|
|
|
214
58
|
<!-- TOOLS_END -->
|
|
215
59
|
|
|
216
|
-
##
|
|
60
|
+
## Runtime Boundaries
|
|
217
61
|
|
|
218
|
-
-
|
|
219
|
-
- `
|
|
220
|
-
-
|
|
221
|
-
-
|
|
62
|
+
- The server does not edit repository source.
|
|
63
|
+
- `read_file` is not a general host-filesystem reader.
|
|
64
|
+
- Inbound call-graph evidence is advisory and should be verified before blast-radius edits.
|
|
65
|
+
- Provider, model, dimensions, projection, and vector backend are persisted compatibility identities; changing them requires a reindex.
|
|
66
|
+
- Multiple incompatible live Satori runtimes are blocked from mutating the same publication.
|
|
67
|
+
- Offline neural reranking is not shipped today. The candidate boundary permits a future complete-set local scorer to fail back atomically to exact + BM25 + single-vector ordering.
|
|
222
68
|
|
|
223
|
-
##
|
|
69
|
+
## Development
|
|
224
70
|
|
|
225
71
|
```bash
|
|
226
|
-
pnpm --filter @zokizuan/satori-mcp start
|
|
227
72
|
pnpm --filter @zokizuan/satori-mcp build
|
|
228
|
-
pnpm --filter @zokizuan/satori-mcp typecheck
|
|
229
73
|
pnpm --filter @zokizuan/satori-mcp test
|
|
230
74
|
pnpm --filter @zokizuan/satori-mcp docs:check
|
|
231
75
|
```
|
|
232
76
|
|
|
233
|
-
|
|
77
|
+
Node.js 22.13 or newer is required. Satori is MIT licensed.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
language:
|
|
3
|
+
- code
|
|
4
|
+
license: mit
|
|
5
|
+
library_name: model2vec
|
|
6
|
+
tags:
|
|
7
|
+
- model2vec
|
|
8
|
+
- embeddings
|
|
9
|
+
- code
|
|
10
|
+
- retrieval
|
|
11
|
+
- static-embeddings
|
|
12
|
+
datasets:
|
|
13
|
+
- minishlab/tokenlearn-cornstack-queries-coderankembed
|
|
14
|
+
- minishlab/tokenlearn-cornstack-docs-coderankembed
|
|
15
|
+
- nomic-ai/cornstack-python-v1
|
|
16
|
+
- nomic-ai/cornstack-java-v1
|
|
17
|
+
- nomic-ai/cornstack-php-v1
|
|
18
|
+
- nomic-ai/cornstack-go-v1
|
|
19
|
+
- nomic-ai/cornstack-javascript-v1
|
|
20
|
+
- nomic-ai/cornstack-ruby-v1
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# potion-code-16M-v2 Model Card
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
**potion-code-16M-v2** is a fast static code embedding model optimized for code retrieval tasks. It powers [Semble](https://github.com/MinishLab/semble), a code search library for agents. It is distilled from [nomic-ai/CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed) and trained on the [CornStack](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1) code corpus using [Tokenlearn](https://github.com/MinishLab/tokenlearn) and contrastive fine-tuning.
|
|
28
|
+
It is the successor to [potion-code-16M](https://huggingface.co/minishlab/potion-code-16M).
|
|
29
|
+
It uses static embeddings, allowing text and code embeddings to be computed orders of magnitude faster than transformer-based models on both GPU and CPU.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install model2vec
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from model2vec import StaticModel
|
|
41
|
+
|
|
42
|
+
model = StaticModel.from_pretrained("minishlab/potion-code-16M-v2")
|
|
43
|
+
|
|
44
|
+
# Embed natural language queries
|
|
45
|
+
query_embeddings = model.encode(["How to read a file in Python?"])
|
|
46
|
+
|
|
47
|
+
# Embed code documents
|
|
48
|
+
code_embeddings = model.encode(["def read_file(path):\n with open(path) as f:\n return f.read()"])
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## How it works
|
|
52
|
+
|
|
53
|
+
potion-code-16M-v2 is created using the following pipeline:
|
|
54
|
+
|
|
55
|
+
1. **Vocabulary mining**: code-specific tokens are mined from CornStack and added to the base CodeRankEmbed tokenizer (43k extra tokens → ~63.5k total)
|
|
56
|
+
2. **Distillation**: the extended vocabulary is distilled from CodeRankEmbed using Model2Vec (256-dimensional embeddings, PCA)
|
|
57
|
+
3. **Tokenlearn**: the distilled model is fine-tuned on 1.2 million (query, document) pairs from CornStack using cosine similarity loss
|
|
58
|
+
4. **Contrastive fine-tuning**: the model is further fine-tuned using MultipleNegativesRankingLoss on 1.2 million CornStack query-document pairs
|
|
59
|
+
|
|
60
|
+
## Results
|
|
61
|
+
|
|
62
|
+
Results on the [CoIR benchmark](https://github.com/CoIR-team/coir) on [MTEB](https://github.com/embeddings-benchmark/mteb) (NDCG@10, `mteb>=2.10`):
|
|
63
|
+
|
|
64
|
+
| Model | Params | AVG | AppsRetrieval | COIRCodeSearchNet | CodeFeedbackMT | CodeFeedbackST | CodeSearchNetCC | CodeTransContest | CodeTransDL | CosQA | StackOverflow | Text2SQL |
|
|
65
|
+
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
66
|
+
| CodeRankEmbed | 137M | 59.14 | 23.46 | 94.70 | 42.61 | 78.11 | 76.39 | 66.43 | 34.84 | 35.92 | 80.53 | 58.37 |
|
|
67
|
+
| **potion-code-16M-v2 + BM25 (hybrid)** | **16M** | **43.36** | **6.08** | **47.71** | **45.38** | **61.10** | **51.68** | **53.80** | **33.42** | **21.39** | **66.73** | **46.29** |
|
|
68
|
+
| BM25 | — | 42.31 | 4.76 | 40.86 | 59.19 | 68.15 | 53.97 | 47.78 | 34.42 | 18.75 | 70.26 | 24.94 |
|
|
69
|
+
| **potion-code-16M-v2** | **16M** | **39.08** | **5.19** | **46.37** | **38.02** | **53.22** | **43.66** | **43.66** | **32.64** | **24.36** | **59.57** | **44.07** |
|
|
70
|
+
| potion-code-16M | 16M | 37.05 | 3.97 | 42.99 | 36.26 | 50.27 | 43.40 | 39.76 | 31.72 | 21.37 | 57.47 | 43.34 |
|
|
71
|
+
| potion-retrieval-32M | 32M | 32.10 | 4.22 | 31.80 | 36.71 | 45.11 | 38.64 | 29.97 | 32.62 | 8.70 | 56.26 | 36.93 |
|
|
72
|
+
| potion-base-32M | 32M | 31.42 | 3.37 | 29.58 | 34.77 | 42.69 | 37.88 | 28.51 | 30.55 | 14.61 | 53.36 | 38.88 |
|
|
73
|
+
|
|
74
|
+
CoIR covers a broad range of code retrieval scenarios. For the use case of finding code given a natural language query, **CosQA** and **CodeFeedback (ST/MT)** are the most relevant tasks. Others are less so: **COIRCodeSearchNetRetrieval** retrieves text given a code query (the reverse direction), and the **CodeTransOcean** tasks target cross-language code translation.
|
|
75
|
+
The hybrid row combines dense retrieval with BM25 using Reciprocal Rank Fusion (k=60).
|
|
76
|
+
|
|
77
|
+
## Model Details
|
|
78
|
+
|
|
79
|
+
| Property | Value |
|
|
80
|
+
|---|---|
|
|
81
|
+
| Parameters | ~16M |
|
|
82
|
+
| Embedding dimensions | 256 |
|
|
83
|
+
| Vocabulary size | ~63,500 |
|
|
84
|
+
| Teacher model | nomic-ai/CodeRankEmbed |
|
|
85
|
+
| Training corpus | CornStack (6 languages: Python, Java, JavaScript, Go, PHP, Ruby) |
|
|
86
|
+
| Max sequence length | 1,000,000 tokens (static, no limit in practice) |
|
|
87
|
+
|
|
88
|
+
## Additional Resources
|
|
89
|
+
|
|
90
|
+
- [Semble repository](https://github.com/MinishLab/semble)
|
|
91
|
+
- [Model2Vec repository](https://github.com/MinishLab/model2vec)
|
|
92
|
+
- [Tokenlearn repository](https://github.com/MinishLab/tokenlearn)
|
|
93
|
+
- [Tokenlearn document dataset](https://huggingface.co/minishlab/tokenlearn-cornstack-docs-coderankembed-v2)
|
|
94
|
+
- [Tokenlearn query dataset](https://huggingface.co/minishlab/tokenlearn-cornstack-queries-coderankembed-v2)
|
|
95
|
+
- [CornStack dataset](https://huggingface.co/datasets/nomic-ai/cornstack-python-v1)
|
|
96
|
+
- [CoIR benchmark](https://github.com/CoIR-team/coir)
|
|
97
|
+
|
|
98
|
+
## Citation
|
|
99
|
+
|
|
100
|
+
```bibtex
|
|
101
|
+
@software{minishlab2024model2vec,
|
|
102
|
+
author = {Stephan Tulkens and {van Dongen}, Thomas},
|
|
103
|
+
title = {Model2Vec: Fast State-of-the-Art Static Embeddings},
|
|
104
|
+
year = {2024},
|
|
105
|
+
publisher = {Zenodo},
|
|
106
|
+
doi = {10.5281/zenodo.17270888},
|
|
107
|
+
url = {https://github.com/MinishLab/model2vec},
|
|
108
|
+
license = {MIT}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"platform": "linux",
|
|
4
|
+
"architecture": "x64",
|
|
5
|
+
"target": "x86_64-unknown-linux-gnu",
|
|
6
|
+
"model": {
|
|
7
|
+
"repository": "minishlab/potion-code-16M-v2",
|
|
8
|
+
"revision": "e9d2a44ca6a05ac6685f3b23709ea57eb7352d5b",
|
|
9
|
+
"identity": "minishlab/potion-code-16M-v2@e9d2a44ca6a05ac6685f3b23709ea57eb7352d5b",
|
|
10
|
+
"license": "MIT"
|
|
11
|
+
},
|
|
12
|
+
"helper": {
|
|
13
|
+
"sourceRepository": "satori/experiments/potion-l0-l1",
|
|
14
|
+
"sourceRevision": "d04eac35af2addad7b68525f91b0c6dacd8b94da",
|
|
15
|
+
"model2vecRsRevision": "6f51c7afe2436bcb76fc467bad54eaa94f8db30d",
|
|
16
|
+
"rustToolchain": "1.97.1",
|
|
17
|
+
"features": [
|
|
18
|
+
"default-features=false",
|
|
19
|
+
"local-only",
|
|
20
|
+
"fancy-regex"
|
|
21
|
+
],
|
|
22
|
+
"dynamicRuntime": [
|
|
23
|
+
"glibc",
|
|
24
|
+
"libgcc_s"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"embeddingInferenceContractDigest": "bfda80d97aeb585e20650b1c54e9063a65068ce284317f0e0a812e20964dcee7",
|
|
28
|
+
"files": [
|
|
29
|
+
{
|
|
30
|
+
"path": "satori-potion",
|
|
31
|
+
"bytes": 4224392,
|
|
32
|
+
"sha256": "2e42f3165b96927bb365f74a11b0495661ac3c44e1a194c55a8f0613b5bb2e12",
|
|
33
|
+
"executable": true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "model/config.json",
|
|
37
|
+
"bytes": 59,
|
|
38
|
+
"sha256": "148e5691a6fcc553437156859701fba017a1ba5d340b170f17e0f3668fb861a7"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"path": "model/model.safetensors",
|
|
42
|
+
"bytes": 32490072,
|
|
43
|
+
"sha256": "75cf7a6c2171b230ad19b1e7d8e0b1aee86da5a02af8e7cacedd9921d227623c"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"path": "model/tokenizer.json",
|
|
47
|
+
"bytes": 1024340,
|
|
48
|
+
"sha256": "107bbdcbad4bff1d299b7a4c3a2fb17c52890688b7dd0e4c9deab79d3c4f3d45"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"path": "MODEL_CARD.md",
|
|
52
|
+
"bytes": 5301,
|
|
53
|
+
"sha256": "835e4161a3942cd5284d423dbdb4ca69024b671436273142d7512153e770794c"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"path": "MODEL2VEC_RS_LICENSE",
|
|
57
|
+
"bytes": 1071,
|
|
58
|
+
"sha256": "6869ad291a9df9866448579b7157bf337373a21ced5b4b315e68b2924aff2ab9"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
Binary file
|