Cymatix Context
Coordinate-index engine for LLM agents. Retrieves, weighs, and compresses your codebase into a context window — without a single LLM call on the retrieval path.
Formerly helix-context — renamed July 2026. As of 0.8.5 the old surface (the
helix_context import, helix* CLI names, HELIX_* env vars, helix.toml)
has been removed — see Migrating from
helix-context.
The name comes from the engine's cymatics stage: each term is hashed (MD5) into
one of 256 bins and given a small Gaussian spread, and query and candidate are
compared as the resulting 256-dimensional vectors. It's a cheap, deterministic,
model-free term transform — "cymatics" is a mnemonic for that binned spectrum,
not a claim of signal-processing semantics (nearby bins are hash placement, not
related meaning). It's a candidate-reordering signal that has not yet been
isolated against hashed bag-of-words or random-bin controls — treat it as an
experimental cheap feature, not a proven one. The /fingerprint endpoint
exposes the binned vector directly.
Proof (30 seconds)
Token economics — compressor disabled (default LLM-free config), N=15 query shapes, May 2026:
| metric | tokens | vs standard RAG (top-5 @ 1500) |
|---|---|---|
| median | 2,757 | 2.9× fewer tokens |
| best (focused query) | 1,410 | 5.7× |
| worst (broad 12-doc) | 3,755 | 2.1× |
In multi-turn sessions, the session delivery register elides already-seen
documents — observed 37× reduction on repeated retrievals within a
conversation (~40% token savings on typical multi-turn work). Both
multi-turn figures are unverified design estimates — from ad-hoc session
traces, not a receipted benchmark; a production
cymatix_session_tokens_saved_total counter to measure them is pending.
Reproducer: python benchmarks/bench_rag_vs_sike_tokens.py against your own knowledge store.
Caveat: the "vs standard RAG" denominator (top-5 @ 1500 tokens) is a
configurable baseline, and the 37× multi-turn figure is elision of
already-delivered documents, not compression of new content — and it remains
an unverified design estimate pending the cymatix_session_tokens_saved_total
counter. The decision-useful
claim is equal-or-better task completion at fewer input tokens; a same-harness
baseline/ablation frontier (BM25 / BGE-M3 / BM25+dense RRF / Cymatix full /
Cymatix minus-cymatics), paired with correctness, is future work — not yet
published.
External benchmark — EnterpriseRAG-Bench (Onyx, 500 questions over a ~500K-document enterprise corpus).
Shipped-defaults operating point (0.9.0, 2026-08-20) — what an untouched install does today. The default retrieval path is fully algorithmic — dense, SPLADE, and PKI all default-off since 2026-08-15..19, each flip receipt-gated (the optional cross-encoder rerank has always shipped default-off) — measured on the 829K-fragment ERB bed at full needle power:
| metric (829k bed, n=469, delivered basis) | score |
|---|---|
| Gold-document delivery | 56.5% (265/469) |
| recall@12 | 0.659 |
| final recall@12 | 0.663 |
Receipt: benchmarks/dogfood/erb/receipts/sema_readgate_829k_n469.json.
Latency honesty (disclosed in the CHANGELOG, #374): turning dense off costs
p50 latency — dense's ANN gate was load-bearing as a candidate-list cap —
×2.5–2.6 at 100k fragments, shrinking to ×1.09–1.38 at the 829k operating
point; the mitigation (a lex-branch candidate cap) has not yet landed.
All-encoders-on 0.8.x operating point (July 2026, no longer the shipped default) — scored under ERB's official judge protocol and submitted to the leaderboard. These numbers were measured under additive fusion + dense + SPLADE ON, a configuration that no longer ships by default (every layer remains available opt-in):
| ERB official metric | score |
|---|---|
| Correctness | 41.6% (208/500) |
| Completeness | 42.8% |
| Overall | 33.57 |
Context for those numbers: the corpus was ingested as 829,131 fragments on a single consumer desktop, and retrieval ran with zero LLM calls on the retrieval path. The claim is that operating point — local, LLM-free, at scale — not a leaderboard win. Quote the delivery and correctness numbers as a pair: gold-document delivery was 55% at 829K-fragment scale (82% at 50K) under that same all-encoders-on config, and delivery is not a graded pass — end-to-end correctness is the 41.6% above. When the gold document was delivered, the answer was correct 79% of the time, so retrieval breadth at extreme scale, not answer synthesis, is the current ceiling. The end-to-end judge protocol has not yet been re-run on the 0.9.0 shipped defaults — the delivered-basis table above is the retrieval-layer measurement of the shipped world. Full methodology + repro: docs/benchmarks/2026-07-10-erb-blob-829k-reproduction.md.
Scale caveat: the 829K-fragment operating point above runs the unsharded engine. The sharded path (corpora split across shard DBs) currently trails unsharded by ~31pp recall@10 / ~30pp MRR on the xl bed — dense recall and co-activation are not yet at parity across shards (#275). "Local-first at scale" is a demonstrated research operating point on the unsharded engine, not yet a turnkey general substrate for sharded corpora.
Fusion: Reciprocal Rank Fusion has been the default ranker since 2026-07-06 — measured +12pp gold-document delivery over the legacy additive accumulator on the hardest internal bed (0.74 vs 0.62).
Agent contract (shape stable; confidence calibration experimental): every
/context response carries know { found, confidence } (grounded — you may
answer) or miss { reason, escalate_to } (not found — don't answer from the
knowledge store). Stale results downgrade to
miss(reason="stale"|"cold"|"superseded") via the freshness gate. The contract
shape is stable and load-bearing, but the confidence scalar is under active
recalibration — on current internal beds it is not yet a reliable trust signal
(#287,
#239). Rely on found
/ reason today; treat confidence as provisional.
Get started
Requires Python 3.11+. Core install is dependency-light (FastAPI + SQLite, no torch):
pip install cymatix-context
python -m spacy download en_core_web_sm # ingest tagger model (with the cpu extra)
Pick extras for the features you turn on:
| Extra | Enables | Pull |
|---|---|---|
| (core) | HTTP server, /context, /context/packet, FTS5 retrieval |
light |
embeddings |
BGE-M3 dense recall (opt-in; default-off since 2026-08-15 — receipts) | torch via sentence-transformers |
cpu |
spaCy NER ingest tagging | spacy |
mcp |
python -m cymatix_context.mcp_server (Claude Code / Cursor / Desktop) |
mcp SDK |
otel |
Grafana/Tempo/Loki observability | opentelemetry |
launcher-tray |
System-tray supervisor (Windows) | pystray (LGPL, opt-in) |
ast |
Tree-sitter code chunking | tree-sitter grammars |
all |
Everything above except dev + tray | heavy |
pip install "cymatix-context[embeddings,cpu,mcp]" # recommended working set
Then:
# 1. Ingest your project
cymatix ingest path/to/your/project/ --recursive
# 2. Optional: dense backfill (only used if you opt in to dense recall with
# [retrieval] dense_embedding_enabled = true — default off since 2026-08-15)
python scripts/backfill_bgem3_v2.py genomes/main/genome.db
# 3. Query from the CLI — no server needed
cymatix query "how does the splice step work?"
# 4. Or start the proxy for IDE / agent integration
cymatix-server # binds to 127.0.0.1:11437
curl -s http://127.0.0.1:11437/health
Full setup (extras matrix, GPU detection, tray): docs/SETUP.md.
Usage
Three surfaces, same retrieval primitives, same JSON shapes:
| Surface | Best for | Example |
|---|---|---|
| CLI | Scripts, CI, cold-start agents | cymatix query "..." --json |
| MCP | Claude Code, Cursor, Claude Desktop | see below |
| HTTP proxy | Continue IDE, OPENAI_BASE_URL redirect |
POST /context |
# CLI — no server, no daemon, subprocess-drivable
cymatix query "what does the splice step do?" --json
cymatix packet "edit the splice step" --task-type edit --json
cymatix gene get abc123 --json
cymatix neighbors "splice step" --k 10 --json
cymatix refresh-targets "edit the splice step" --json
cymatix status
cymatix diag corpus
# HTTP — agent-safe packet with verified / stale_risk / refresh_targets
curl -s http://127.0.0.1:11437/context/packet \
-H "content-type: application/json" \
-d '{"query": "how does the freshness gate demote stale docs?"}'
Configuration lives in cymatix.toml. Env vars use the CYMATIX_* prefix:
CYMATIX_GENOME_PATH=genomes/dogfood/genome.db cymatix-server
CYMATIX_OTEL_ENABLED=1 CYMATIX_OTEL_ENDPOINT=localhost:4317 cymatix-server
Full CLI reference: docs/clients/cli.md.
MCP tool schemas: docs/api/mcp-tools.md.
Pipeline (2 minutes)
Seven stages per turn, all LLM-free except optional splice:
query
│
▼
┌──────────────┐
│ 0. Classify │ rule-based: decoder mode + assembly cap
└──────┬───────┘
▼
┌──────────────┐
│ 1. Extract │ heuristic keyword + entity extraction
└──────┬───────┘
▼
┌──────────────┐ FTS5 BM25 + tags (+ opt-in BGE-M3 dense)
│ 2. Retrieve │ + synonym expansion + co-activation + SR
│ │ + cymatics 256-bin spectrum scoring
│ │ ranked via RRF (default) or additive fusion
└──────┬───────┘
▼
┌──────────────┐
│ 3. Re-rank │ CPU classifier scores (optional)
└──────┬───────┘
▼
┌──────────────┐
│ 4. Splice │ Headroom Kompress (CPU) or LLM compressor
└──────┬───────┘
▼
┌──────────────┐ token budget + legibility headers (fired tiers,
│ 5. Assemble │ confidence ◆/◇/⬦, compression ratio) +
│ + Stage 7 │ freshness gate (stale/cold/superseded → miss)
└──────┬───────┘ + session delivery (elide already-seen docs)
▼
┌──────────────┐
│ 6. Persist │ query+response → knowledge store (background)
└──────┘───────┘
▼
know { } or miss { }
- know/miss contract (shape stable; confidence experimental):
knowmeans the context is grounded, agent may answer.missmeans don't answer from the knowledge store — escalate viaescalate_totools or refetch fromrefresh_targets. Theconfidencescalar is under active recalibration (#287, #239) — rely onfound/reason, treatconfidenceas provisional. - Caller model class:
/contextacceptscaller_model_class: "generic" | "small_moe" | "frontier"to select render branch (ordering, assembly cap, decoder mode). See docs/api/context-endpoint.md §7.
Configuration (cymatix.toml)
| Section | Key settings |
|---|---|
[ribosome] |
enabled, backend ("none" / "litellm" / "deberta" — only litellm/deberta honored when enabled; "claude" and legacy "ollama" dispatch disabled), query_expansion |
[hardware] |
Device auto-detection (CUDA → ROCm → MPS → CPU) |
[budget] |
expression_tokens (7k default), max_genes_per_turn, splice_aggressiveness, legibility_enabled, session_delivery_enabled |
[session] |
Synthetic session windows, default party_id |
[genome] |
path (genomes/main/genome.db), compact_interval, replicas |
[server] |
host, port, upstream |
[telemetry] |
OTel export: enabled (default off), endpoint, sampler_ratio, redact_query |
[headroom] |
Optional Headroom proxy lifecycle |
[encoder_daemon] |
url (default "" = off) — route dense/SPLADE/SEMA encoding through a shared daemon |
[ingestion] |
backend ("cpu" / "ollama" / "hybrid"), splade_enabled, entity_graph |
[context] |
Cold-tier retrieval: enabled, k, min_cosine |
[cymatics] |
Frequency-domain scoring, harmonic_links, distance_metric |
[classifier] |
Rule-based query classification thresholds |
[retrieval] |
fusion_mode ("rrf" default / "additive" legacy), SR, ray_trace_theta, seeded_edges |
[plr] |
Piecewise linear reranker model |
[know] |
Know/miss calibration: emit_floor, betas, s_ref, g_ref, stale_after_days |
[mem_sync] |
Auto-memory → knowledge-store sync: watch_dirs, interval |
[synonyms] |
Query expansion map (e.g., "cache" → ["redis", "ttl"]) |
[abstain] |
Low-confidence abstention thresholds |
Full reference: docs/config-reference.md.
Full endpoint reference
Core retrieval:
| Endpoint | Purpose |
|---|---|
POST /context |
know/miss + expressed_context (primary) |
POST /context/packet |
Agent-safe bundle: verified / stale_risk / refresh_targets |
POST /context/refresh-plan |
Refresh targets only (reread plan) |
POST /fingerprint |
Navigation-first payload (scores, no body) |
GET /context/expand |
1-hop neighborhood from a gene_id |
POST /v1/chat/completions |
OpenAI-compatible proxy |
Ingestion + maintenance:
| Endpoint | Purpose |
|---|---|
POST /ingest |
Add content to the knowledge store |
POST /consolidate |
Rewrite stale docs from source fingerprints |
POST /admin/refresh |
Force retrieval-layer refresh |
POST /admin/vacuum |
Reclaim SQLite pages |
POST /admin/swap-db |
Hot-swap the .db file without restart |
Identity + sessions:
| Endpoint | Purpose |
|---|---|
POST /sessions/register |
Register agent participant |
GET /sessions |
List registered participants |
GET /session/{id}/manifest |
Session delivery log |
POST /hitl/emit |
Record HITL pause event |
Diagnostics:
| Endpoint | Purpose |
|---|---|
GET /stats |
Corpus metrics + compression ratio |
GET /health |
Model, doc count, calibration provenance |
GET /genes/{gene_id} |
Single document detail |
GET /debug/resonance |
Tier activation profile |
GET /metrics/tokens |
Token usage counters |
Full schema: docs/api/endpoints.md.
Package structure (16 packages)
| Package | Purpose |
|---|---|
adapters/ |
Cache, DAL, external retriever protocol |
backends/ |
Compressor, BGE-M3 codec, DeBERTa, NLI, SEMA, SPLADE |
cli/ |
cymatix CLI: query, packet, gene, neighbors, ingest, diag, config, status |
encoding/ |
Chunking, fragments, legibility headers, Headroom bridge |
identity/ |
CWoLa logger, session delivery, registry, provenance, claims |
okf/ |
Open Knowledge Format (OKF v0.1) bundle reader, canonical digest, ingest adapter |
pipeline/ |
Tier logic, stage helpers |
retrieval/ |
Expand, freshness, RRF/additive fusion, PLR, intent router, SR, seeded edges, query classifier |
scoring/ |
Cymatics, know-calibration, know-decision, ray-trace, TCM |
server/ |
FastAPI app factory + route modules (context, ingest, registry, admin) |
storage/ |
DDL, indexes, co-activation graph |
telemetry/ |
OTel metrics, histogram instrumentation |
vault/ |
Obsidian vault export (diagnostic traces) |
launcher/ |
System-tray supervisor |
mcp/ |
MCP tool surface for Claude Code / Desktop |
integrations/ |
ScoreRift bridge |
The import package is cymatix_context (the old helix_context alias was
removed in 0.8.5). Biology-named module shims genome.py, ribosome.py,
server.py, replication.py, hgt.py persist as the domain lexicon.
Lexicon: docs/ROSETTA.md.
IDE + MCP integration
MCP setup (Claude Code / Cursor / Claude Desktop)
{
"mcpServers": {
"cymatix-context": {
"command": "python",
"args": ["-m", "cymatix_context.mcp_server"],
"cwd": "/absolute/path/to/your/project",
"env": { "CYMATIX_MCP_URL": "http://127.0.0.1:11437" }
}
}
}
The server self-identifies as cymatix, so client tools appear as
mcp__cymatix__*.
Continue IDE
models:
- name: Cymatix (Local)
provider: openai
model: gemma3:e4b
apiBase: http://127.0.0.1:11437/v1
apiKey: EMPTY
roles: [chat]
defaultCompletionOptions:
contextLength: 128000
maxTokens: 4096
Use Chat mode, not Agent mode — the proxy doesn't handle tool routing.
OpenAI-compatible proxy (zero code changes)
OPENAI_BASE_URL=http://localhost:11437/v1 your-app
Knowledge store management
[genome]
path = "genomes/main/genome.db" # relative to the cymatix run directory
Backup (safe while running — WAL mode):
cp genomes/main/genome.db backups/genome-$(date +%Y%m%d).db
BGE-M3 backfill (one-time, after install):
python scripts/backfill_bgem3_v2.py genomes/main/genome.db
Security
The proxy binds to loopback (127.0.0.1:11437) by default, but a loopback
bind is not authentication — any process on the same host can reach the
port. Two opt-in knobs harden the mutating surface (both default-off; an
untouched config behaves exactly as before):
[server]
admin_token = "your-secret" # /admin/*, /ingest, /consolidate demand "Authorization: Bearer your-secret" (401 otherwise)
swap_db_roots = ["F:/cymatix/genomes"] # /admin/swap-db may only open paths under these roots (403 otherwise)
Since 2026-08-19 (#351) the server also logs a prominent
NETWORK-EXPOSED ADMIN SURFACE warning at startup when [server] host
is non-loopback while admin_token is empty (warning only — the bind is
honored), and [budget] neutralize_control_tags defaults on:
retrieved content containing the literal <cymatix: string is escaped
to <cymatix: at assembly time so an ingested document cannot forge
the genuine no-match/slate control tags (receipt-gated flip — delivered
basis and window bytes measured identical across arms; set it to
false to opt out).
Details: docs/config-reference.md, [server].
Observability
scripts\setup-grafana-telem.ps1 # Windows
scripts/setup-grafana-telem.sh # Linux / macOS
Dashboard: http://localhost:3000/d/cymatix-overview. Full surface: docs/architecture/OBSERVABILITY.md.
Migrating from helix-context
As of 0.8.5 the old helix surface has been removed — this is a clean
break. The table below maps each removed name to its replacement. If you are
still on the old names, migrate to the right-hand column, or pin
cymatix-context<0.8.5 (0.8.0 keeps the aliases), or the last helix-context
release, until you can.
| Surface | Old (removed in 0.8.5) | New (use this) |
|---|---|---|
| Install | pip install helix-context |
pip install cymatix-context |
| Import | import helix_context → ModuleNotFoundError |
import cymatix_context |
| CLI | helix, helix-server, helix-launcher, helix-status, helix-vault |
cymatix, cymatix-server, cymatix-launcher, cymatix-status, cymatix-vault |
| Config file | helix.toml (no longer read) |
cymatix.toml |
| Env vars | HELIX_* (no longer read) |
CYMATIX_* |
MCP -m entry |
python -m helix_context.mcp_server |
python -m cymatix_context.mcp_server |
| MCP tools | helix_* tool names |
cymatix_* |
| ASGI target | helix_context._asgi:app |
cymatix_context._asgi:app |
The knowledge-store file format is unchanged — existing genome.db files
work as-is, no re-ingest needed.
Gotchas
- Knowledge store path is
genomes/main/genome.db(not project root). Delete to start fresh. - BGE-M3 backfill only matters if you opt in to dense recall (
[retrieval] dense_embedding_enabled = true; default off since 2026-08-15 — four-scale receipts measured dense displacing gold from delivery). With dense on,embedding_dense_v2 IS NULLuntil you runscripts/backfill_bgem3_v2.py. - Fusion mode defaults to
"rrf"(since 2026-07-06; +12pp gold delivery vs additive on the hardest bed)."additive"remains as the legacy accumulator, scheduled for condition-gated removal. Under RRF the abstain gates run ratio-only. - Sharded scale gap: the sharded adapter currently trails the unsharded engine by ~31pp recall@10 on xl (dense recall and co-activation not yet at parity) — #275. Prefer the unsharded engine for accuracy-sensitive corpora until this is closed.
- Session delivery (
session_delivery_enabled = true) tracks delivered docs per session, elides repeats. ~40% token savings on multi-turn (unverified design estimate — pending thecymatix_session_tokens_saved_totalcounter). Passignore_delivered: truein/contextbody for benchmarks. - know/miss contract requires the agent prompt fragment to be honored — without it, frontier models confabulate. Import
cymatix_context.agent_prompt.full_fragment(). - Naming lexicon: biology terms (gene, genome, ribosome) have canonical software equivalents (document, knowledge store, compressor). Both work in code; new code uses software terms. See docs/ROSETTA.md.
Testing
python -m spacy download en_core_web_sm # once; ingest-path tests skip without it (#313)
python -m pytest tests/ -m "not live" -v # ~4,165 tests, no external services
Documentation
Acknowledgments
Built on: spaCy NER · Howard 2005 TCM · Stachenfeld 2017 SR · SQLite FTS5 BM25 · BGE-M3 · Kompress · Headroom
How this was built
Cymatix Context is architected and QA-directed by Michael Bachaud. Implementation, refactoring, draft documentation, and test generation are produced by AI coding agents under spec- and benchmark-gated review. The human owns the product thesis, architecture selection, acceptance criteria, experiment design, and falsification authority; the models own the code production.
License
Apache-2.0. See NOTICE for third-party attributions.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cymatix_context-0.9.0.tar.gz.
File metadata
- Download URL: cymatix_context-0.9.0.tar.gz
- Upload date:
- Size: 6.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86602ecf9fe3febc88e630689d607056339bf477f09bd5f72d9dcbe677fdaf6a
|
|
| MD5 |
ea3b061032eda4b0a8f84e09dcb59aa9
|
|
| BLAKE2b-256 |
4b29b96c9703ada5a6464c962ae565feb8819b35858e9ca9a3eb93e82cbded2c
|
Provenance
The following attestation bundles were made for cymatix_context-0.9.0.tar.gz:
Publisher:
publish.yml on mbachaud/Cymatix-Context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cymatix_context-0.9.0.tar.gz -
Subject digest:
86602ecf9fe3febc88e630689d607056339bf477f09bd5f72d9dcbe677fdaf6a - Sigstore transparency entry: 2528202386
- Sigstore integration time:
-
Permalink:
mbachaud/Cymatix-Context@55162c6b4a84070a29b9c02237714b07c1193b38 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/mbachaud
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@55162c6b4a84070a29b9c02237714b07c1193b38 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cymatix_context-0.9.0-py3-none-any.whl.
File metadata
- Download URL: cymatix_context-0.9.0-py3-none-any.whl
- Upload date:
- Size: 840.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d78d06ef234ea5f89394898bbf3a4b36b1ffae10f368290acc518f0ecfc45e6b
|
|
| MD5 |
a3257cd763f694a3ca4dfcc415259557
|
|
| BLAKE2b-256 |
1c930a3862e05c27395470dc5d6c13e26bb73ad96e4811f08be53978b5956309
|
Provenance
The following attestation bundles were made for cymatix_context-0.9.0-py3-none-any.whl:
Publisher:
publish.yml on mbachaud/Cymatix-Context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cymatix_context-0.9.0-py3-none-any.whl -
Subject digest:
d78d06ef234ea5f89394898bbf3a4b36b1ffae10f368290acc518f0ecfc45e6b - Sigstore transparency entry: 2528202521
- Sigstore integration time:
-
Permalink:
mbachaud/Cymatix-Context@55162c6b4a84070a29b9c02237714b07c1193b38 -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/mbachaud
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@55162c6b4a84070a29b9c02237714b07c1193b38 -
Trigger Event:
release
-
Statement type: