Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ interpretation and do not count as additional benchmark-quality gains.
### Public numeric evidence registry

Every exact public aggregate retained below comes from the checked-in, public-safe
[`offline-fixtures-release-1.7.14-20261123.json`](docs/benchmark-evidence/offline-fixtures-release-1.7.14-20261123.json) artifact. Its
[`offline-fixtures-nvidia-embedding-backend-20261129.json`](docs/benchmark-evidence/offline-fixtures-nvidia-embedding-backend-20261129.json) artifact. Its
SHA-256 is
`18f4aabad8de2f448d3a2d1ebf8caaf66678a4b42b34222c8ae884a40f264da8`, also recorded in the
`58046ac34b87f11fd7032e635f7ed94ea1b276981d68bb3521139afb0bed328f`, also recorded in the
adjacent `.sha256` file. The artifact contains no raw questions, answers, prompts, customer data,
or per-record content fingerprints.

The fixture-suite digest is
`e00dbb5615a423d74f3473f55f5fd3062dd584e6e1213a71ed8b6022e238451d`. The artifact defines
`ccd2cce1225d32a4e633ab58f91761e4779a42dcb0e7be6f05a228ceafd626b4`. The artifact defines
the digest algorithm and records the SHA-256 of every suite and dataset file. Each evidence ID
also binds its exact command through `sha256(UTF-8 exact command)`:

Expand All @@ -117,7 +117,7 @@ The canonical chart aliases are regenerated from that new artifact and carry its
historical per-run artifacts and their preserved chart bytes remain unchanged. The current
PNG views were freshly rendered from the registered artifact SVG via Google Chrome for Testing 156.0.8078.4
headless shell on Windows at each SVG canvas size, with embedded artifact and SVG checksums.
The fresh evaluator run on 2026-11-20 UTC used Windows CPython 3.11.17 and NumPy 2.4.6. Its 591-file manifest
The fresh evaluator run on 2026-11-27 UTC used Windows CPython 3.11.17 and NumPy 2.4.6. Its 591-file manifest
binds the producer after unifying Pro/Team commercial contract metadata, hardening sync-key UX, and adding the trigger-invalidated vector visibility revision, bounded NumPy matrix cache, and `remember_many` embedding deduplication atop `engraphis/device_connect.py` and the 1.7.10+ fixes: Command Code file-guard tool
ids, fail-closed hook errors, symlink-then-parent and Windows alias targets, the linear
Spec Studio heading pattern, closure-limit and browse-version handling, the equal-start
Expand All @@ -134,7 +134,7 @@ retrieval-quality improvement. It does not qualify browser behavior, hosted serv
external models, or provider billing. The registered artifact was produced with:

```bash
python -m scripts.export_offline_evidence --output docs/benchmark-evidence/offline-fixtures-release-1.7.14-20261123.json
python -m scripts.export_offline_evidence --output docs/benchmark-evidence/offline-fixtures-nvidia-embedding-backend-20261129.json
```

The earlier release-review predecessors,
Expand Down Expand Up @@ -207,13 +207,13 @@ grounded checks in separate panels; provider billing and MCP transport are not m
the SVG and matching PNG with:

```bash
python scripts/render_benchmark_report.py --report docs/benchmark-evidence/offline-fixtures-release-1.7.14-20261123.json --output docs/images/context-efficiency.svg --png-output docs/images/context-efficiency.png
python scripts/render_benchmark_report.py --report docs/benchmark-evidence/offline-fixtures-nvidia-embedding-backend-20261129.json --output docs/images/context-efficiency.svg --png-output docs/images/context-efficiency.png
```

The companion examples are also generated from that artifact with:

```bash
python -m scripts.render_benchmark_examples --report docs/benchmark-evidence/offline-fixtures-release-1.7.14-20261123.json --output docs/images/evidence-backed-agent-examples.svg --png-output docs/images/evidence-backed-agent-examples.png
python -m scripts.render_benchmark_examples --report docs/benchmark-evidence/offline-fixtures-nvidia-embedding-backend-20261129.json --output docs/images/evidence-backed-agent-examples.svg --png-output docs/images/evidence-backed-agent-examples.png
```
The historical-to-executable mapping is in
[`docs/BENCHMARK_CHANGE_COVERAGE.md`](docs/BENCHMARK_CHANGE_COVERAGE.md).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Pro is $10/month or $100/year for one owner. Team is $20/seat/month or $200/seat
The current registered artifact contains three deterministic offline fixture runs. It separates context size, retrieval quality, and grounded decision checks; these small fixtures do not establish general task performance.

