Entroly · The local-first AI efficiency layer
Select context for coding agents and LLM apps, recover omitted evidence, check answers against source, and pick up work in another agent.
Smaller context. Recoverable evidence. Costs you can inspect.
Start with a local proof, connect the agent you already use, and measure the requests that actually pass through Entroly. Context receipts explain what was kept and omitted; provider usage shows input, output, cache reads, and cache writes. Both help you investigate a bill without treating every removed token as a full-price saving.
An agent can see where checkout starts and still miss the line that rounds the
invoice. In this staged two-file example, a 20-token budget leaves tax.py out
of the selected context. The Entroly receipt records why it was omitted and
lets you recover and verify the exact source span from a local store.
Download the Python demo and run these commands from the download folder.
python -m pip install "entroly==1.0.93"
python missing_line_demo.py
Look for Omitted: tax.py (budget_limit) and Recovered tax.py exactly. The
demo uses only its built-in fixture and a temporary store. It runs without an
agent, a provider API key, or access to your repository. To try Entroly on your
own code, follow the local install and verification steps.
Watch the local demo · Connect your agent · Resume interrupted work · Review the benchmarks
Open source. Works through VS Code, Claude Code, Cursor, Codex, OpenClaw, GitHub Copilot, Aider, and OpenAI/Anthropic-compatible apps.
English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · हिन्दी · Français · Deutsch · Português · Italiano · Türkçe · Tiếng Việt · Bahasa Indonesia · Polski · Nederlands · ไทย · Svenska · Čeština · Tagalog · Română
What is it? · Install · Quickstart · Benchmarks · Questions · Contribute
What is Entroly? (in plain English)
Entroly provides context assurance and token-efficiency tooling for AI coding agents and LLM apps. It selects evidence within a token budget and records what was kept, what was omitted, and why. A receipt provides a handle to recover the exact original bytes from content-addressed evidence while the referenced local store and source bytes remain available. You can try recoverable context compression on your own repository and keep your existing model and agent setup.
| What you need | How Entroly helps |
|---|---|
| Fit the right code into your context budget | Select evidence, inspect the receipt, and recover omitted source from the local store. Try context selection. |
| Check an answer against the source | Use WITNESS to flag unsupported claims. Exact recovery verifies source fidelity. Answer quality needs its own evaluation. Read the verification results and limits. |
| Pick up where another agent stopped | Reconstruct unfinished work from repository evidence and review the recovered state. Try agent continuity. |
| Manage model input costs | Smaller requests can reduce input cost when routed through Entroly. Results depend on the workload and provider cache. See the benchmarks. |
| Use your existing metrics stack | An optional OpenTelemetry bridge exports provider token/cache counters and catalog-priced cost without prompt content. Requires 1.0.93 or later. Configure provider usage metrics. |
The product guide covers local memory, the provider gateway, privacy controls, and the available integrations.
Do I have to change my code? No. On hosts with a verified prompt hook,
Entroly runs before the model plans. MCP-only integrations remain callable
tools that an agent may skip; API traffic is intercepted only when it is routed
through the Entroly proxy. Check entroly activation status --json instead of
assuming an installed integration is active.
Using several hosts in one project? Version 1.0.93 and later support
entroly activation status --host codex --json and per-host host_states
summaries. One host's receipt does not prove another host is active. Check the
history window and multi-agent setup limits.
Building a multi-agent harness? Inspect Work Graph and native memory bindings
with entroly capabilities --json, then use the existing context bridge and
budget controller. Shared allocations respect their global token cap and
reject infeasible minimums; child-agent quotas are reserved within their
parent's quota. These are local planning controls, not a provider invoice or
an operating-system sandbox. Runtime contracts and validation.
Do I need to pay for anything to try it? No. The two commands in the Install section below run on your own machine, with no API key, and show you real numbers on your own project before you connect anything paid. (Missing native-engine support is reported without downloading packages, see the note under Install.)
Switching coding agents mid-task? entroly-work resume reconstructs
unfinished work from durable repository evidence, even if the previous agent
left no handoff. The receiving agent must review the inferred state and
acknowledge it before claiming work through Entroly. Start with
entroly-work --project . --json resume --to-agent codex;
the agent continuity guide shows the complete flow
and how to measure whether it actually saves rediscovery work on your tasks.
Contributing
Start with development setup and repository layout, then follow the architecture, style guide, and test instructions for the surface being changed. Source, delivery adapters, and benchmark evidence have different review requirements; the contributor guide explains their boundaries.
Install
Not sure which one? Pick Python. It's the complete version and what most people use. The other packages expose different runtime surfaces.
Platform Install What you get 🐍 Python (pip), recommended pip install -U entrolyEverything: the command-line tool, the server your AI editor talks to, and the code library 📦 Node / npm npm install -g entrolyLocal Node/WASM CLI; the Python package has a broader CLI, SDK, and proxy surface 🦀 Rust (source build) cd entroly-core && cargo build --release --bin entroly-rs --features proxyOne self-contained program, no Python or Node needed 🍺 Homebrew brew install juyterman1000/entroly/entrolyThe command-line tool on macOS/Linux 🐳 Docker docker pull ghcr.io/juyterman1000/entroly:latestRuns in a container, nothing installed on your machine
Prefer a package runner instead of a global install? These commands use the same published artifacts in an isolated tool cache:
# Node or Bun / WASM runtime
npx -y entroly@latest --help
pnpm dlx entroly@latest --help
bunx --bun entroly@latest --help
# Complete Python runtime
uvx --from entroly entroly --help
pipx run --spec entroly entroly --help
The Node commands provide the local WASM CLI. The Python commands provide the complete CLI, SDK, MCP, proxy, verification, and native-engine path described above. Entroly's release workflow smoke-tests all five runners against the exact version before a release is considered complete.
Now check that it worked, free, no API key:
cd /your/repo
entroly verify-claims
entroly simulate
Both run locally. Neither calls an AI or proves answer quality, activation,
or a lower provider bill. Use a task-specific --query with simulate; if it
reports Relevance ranking is OFF, run entroly doctor before evaluating the
selection.
Runtime package repair is off by default. If the native engine is missing,
query-conditioned selection is unavailable and reduction figures are labelled
unearned. Install it explicitly with python -m pip install -U entroly-core, call
entroly.repair() from Python, or set ENTROLY_ENABLE_SELF_HEAL=1 to permit
startup repair. This downloads through the configured package index (normally
PyPI). ENTROLY_NO_SELF_HEAL=1 and ENTROLY_AIR_GAP=1 override repair consent.
See Privacy and recovery-data security.
Extras (entroly[proxy], entroly[native], entroly[full]), the standalone
Rust binary, and uninstall steps: Engine & install options.
Contributing from source? Follow the reproducible
development setup. Local installation and
the normal test suite need no API key; .env.example documents
only optional workspace, offline, provider, and proxy settings.
Quickstart, by how you work
Start with the local check.
entroly goregisters an MCP server for a detected editor and starts a proxy and dashboard. Route API traffic through that proxy or use a supported host hook, then verify that the integration actually ran. The table below shows the available paths.
Your situation Do this What it gets you 🟢 "I control my app's API base URL." (pip / Python user) pip install -U entroly && entroly goStarts the local proxy and dashboard; point your app at the displayed URL and check observed requests with entroly value --json"I use Node, not Python." (npm user) npm install -g entroly && entroly initNode/WASM CLI and local MCP path; use Python for the full proxy and SDK path "I want one binary, no runtime." (Rust user) cargo build --release --bin entroly-rs --features proxy(fromentroly-core/)A single native program with no dependencies "I use Claude Code, Codex, Gemini CLI, or VS Code agent plugins." (plugin user) Install the Entroly plugin/extension for that host, submit one prompt, then run entroly activation status --jsonA trusted prompt hook performs bounded local selection before planning; a receipt proves the hook ran "I use Cursor with third-party configs enabled." entroly activation install --host cursor --project .Merges a reversible Claude-compatible prompt hook; native Cursor MCP remains advisory "I use Kiro IDE 1.x or CLI 3.x." entroly activation install --host kiro --project .Installs a reversible project PromptSubmithook whose stdout is added to agent context"I use another MCP host." entroly attach create --client claude --project . --ttl 4h --installor the client-specific command in the compatibility matrixScoped Entroly tools and receipts; the model can still skip MCP unless the host has a verified lifecycle hook "I'm building my own app in Python." (SDK user) from entroly import compress, compress_messages, optimizeCall it straight from your code, anywhere you assemble a prompt "I have an API key and my own app." (proxy user) entroly proxy→ pointANTHROPIC_BASE_URL/OPENAI_BASE_URL/GOOGLE_GEMINI_BASE_URLatlocalhost:9377Requests sent through the proxy are eligible for optimization; inspect receipts and provider-observed usage after a real request
Cursor MCP users can also use this one-click install link (no marketplace account required): Add Entroly to Cursor.
Runaway-session rescue, automatic on the proxy, callable everywhere else.
When a long agent session approaches the provider's context limit, bulky tool
output is compacted in flight: no manual /compact, the prompt prefix stays
byte-stable so your warm provider cache survives, and every omitted span is
recoverable. The proxy does it for you because it sees the outbound request.
Anywhere else, pip, SDK, a provider-SDK wrapper, or an MCP host that passes its
transcript, hand the conversation over and get the same policy:
from entroly import rescue_session. entroly capabilities reports which
protections apply to how you are running. See
session rescue.
Why bother: less unnecessary context reaches the model (lower bill, less
distraction for the model), drops come with receipts and, where a recovery
handle is issued, an exact way back (see what each path keeps below), and you
can prove it, entroly verify-claims and entroly simulate show real
numbers on your own repo before you connect a paid key.
import json
from entroly import compress, compress_messages, optimize
api_response = json.dumps({"items": [{"id": i, "status": "ok"} for i in range(500)]})
compressed = compress(api_response, budget=2000) # text in, text out
messages = compress_messages(
[{"role": "user", "content": "build log:\n" + "step ok\n" * 3000},
{"role": "user", "content": "Why did the login test fail?"}],
budget=30000,
)
context = optimize(
[{"content": "def login(user):\n return check(user)\n", "source": "auth.py"}],
budget=8000, query="fix the login bug",
)
entroly compress response.json --out small.json
entroly recover sha256:0b957c79... --out restored.json
What is recoverable: entroly recover returns the complete original for
JSON, logs, tables/CSV and shell output. For source code, prose documents,
API schemas and chat transcripts it returns only the omitted parts (function
bodies, sentences, turns), without their positions, so keep the original file
if you need it back whole; the compress receipt says which one you got.
compress() and compress_messages() return text only and keep no recovery
copy; proxy and rescue_session compaction store the complete original of
every block they shorten.
Full setup paths for every agent, IDE, and CI use case: Get started in depth · Command reference.
Integration hub
Use Entroly at the SDK, framework, proxy, MCP, plugin or agent boundary. A listed name is not automatically a claim that hosted subscription inference is intercepted; provider-bound savings exist only when the request traverses an Entroly-controlled route.
| Direct, tested paths | Guided or bounded paths |
|---|---|
| Vercel AI SDK middleware · OpenAI SDK · Anthropic SDK | Agno · Strands Agents · CrewAI · AutoGen |
| LangChain · LiteLLM · MCP | Claude Code on Vertex AI · Claude Code on Azure AI Foundry |
| OpenClaw · OpenCode | Claude Code in VS Code · VS Code Copilot · Grok |
Open the complete verified integration and operations hub →
See it work in 30 seconds
Each recording is generated from a checked-in command that verifies its source artifact before printing a number.
The first recording above demonstrates SDK import and compression, local
indexing, budgeted selection, and exact source recovery. Run
entroly verify-claims to replay those checks offline.
On a frozen 24-case holdout, Entroly answered 24/24; a published baseline answered 18/24 at roughly 1.5x the effective context. python scripts/readme_proof.py model-recovery
Omitted evidence recovered byte-exact after a process restart, 66/66 payloads. python scripts/readme_proof.py restart-recovery
Full protocols, sample sizes, and every caveat: docs/BENCHMARKS.md.
Benchmarks
The question that matters: if you send less, does the AI start getting things wrong? These are standard public tests, run with and without Entroly.
How to read this: Retention is how well the AI still answered, 100% means
it did just as well on far less text. Token savings is how much less was
sent (and therefore paid for). Measured with gpt-4o-mini; intervals are Wilson 95% CIs.
| Benchmark | Baseline | With Entroly | Retention | Token savings |
|---|---|---|---|---|
| NeedleInAHaystack | 100% | 100% | 100% | 99.5% |
| LongBench (HotpotQA) | 64% | 66% | 103% | 85.3% |
| Berkeley Function Calling | 100% | 100% | 100% | 79.3% |
| SQuAD 2.0 | 80% | 72% | 90% | 43.8% |
| GSM8K | 85% | 85% | 100% | pass-through* |
*pass-through: context already fit the budget, left unchanged. n=20–50 per row. Reproduce: python benchmarks/run_readme_benchmarks.py (needs OPENAI_API_KEY). |
Being straight with you: look at the SQuAD 2.0 row, accuracy went down
(80% → 72%). Compression is a trade, not magic, and it doesn't win everywhere.
That's why entroly simulate exists: run it on your own project and see your
own numbers before you commit to anything.
Hallucination detection (WITNESS, local, no API): 84.92% accuracy / 0.7976 AUROC on 20,000 HaluEval-QA decisions, within the reported uncertainty of gpt-4o-mini as an API judge on the same shared sample.
Frozen evidence-selection benchmark (opt-in PRISM-R research prototype, not the default compressor): a disagreement guard kept the answer-bearing passage in 298 of 300 cases while selecting an average of 1.02 of 16 passages (paired exact McNemar p=0.21875 vs. BM25 alone), this experiment measures retrieval of the known-answer passage, not generated-answer quality. Full protocol: PRISM-R neural evidence frontier.
Recovery, latency, and head-to-head frontier results are in docs/BENCHMARKS.md with raw artifacts linked. None of these numbers are a universal or production-savings guarantee for your workload, reproduce them on your own repo with entroly simulate and entroly value.
Read less while keeping the evidence you need
Entroly's smart_read MCP tool supports structure views for navigation,
exact line ranges for implementation details, and diffs against a supplied
baseline. An identical repeated read within the same session returns a short
handle. Use fresh=true to expand it again.
| Recorded Entroly workload | Result | What was measured |
|---|---|---|
| 20 function-body evidence probes | Signature index 2/20, selected source spans 20/20 | Required exception name present in the delivered text |
| 13 public SDK recovery probes | 13/13 exact recoveries | Recovered bytes matched their original source spans |
These recorded workloads measure evidence presence and source fidelity. For workflow efficiency, also measure completed-task quality, model turns, tool-return bytes, cache usage, and elapsed time on the same tasks. Inspect the function-body artifact · Inspect the SDK artifact · Read modes and measurement guide
Before measuring a workflow, run entroly activation status --json from your
project and inspect its latest receipt and age. For routed provider traffic,
entroly usage --json reports recorded usage and spend. Include cache reads,
cache writes, retries, and recovery when comparing costs.
Activation and cache-cost examples
For ongoing monitoring, export provider usage to your configured OpenTelemetry meter. Cache reads and writes remain subsets of input usage; unpriced requests stay visible without a fabricated dollar amount. Keep the same tasks and quality checks when comparing before and after.
Accuracy Retention
Historical maintainer-reported experiment, not a quality guarantee. The table below reports one 50K-token-budget run. Overlapping confidence intervals do not establish equivalence or rule out degradation. These results have not been independently reproduced here.
Model: gpt-4o-mini · Budget: 50K tokens · Wilson 95% CI · Reproduce: python -m bench.accuracy --benchmark all
| Benchmark | n | Baseline (95% CI) | Entroly (95% CI) | Retention | Benchmark Delta |
|---|---|---|---|---|---|
| NeedleInAHaystack | 20 | 100.0% [83.9–100%] | 100.0% [83.9–100%] | 100.0% | Baseline |
| GSM8K | 100 | 85.0% [76.7–90.7%] | 86.0% [77.9–91.5%] | 101.2% | +1.0% |
| SQuAD 2.0 | 100 | 84.0% [75.6–89.9%] | 83.0% [74.5–89.1%] | 98.8% | -1.0% |
| MMLU (4-way MCQ) | 100 | 82.0% [73.3–88.3%] | 85.0% [76.7–90.7%] | 103.7% | +3.0% |
| TruthfulQA (MC1) | 100 | 72.0% [62.5–79.9%] | 73.0% [63.6–80.7%] | 101.4% | +1.0% |
| LongBench (HotpotQA) | 100 | 57.0% [47.2–66.3%] | 59.8% [49.8–69.0%] | 104.9% | +2.8% |
The reported SQuAD score fell from 84% to 83%. Retention ratios above 100% can reflect sampling or model variability. The displayed intervals are historical reported values, not a validated paired comparison; Wilson intervals require binary outcomes and do not justify uncertainty for averaged partial-credit scores. Establishing non-inferiority needs a predefined tolerance, paired per-task outcomes, appropriate uncertainty estimates, and adequate sample size. These results cannot be extrapolated to more aggressive compression or other models.
Context Selection Quality
19-fragment synthetic corpus · 300-token budget · 3 fixture queries · Reproduce: entroly benchmark
| Metric | RAW (Naive FIFO) | TOP-K (local baseline) | ENTROLY (Knapsack) |
|---|---|---|---|
| Avg fragments selected | 6.0 | 6.0 | 8.7 |
| Avg module coverage | 3.0 | 3.7 | 8.7 |
| Total SAST catches | 0 | 0 | 3 |
Entroly sees 8.7 modules where TOP-K sees 3.7, it includes auth, payments, AND rate limiting. TOP-K misses the rate limiter. Full methodology, CIs, and reproduce commands →
Research
Entroly includes the following research-oriented implementations. A module's presence does not establish production reliability, mathematical novelty, or independent validation; consult its implementation and evaluation limitations.
| Algorithm | What it does | Implementation |
|---|---|---|
| BIPT | Byte-level hallucination detection via Kolmogorov-inspired provenance tracing | provenance_tracer.py |
| NKBE | Nash-KKT multi-agent token budget equilibrium | nkbe.rs |
| Causal Context Graph | Intervention-aware fragment feedback learning | causal.rs |
| Cognitive Bus | ISA event routing with KL-divergence priority | cognitive_bus.rs |
| Resonance Matrix | Supermodular pairwise fragment value learning | resonance.rs |
| System 1 <> 2 | Dual-process verified-belief bridge (proxy <> vault) | coupling.py |
Features
- Picks first, shrinks second, it works out which files actually answer your question, then compresses them.
- Gives you the original back, exactly, anything left out can be restored character-for-character and checked against a fingerprint.
- Shows its work, a receipt for every decision: what was kept, what was left out and why, and what risk remains.
- Fact-checks answers, compares what the AI said against the evidence it was given, on your machine, without paying for a second AI call.
- Doesn't wreck your caching, keeps the unchanging parts of your prompt stable so your provider's discount for repeated text still applies.
- Rescues sessions before they crash, when a conversation grows too big, it trims recoverable output instead of letting the provider reject the request mid-task.
- Can route cheap work to cheap models, optional and fail-closed when uncertain.
- Cross-agent shared memory, Claude, Codex, Cursor, and Gemini can read and write the same compressed context store with automatic SimHash deduplication and agent provenance tracking.
- Output token reduction, effort-based routing classifies query complexity and steers model verbosity, reducing output tokens alongside input tokens.
- Shell hook compression, transparent CLI output compression for git, npm, cargo, docker, pytest, kubectl, and terraform. Preserves errors and warnings, strips progress bars and boilerplate.
- Image compression, 40-90% reduction on screenshots and diagrams for vision API calls, with optional OCR text extraction.
- Failure mining,
entroly learn --deepmines session data for recurring failure patterns and writes corrections to CLAUDE.md, .cursorrules, and other agent configs.
Runs as a CLI, Python/TypeScript SDK, MCP server, HTTP proxy, or library import. Full surface map: docs/product-surface.md. Architecture and Rust internals: docs/DETAILS.md.
How Entroly compares
Entroly combines budgeted selection, source-span receipts, and optional verification. These are distinct guarantees: a receipt records retained and omitted material; recovery checks source integrity; WITNESS/EICV checks can still produce false positives or false negatives. Solver objectives approximate useful context and do not prove that the chosen context is sufficient for a task.
Compare tools on the same task set, version, model, token budget, and quality criterion. The local TOP-K fixture does not measure any commercial product. We do not provide an independently reproduced cross-product comparison here.
Works with your stack
Install the public Codex plugin from the Entroly repository:
codex plugin marketplace add juyterman1000/entroly --ref main
codex plugin add entroly@entroly-public
Restart Codex, review and trust the hook, then run entroly activation status --json after a task. The marketplace installs the local Node/WASM runtime with
the plugin; the model does not have to remember to call an MCP tool before
Entroly runs. A receipt proves that the hook executed and selected local
context or made an explicit no-match decision. It does not prove token or cost
savings without a matched provider-bound baseline.
Install the same public repository as a Gemini CLI extension:
gemini extensions install https://github.com/juyterman1000/entroly --ref main --consent
Restart Gemini CLI after installation. The repository root contains
gemini-extension.json and GEMINI.md, so the command works without navigating
into an integration subdirectory.
For VS Code or Kiro, download the entroly-vscode-*.vsix asset from the latest
GitHub release, then
install it with Extensions: Install from VSIX or code --install-extension.
The extension is self-contained and does not require an API key.
JetBrains AI Assistant users can add the same server globally at Settings → Tools → AI Assistant → Model Context Protocol (MCP):
{
"mcpServers": {
"entroly": {
"command": "npx",
"args": ["-y", "entroly-mcp@1.0.93", "serve"],
"env": {
"ENTROLY_NO_DOCKER": "1",
"ENTROLY_MCP_PASSIVE": "1",
"ENTROLY_MCP_PROFILE": "public",
"ENTROLY_MAX_FILES": "200"
}
}
}
}
The repository also ships a free, open-source JetBrains plugin that guides this
setup from Tools → Configure Entroly for AI Assistant, checks the local
runtime on request, and keeps the evidence boundary visible. See
extensions/jetbrains.
MCP marketplace and plugin manifests select the compact public profile so
agents see the core context, receipt, continuity, recovery, and verification
tools first. A direct entroly serve invocation remains backwards compatible
and exposes the full tool surface. You can choose either behavior explicitly
with ENTROLY_MCP_PROFILE=public or ENTROLY_MCP_PROFILE=full.