Research

Plastic Embedding Substrate

The Plastic Embedding Substrate (pes) is a typed-graph code retriever. Instead of ranking by embedding cosine similarity, it ranks by effective resistance, a spectral distance, from a focus set on a typed code graph. Observer attention deposits mass that deforms the distance field as the agent works, so the substrate is the working index, not a stale separate one.

Hit@5 over BM25+10pp
Router vs RAG, 20-seed+8.60pp ± 6.19pp
Agent cost vs bare LLM−31.6%
LicenseMIT + Commons Clause

What ships

Scalar substrate vs BM25

10 real post-cutoff bug-fix tasks, uncontaminated (the model has not seen the fixes), gold-patch file required in the retriever's top K. No router, no seed noise.

RetrieverHit@K=5MRR
BM25 over file contents30%0.225
pes scalar substrate40%0.270

+10pp hit rate, +20% MRR over BM25 on the same tasks. Bare LLM is not in the table because it does not retrieve; it greps until something works.

Tensor substrate, per slice

Same 10 tasks, using the tensor substrate's per-relation rankings: K=5 distinct geometries, one per edge type.

RetrieverHit@K=5MRR
tensor union (all K=5 slices)40%0.190
tensor slice 1 (imports) alone40%0.240
tensor slices 0 / 2 / 3 / 4 alone0%0.000

On bug-fix tasks only the imports slice has signal. Refactor and type-system tasks should exercise the other slices, but the 10-task set does not cover them yet.

Router on SWE-bench

707 SWE-bench-Lite + Verified tasks times 193 public-system predictions. Trained on leave-one-repo-out cross-validation across 12 repos. Per-repo resolution rate against the always-best-single-action baseline.

RepoRouterBaseline (~RAG)Δ
scikit-learn73.9%32.6%+41.3pp
requests69.2%38.5%+30.8pp
pallets/flask25.0%0.0%+25.0pp
sphinx-doc29.8%5.3%+24.6pp
pydata/xarray26.9%3.8%+23.1pp
pylint-dev40.0%20.0%+20.0pp
astropy37.5%20.8%+16.7pp
django36.8%21.5%+15.2pp
sympy37.7%23.8%+13.8pp

Per-repo wins are single-seed. 20-seed task-held-out cross-validation gives +8.60pp ± 6.19pp (the router wins 19 of 20 seeds, never loses; median +6.67pp).

Agent cost

claude-opus-4-7 on 6 psf/requests SWE-bench tasks. Total cost across all 6 tasks; every configuration resolved all 6.

ConfigTotal costvs bare
bare LLM (no injection)$4.19baseline
aider RepoMap (RAG)$3.38−19.3%
pes scalar substrate (hooks default)$2.87−31.6%

6 tasks is small: single repo, Opus-only, all from before the model's training cutoff, so the model may have seen the fixes. Treat this as directional, not definitive.

Modules

ModuleWhat it does
codegraphPython source to typed-edge graph via tree-sitter and jedi resolution. File, class, function, and method nodes; contains, imports, inherits, calls, refs relations.
substrate / observer / plasticity / encoderL+ scalar substrate primitives. The scalar field that beats RAG in the default configuration.
tensor_substrate / tensor_encoder / sequential_observerPer-concept (R, K) signed bilinear edges, signed effective resistance, variable-rank emergence under nuclear-norm regularization. Research-side; not yet validated downstream.
substrate_session / tensor_sessionHigh-level session adapters for both substrate flavors.
compositional_router / task_featurizerPer-task contextual bandit over channels, depth, body-inject, and RAG, with a k-NN fallback against historically-seen actions on similar tasks.
hooks.user_prompt_submit / hooks.post_tool_useClaude Code hooks: substrate-ranked context injection before the model's turn, and observer-mass deposit on read, grep, and edit.

Access

Confidential, access by request. The Plastic Embedding Substrate isn't publicly available. Get in touch with your use case and we'll follow up about access to the code and a guided substrate session.