<p align="center">
<img src="https://raw.githubusercontent.com/Coding-Dev-Tools/engraphis/99af3855bd6b685cbac4a4489b44b3c374129053/docs/images/context-efficiency.svg" alt="Three registered offline fixtures: structure-aware chunking reduced mean retrieved context from 740.3 to 214.3 tokens per question (71.1%, 18 questions); the serialized JSON-shape proxy fell from 24,590 to 11,138 tokens across 26 payload samples and 260 recalls. Candidate and packed retrieval quality (Recall@5, Hit@5, and answer-token recall) are shown separately (each 1.000). Grounded checks show 5/5 answerable queries grounded and 6/6 abstention queries rejected, including a 1/1 quarantined-evidence probe; 11/11 decisions were correct. MCP transport and provider billing were not measured. Artifact SHA-256 prefix 18f4aabad8de; see the benchmark guide for the full checksum." width="100%">
<img src="https://raw.githubusercontent.com/Coding-Dev-Tools/engraphis/99af3855bd6b685cbac4a4489b44b3c374129053/docs/images/context-efficiency.svg" alt="Three registered offline fixtures: structure-aware chunking reduced mean retrieved context from 740.3 to 214.3 tokens per question (71.1%, 18 questions); the serialized JSON-shape proxy fell from 24,590 to 11,138 tokens across 26 payload samples and 260 recalls. Candidate and packed retrieval quality (Recall@5, Hit@5, and answer-token recall) are shown separately (each 1.000). Grounded checks show 5/5 answerable queries grounded and 6/6 abstention queries rejected, including a 1/1 quarantined-evidence probe; 11/11 decisions were correct. MCP transport and provider billing were not measured. Artifact SHA-256 prefix 58046ac34b87; see the benchmark guide for the full checksum." width="100%">
<br>
<sup>Three offline fixtures separate context reduction, candidate and packed retrieval quality, and grounded behavior. The chart shows the artifact checksum prefix; see the benchmark guide for the full checksum and reproduction steps.</sup>
</p>
Expand Down
72 changes: 70 additions & 2 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ control-plane, relay, compute, and worker implementations are private services.
| `ENGRAPHIS_INDEX_ROOTS` | Working, home, and temporary directories | Optional path-separator-delimited absolute-path allow-list that replaces the default roots accepted by local code indexing |
| `ENGRAPHIS_HTTP_INDEX_ROOT` | First `ENGRAPHIS_INDEX_ROOTS` entry, or current directory | Single root for dashboard and REST `POST /api/code/index`; submitted paths resolve beneath it. An explicit root (or fallback entry) must be absolute; an explicit HTTP root is included in the engine-approved set. MCP and CLI indexing continue to use `ENGRAPHIS_INDEX_ROOTS`. |
| `ENGRAPHIS_DB_KEY` | Not set | Encrypt the database at rest (SQLCipher). Or use `ENGRAPHIS_DB_KEY_FILE` |
| `ENGRAPHIS_EMBED_MODEL` | `sentence-transformers/all-MiniLM-L6-v2` | sentence-transformers model |
| `ENGRAPHIS_EMBED_MODEL` | `sentence-transformers/all-MiniLM-L6-v2` (or `nvidia/nv-embedqa-e5-v5` when `ENGRAPHIS_EMBED_PROVIDER=nvidia-nim`) | Embedding model selector. Uses local sentence-transformers by default (prefix `local:` to forbid downloads). Prefix `nvidia-nim` or `nvidia-nim:<model>` to opt into the NVIDIA NIM embeddings preset. |
| `ENGRAPHIS_EMBED_PROVIDER` | `local` *(unset)* | Embedding provider: `local` / `sentence-transformers` (default, offline-capable), `nvidia-nim` (opt-in NVIDIA NIM OpenAI-compatible embeddings with asymmetric `input_type`), or `api` / `openai-compatible` (generic `/v1/embeddings` endpoint). |
| `ENGRAPHIS_EMBED_DEVICE` | *(unset; default CPU/loader default)* | Optional PyTorch device selector for local sentence-transformers embeddings: `auto` (use CUDA when PyTorch reports an available GPU, else CPU), `cuda`, `cuda:<index>`, or `cpu`. Falls back to CPU when CUDA is unavailable unless `ENGRAPHIS_REQUIRE_EXACT_BACKENDS=true`. |
| `ENGRAPHIS_EMBED_BASE_URL` | Not set | Optional base URL override for `api` or `nvidia-nim` embeddings (for `nvidia-nim`, defaults to `https://integrate.api.nvidia.com/v1`, or set to a self-hosted NIM URL such as `http://127.0.0.1:8000/v1`). Non-loopback endpoints must use HTTPS. |
| `ENGRAPHIS_EMBED_API_KEY` | Not set | Optional API key for `api` or `nvidia-nim` embeddings. For `nvidia-nim`, falls back to `NVIDIA_API_KEY`; for `api`, falls back to `ENGRAPHIS_LLM_API_KEY`. Not required for loopback self-hosted NIM endpoints. |
| `NVIDIA_API_KEY` | Not set | Standard NVIDIA API Catalog credential used by the opt-in `nvidia-nim` embedding preset when `ENGRAPHIS_EMBED_API_KEY` is unset. Never printed or logged. |
| `NVIDIA_NIM_BASE_URL` | `https://integrate.api.nvidia.com/v1` | Optional base URL alias for a self-hosted or regional NVIDIA NIM embeddings endpoint when `ENGRAPHIS_EMBED_BASE_URL` is unset. |
| `ENGRAPHIS_MCP_PRELOAD_EMBEDDER` | `auto` | Standalone MCP launchers import optional semantic dependencies on the launcher thread on Windows before serving requests. Set `0` to disable or `1` to enable on any platform; model loading and backend fallback policy remain unchanged. |
| `ENGRAPHIS_EMBED_REVISION` | Not set | Optional immutable lowercase 40-hex Hugging Face commit for the embedding model. Loaded Hub commits or local artifact manifests identify persistent vector spaces; unresolved mutable identities keep vector recall fail-closed. |
| `ENGRAPHIS_EMBED_REVISION` | Not set | Optional immutable lowercase 40-hex Hugging Face commit for local sentence-transformers models, or operator-chosen `space_version` string for persistent `nvidia-nim` / `api` embedding stores. Loaded Hub commits, local artifact manifests, or API space versions identify persistent vector spaces; unresolved mutable identities keep vector recall fail-closed. |
| `ENGRAPHIS_RERANK_MODEL` | Not set | Optional sentence-transformers cross-encoder reranker |
| `ENGRAPHIS_RERANK_REVISION` | Not set | Optional immutable lowercase 40-hex Hugging Face commit for the reranker |
| `ENGRAPHIS_REQUIRE_IMMUTABLE_MODELS` | `false` | When enabled, require a 40-hex commit before loading remote embedding models, rerankers, or chunk tokenizers; `local:` selectors and filesystem paths remain permitted |
Expand Down Expand Up @@ -98,6 +104,68 @@ The optional cross-encoder reranker is model- and hardware-dependent. Treat its
latency as deployment-specific until a versioned model identity, exact configuration, and
reproducible evaluation artifact are available for the comparison being reported.

## Optional NVIDIA CUDA and NVIDIA NIM embeddings

Engraphis defaults to local, offline-capable CPU embeddings and never makes remote embedding
calls unless you explicitly opt in.

### Local CUDA acceleration (optional)

When running local `sentence-transformers` embeddings on a host with a CUDA-capable NVIDIA GPU
and CUDA-enabled PyTorch, opt in via `ENGRAPHIS_EMBED_DEVICE`:

```dotenv
ENGRAPHIS_EMBED_MODEL=sentence-transformers/all-MiniLM-L6-v2
ENGRAPHIS_EMBED_DEVICE=auto # auto | cuda | cuda:0 | cpu
```

- `auto` selects `cuda` when `torch.cuda.is_available()` is true and otherwise falls back cleanly
to `cpu` (including on CPU-only or PyTorch-free installs).
- `cuda` or `cuda:<index>` requests that GPU explicitly; if CUDA is unavailable, Engraphis logs a
warning and falls back to `cpu` unless `ENGRAPHIS_REQUIRE_EXACT_BACKENDS=true`, in which case
startup fails with an actionable error.

### NVIDIA NIM embeddings preset (optional)

To use NVIDIA NIM's OpenAI-compatible `/v1/embeddings` API (hosted NVIDIA API Catalog or a
self-hosted NIM microservice), configure either `ENGRAPHIS_EMBED_PROVIDER=nvidia-nim` or the
`nvidia-nim` model prefix. Engraphis automatically sends `input_type="passage"` when indexing
memories and `input_type="query"` during recall and grounded support checks.

**Hosted NVIDIA API Catalog:**

```dotenv
ENGRAPHIS_EMBED_PROVIDER=nvidia-nim
ENGRAPHIS_EMBED_MODEL=nvidia/nv-embedqa-e5-v5
ENGRAPHIS_EMBED_REVISION=nim-nv-embedqa-e5-v5-v1
NVIDIA_API_KEY=<nvidia-api-key>
```

**Self-hosted NVIDIA NIM microservice (local GPU host, no external egress):**

```dotenv
ENGRAPHIS_EMBED_MODEL=nvidia-nim:nvidia/nv-embedqa-e5-v5
ENGRAPHIS_EMBED_BASE_URL=http://127.0.0.1:8000/v1
ENGRAPHIS_EMBED_REVISION=selfhosted-nim-e5-v5-v1
# NVIDIA_API_KEY is optional for loopback self-hosted NIM endpoints
```

**Privacy and storage notes:**

- **Explicit opt-in:** Remote NIM requests occur only when `nvidia-nim` (or `api`) is configured.
When targeting a remote URL (such as `https://integrate.api.nvidia.com/v1`), non-secret memory
text and recall queries are transmitted over HTTPS to generate vectors. Self-hosted loopback NIM
containers keep all text on your host.
- **Secret-memory guards:** Engraphis's credential detector (`reject_secrets`) rejects secret-like
payloads before any embedder runs, and memories marked `sensitivity="secret"` are never sent to
remote embedding APIs during writes or vector-space rebuilds.
- **Vector-space versioning and dimension safety:** Persistent SQLite stores require a non-empty
`ENGRAPHIS_EMBED_REVISION` (`space_version`) for API embedders so Engraphis fingerprints
`(endpoint, model, dimension, space_version)`. Switching between local models (e.g. 384-dim) and
NVIDIA NIM models (e.g. 1024-dim) triggers the guarded versioned rebuild rather than mixing
incompatible vector dimensions in one store. Never commit API keys; store `NVIDIA_API_KEY` or
`ENGRAPHIS_EMBED_API_KEY` in the process environment or owner-private `~/.engraphis/config.env`.

See [`.env.example`](../.env.example) for the full variable inventory. Supply values through the
process environment or the trusted config file above; copying it to an arbitrary `./.env` does
not make Engraphis load it.
25 changes: 25 additions & 0 deletions docs/LLM_PROVIDERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ through MCP. Codex and Cohere Command are distinct products and use different se
- [Ollama](#ollama)
- [Cohere Command](#cohere-command)
- [Other OpenAI-compatible endpoints](#other-openai-compatible-endpoints)
- [NVIDIA NIM embeddings (optional)](#nvidia-nim-embeddings-optional)
- [Codex subscription](#codex-subscription)
- [Command Code](#command-code)

Expand Down Expand Up @@ -212,6 +213,30 @@ limits. Endpoints that implement another protocol, such as Anthropic Messages, n
native mode or adapter. If a test fails, confirm the base URL, model, credential, required headers,
and request and response shapes.

## NVIDIA NIM embeddings (optional)

Engraphis keeps embeddings local by default (CPU, or opt-in CUDA via `ENGRAPHIS_EMBED_DEVICE=auto`).
To opt into NVIDIA NIM's OpenAI-compatible `/v1/embeddings` endpoint instead of local embeddings,
configure the `nvidia-nim` preset (separate from `ENGRAPHIS_LLM_PROVIDER`, which controls optional
chat/extraction LLMs):

```dotenv
ENGRAPHIS_EMBED_PROVIDER=nvidia-nim
ENGRAPHIS_EMBED_MODEL=nvidia/nv-embedqa-e5-v5
ENGRAPHIS_EMBED_REVISION=nim-nv-embedqa-e5-v5-v1
NVIDIA_API_KEY=<nvidia-api-key>
# Optional for a self-hosted NVIDIA NIM microservice:
# ENGRAPHIS_EMBED_BASE_URL=http://127.0.0.1:8000/v1
```

Engraphis automatically passes `input_type="passage"` when storing memories and `input_type="query"`
during recall. Non-loopback endpoints require HTTPS and an API key (`NVIDIA_API_KEY` or
`ENGRAPHIS_EMBED_API_KEY`). Remote NIM calls transmit non-secret memory texts and recall queries to
the configured endpoint; credential payloads are rejected before embedding and memories marked
`sensitivity="secret"` are never sent to remote embedding APIs. See
[Configuration reference](CONFIGURATION.md#optional-nvidia-cuda-and-nvidia-nim-embeddings) for
full details, including local CUDA device selection and vector-space versioning.

## Codex subscription

Codex subscription users connect the coding agent to Engraphis over MCP. This keeps the
Expand Down
Loading
Loading