See value in your first session

Entroly should answer three questions quickly: Did it reduce the context? Did that reduction reach a provider-bound request? What evidence and risk remained?

entroly verify-claims   # prove the installed trust/recovery path; no API key
entroly simulate        # estimate reduction on this repo; no model call
entroly value           # print the evidence-classified lifetime value receipt
entroly value --json    # the same receipt for CI, audits, or a dashboard

The value receipt deliberately keeps unlike evidence separate:

Evidence class What Entroly reports Dollar claim
Provider-bound proxy requests Requests observed, pre/post input-token reduction, active days, and configured model-rate provenance Modeled API input cost avoided; not an invoice. Unknown/unmatched models remain unpriced
SDK, MCP, and npm operations Local operations and tokens reduced $0 claimed because delivery to a paid provider is not observable
Legacy or unknown-source history Preserved tokens and operations $0 claimed; excluded from provider savings

simulate compares selected context with its stated local 32K dump baseline. It is a fast estimate, not provider billing or final-answer quality. Once a request travels through a supported proxy path, entroly value reports measured pre/post provider-bound token counts and labels the result with the pricing source and date.


One measured job of the Context OS

Entroly is much more than a compressor: it also ships memory, recovery, verification, provider controls, security, receipts, and guarded outcome learning. This frozen benchmark isolates one job in that system: choosing the answer-bearing evidence before a model request.

In this frozen retrieval test, Entroly selected 1.02 of 16 passages on average while keeping the answer-bearing passage in 298 of 300 held-out questions. This demonstrates one Context OS primitive: selecting a small evidence set without blindly discarding the passage needed to answer.

Under the hood, traditional BM25 found the passage in 297 of 300 questions and a local transformer found it in 293 of 300. They disagreed six times; the guard kept both candidates only on those cases. The point difference was not statistically conclusive (p=0.21875), and this experiment measures retrieval, not generated answers, token savings, or production cost.

python -m benchmarks.neural_evidence_frontier verify benchmarks/results/neural_evidence_frontier.json

Audit every trial in under a minute · inspect the raw artifact · submit a counterexample


What it does

Entroly is a local Context OS for AI agents. It unifies the full lifecycle of the information surrounding a model request. That makes it the observability, governance, and decision layer around context—not another general-purpose chat runtime.

Frontier models reason. OpenClaw and Hermes run agents. Entroly manages what those agents read, remember, trust, recover, spend, and learn. The same boundary applies to Claude Code and Codex: Entroly augments the agent you already use instead of becoming another chat client.

Context OS job What Entroly does
Read Discovers, ranks, deduplicates, compresses, and secures evidence under an explicit budget.
Remember Maintains working, episodic, semantic, checkpoint, and knowledge-vault context locally.
Trust Checks prompts, code, provenance, and generated claims with layered security and verification.
Recover Keeps omitted originals reachable through content-addressed handles and replayable Context Commits.
Spend Preserves cache boundaries, accounts for provider usage, and applies explicit routing and budget policy.
Learn Uses tests, CI, command exits, edits, and user outcomes to improve guarded local policies and skills.

Most compression tools shrink whatever text the agent already chose. Entroly starts one step earlier: it chooses the highest-value evidence first, compresses only after selection, keeps originals recoverable, then verifies the answer against the evidence.

  • Receipts - every selection run can explain selected chunks, omitted nearby evidence, dependency links, fingerprints, token ratio, and residual risks.
  • Select - ranks your repo or document set, then sends the answer-relevant context under a token budget.
  • Verify - WITNESS can check an answer against supplied evidence locally, without an additional model call. See the scoped benchmark under Proof.
  • Route - sends easy, repeated tasks to a cheaper model and keeps the flagship for hard ones (opt-in, fail-closed).
  • Cache-align - keeps the injected prefix byte-stable so provider prefix caches can keep hitting where terms and API shape allow it.
  • Learn - adapts local ranking signals from recorded outcomes. No embeddings API or training job is required for that path.

Use it however you work: wrap your agent, run it as a proxy, plug it in as an MCP server, or import the library.

Why teams care

What usually breaks AI coding at scale What Entroly adds
Context windows fill with logs, duplicate files, and irrelevant chunks Budgeted selection that favors answer-critical files, dependency links, failures, and anomalies
Token savings look good but quality silently drops Accuracy-retention benchmarks, receipts, and WITNESS verification
Agents lose the exact line, stack trace, or omitted file they later need Reversible compressed fragments and retrieval handles
First-time setup depends on one IDE or one provider CLI, SDK, MCP, proxy, npm, PyPI, Docker, and local simulation paths
Enterprise teams need proof, not screenshots Committed JSON artifacts, local self-tests, and reproducible commands

Product surface

Entroly ships as a full local runtime, not one proxy command:

Surface What users get
CLI attach, context-commit, verify-claims, simulate, value, perf, wrap, proxy, serve, daemon, benchmark, witness, receipt, audit, doctor, health, batch, learn, ravs, cache, and more
SDK compress, compress_messages, optimize, verify, hallucination detection, Context Receipts, localizers, cache alignment, cost cortex, Memory OS
MCP server Context optimization, exact retrieval, receipts, recovery, feedback, security scans, codebase health, smart reads, belief verification, response verification
Proxy Anthropic/OpenAI-compatible local optimization path for API-key users and custom apps
Node/WASM entroly, entroly-mcp, and entroly-wasm packages for npm users
Trust layer WITNESS, EICV, STAVE, receipt proofs, provenance checks, prompt-injection scanning, and local verification reports
Proof-guided recovery Durable prepare/advance sessions turn unsupported claims into evidence obligations, recover exact omitted chunks, and stop under explicit round/token bounds
Memory/session intelligence Memory OS, Memory Fabric, long-term memory, session digests, checkpoint relevance, cache-retention forecasting, and lifetime value tracking
Multimodal intake Diff, diagram, voice, image, and structured-context ingestion with provider-aware image token estimates and compliance-gated optimization
Gateway/accounting Provider capability planning, failover policy, redaction receipts, usage ledger, cache routing, spend math, and budget harnesses
Model intelligence Bundled trust-labelled model metadata plus opt-in OpenRouter and local Ollama/LM Studio discovery; remote credentials are never persisted
Knowledge vault/CogOps Belief compilation, vault search, workspace change sync, epistemic routing, verification engines, and flow orchestration
Framework/event gateways LangChain helpers, Ebbiforge provenance auditing and optional learned-dynamics adapter, AgentSkills export, Hermes, Slack, Discord, and Telegram gateway hooks for teams that want operational feedback loops
Self-improvement PRISM/RAVS feedback, autotune, verified model-based dreaming, skill crystallization, promotion gates, evolution logging, and budget-gated skill synthesis
Observability Dashboard, daemon supervisor, control plane, health reports, value tracker, release-surface checks, and local JSON proof reports

Under the hood, the Python control plane has a pure-Python path and can use the optional Rust extension for supported operations. The separate Node runtime uses WASM. The implementation includes BM25, entropy scoring, SimHash dedup, dependency graphs, budgeted selection, caching, verification, and memory primitives; installed capabilities depend on the selected package and extras.

See the full code-derived map in docs/product-surface.md.


How it works (30 seconds)

your agent  ──►  Entroly (local)  ──►  LLM provider
                 │
                 ├─ rank the repo        (BM25 + entropy + dep-graph)
                 ├─ select under budget  (knapsack, reversible)
                 ├─ emit receipt         (included, omitted, risks)
                 ├─ cache-align prefix    (keep provider cache hot)
                 └─ verify the reply      (WITNESS hallucination guard)

Critical files go in full. Supporting files can become signatures. Other material can become a reference that can be expanded on demand. Exact recovery is available only while the corresponding receipt and recovery store are retained; deleting that state deletes Entroly's recovery path.


Proof in 30 seconds

Three short, reproducible checks show the value before asking you to trust the product. These are not mocked terminal recordings: each video is rendered from a checked-in command that verifies its source artifact before printing a number. Click an animation for the MP4, or run the command below it yourself.

1. Prove the installed path works—without an API key

The packaged verifier exercises import, compression, receipts, witness checks, recovery, proxy routing, and replay, then writes a machine-readable JSON report. It is an install smoke test—not a savings or model-quality benchmark.

entroly verify-claims

2. Prove tighter context can preserve more answers

Using Headroom today? Run Entroly against the same workload and compare answer retention, recoverability, state size, and context cost locally. The results below use the published Headroom 0.31.0 package as a versioned baseline; they are not a verdict on every Headroom or Entroly workload.

On the frozen 24-case holdout, Entroly answered 24/24 cases; the published Headroom 0.31.0 baseline answered 18/24, at 28.88% versus 42.97% effective context. This is a synthetic local Qwen2.5-1.5B test at temperature 0, not a universal product or model claim. The six discordant cases favored Entroly (exact McNemar p=0.03125).

python scripts/readme_proof.py model-recovery

Protocol and limitations · raw holdout artifact

3. Prove omitted evidence remains recoverable after restart

The prior v2 run tied at 66/66 and remains published. In the fresh-seed v3 Windows revalidation, Entroly recovered 66/66 payloads byte-exactly after restart; the published Headroom 0.31.0 baseline recovered 55/66. The raw artifact retains the incomplete worker and exact failure evidence. This is one reproducible run, not a universal durability claim.

python scripts/readme_proof.py restart-recovery

Protocol, prior tie, and limitations · current raw artifact · prior tie artifact

The animations, MP4s, static frames, source hashes, and commands are bound in the proof media manifest. Maintainers can rebuild them with python scripts/render_readme_proof_videos.py generate and reject stale media with python scripts/render_readme_proof_videos.py verify. Rebuilding requires Pillow, tiktoken, and FFmpeg; a missing frozen-tokenizer dependency fails with an actionable install command instead of weakening the artifact check.


Get started

The best first run is local and proof-driven. It should work before you connect an API key, proxy, paid model, or enterprise setup.

pip install -U entroly     # or: npm i -g entroly  ·  brew install juyterman1000/entroly/entroly

1. Prove the package works on your machine:

entroly verify-claims      # SDK import, indexing, optimization, exact recovery, engine mode
entroly simulate           # local no-LLM savings estimate on your current repo

2. Pick one integration path:

You are using Run this Why
Claude Code subscription entroly attach create --client claude --project . --ttl 4h --install Installs scoped, expiring MCP access without placing a bearer token in process arguments
Codex or OpenClaw entroly attach create --client codex --project . --ttl 4h --install Binds Entroly to this project with revocable least-privilege access; replace codex with openclaw as needed
Cursor, VS Code, Windsurf, or another MCP client entroly init, or register entroly as a stdio command with no arguments Local MCP tools without requiring Docker
Pay-as-you-go API keys or a custom app entroly proxy Transparent Anthropic/OpenAI-compatible optimization path
Python app from entroly import compress, compress_messages, optimize Direct SDK control
Node/npm workflow npm install -g entroly WASM runtime without a Python-first setup
CI or release gate entroly batch --budget 8000 --fail-over-budget Enforce prompt budgets before merge

3. Best setup for Claude Code subscription users:

entroly attach create --client claude --project . --ttl 4h --install

Claude Code stays your client. Entroly adds only the granted tools for compression, retrieval, receipts, and verification. Revoke access at any time with entroly attach revoke <grant-id> --uninstall; every tool call re-checks the grant, expiry, project, and scope.

4. One command — auto-detects your IDE, wraps your agent, opens the dashboard:

cd /your/repo && entroly go

5. Or wrap a specific agent:

entroly wrap claude     # Claude Code
entroly wrap cursor     # Cursor
entroly wrap codex      # Codex CLI
entroly wrap aider      # Aider

6. Or run the proxy — best for pay-as-you-go API keys and custom apps:

entroly proxy                                   # http://localhost:9377
ANTHROPIC_BASE_URL=http://localhost:9377     your-app
OPENAI_BASE_URL=http://localhost:9377/v1     your-app
GOOGLE_GEMINI_BASE_URL=http://localhost:9377/v1beta     your-app

7. Or measure it on your own repo first:

entroly demo            # before/after token + cost estimate
entroly simulate        # local no-LLM savings estimate
entroly perf            # local no-LLM savings + optimizer latency
entroly value           # provider value, local reductions, and legacy history kept separate
entroly verify-claims   # runs the packaged self-test, writes a JSON report

Local-first: Entroly performs indexing and selection on-device. The selected prompt is sent only through the model integration you configure. Entroly does not send outbound analytics by default. Apache-2.0.

First-run success contract

Entroly should feel useful before you connect a paid model key:

  • entroly verify-claims proves SDK import, local indexing, optimization, exact recovery, and native/pure-Python engine mode.
  • entroly simulate shows the likely token reduction on your repo without making an LLM call.
  • entroly value reports measured provider-bound reduction separately from local-only SDK/MCP/npm reductions, with $0 claimed for paths that cannot prove provider delivery.
  • MCP setup works for Claude Code subscription users who do not want proxy/API-key mode.
  • Proxy mode is available when you control the provider key and want transparent request optimization.
  • npm/WASM is available for Node-first users, but Python remains the fullest CLI/SDK path.

If your repo is tiny or already under budget, Entroly should say so and pass through rather than invent fake savings.


Context Commits

A Context Commit is a portable JSON artifact for the exact context selected for an agent request. It binds the ordered selected text, omitted evidence, exact recovery data, engine/version identity, and optional parent lineage to one content-addressed ctx_... identifier.

entroly context-commit ./repo --query "Where is token rotation enforced?" \
  --budget 8000 --out context-commit.json
entroly context-commit --verify context-commit.json
from entroly import create_context_commit, replay_context, verify_context_commit

commit = create_context_commit(
    [("auth.py", open("auth.py", encoding="utf-8").read())],
    query="Where is token rotation enforced?",
    token_budget=8000,
)
assert verify_context_commit(commit).valid
exact_context = replay_context(commit)

The artifact is self-contained and therefore may contain source text in its recovery bundle. Keep it under the same access and retention policy as the source repository. Content addressing proves mutation, not signer identity; use Entroly's optional Ed25519 attestation and Merkle-log APIs when custody or operator identity matters. Contract and threat model.


Proof-guided exact recovery

Entroly can begin with a small committed context, verify the model draft locally, turn unsupported claims into evidence obligations, and recover only the exact omitted chunks that may resolve them. The committed prefix stays byte-identical across rounds; recovery stops under explicit model-round, token, and chunk bounds.

entroly proof prepare ./docs --query "What proves restart recovery?" \
  --budget 8000 --idempotency-key request-001 > prepared.json
# Send prepared.json's request through the model route you already operate.
entroly proof advance pgs_... --output-file draft.txt \
  --idempotency-key model-round-0
entroly proof inspect pgs_...

Prepare, advance, and inspect are local, durable, restart-safe, and perform no provider call. The CLI, MCP tools, and same-origin localhost sidecar share the same state machine. OpenClaw can optionally automate bounded revision passes, but that mode is off by default because each revision can be billable. Entroly never chooses the provider or receives its credentials.

Protocol, limits, integration setup, and executable contract.


Context Receipts

Receipt-producing selection workflows record what was used, what was omitted, why, and what risks remain. This is useful for hard multi-document work such as contracts, policies, addenda, code reviews, and audit evidence where a bare top-k result is not enough.

entroly ingest ./docs
entroly select --query "Does this contract have a change-of-control clause?" --budget 8000
entroly receipt .entroly/receipts/cr_example.json
entroly audit .entroly/session_chain.json
entroly explain --why-omitted chk_example --receipt .entroly/receipts/cr_example.json

The receipt JSON includes selected chunks, omitted relevant chunks, ranking reasons, dependency links, source fingerprints, token ratio, warnings, and a reproducibility hash. The Markdown report is designed for human review before a compressed context is trusted.

Implementation notes:

  • Rust core (entroly-core/src/context_receipts.rs) handles deterministic ingestion, BM25-style ranking, dependency scans, selection, and hashes when the native wheel is available.
  • Python control plane (entroly/context_receipts/) provides CLI wiring and a pure-Python fallback for source checkouts.
  • The semantic/vector scorer and reranker are explicit extension points; the local MVP ships with lexical scoring and dependency heuristics, not a legal-accuracy guarantee.

Examples:


Proof

Context Commit conformance (synthetic deterministic code fixtures, local, no model or network calls):

Integrity property Committed result
Deterministic replay across Python + Rust modes 128 / 128
Exact recovery of omitted chunks 576 / 576
Tamper mutations detected 768 / 768

Reproduce: python -m benchmarks.context_commit_conformance. Raw JSON. These numbers measure artifact integrity, replay, and recovery on the committed fixtures; they do not measure model-answer quality or claim identical Python/Rust selection.

Context Efficiency Frontier research: Entroly is building a paired, model-neutral benchmark for the question token-savings tables cannot answer: does less context preserve real task quality? The preregistered protocol compares raw context, model-native compaction, Entroly, and their combination using provider-observed tokens, cost, latency, task success, evidence recall, and unsupported claims.

Read the preregistered protocol. No headline result will be claimed until the paired confidence bounds pass.

Matched token-cap active-context quality frontier (1.0.59 source candidate): across 60 frozen SQuAD v2 long-context RAG/tool-result trials, without invoking recovery from the published Headroom 0.31.0 baseline's CCR pointers, Entroly retained 95.0%, 93.3%, and 88.3% of accepted answers at the 2x, 4x, and 8x token caps. The published Headroom 0.31.0 baseline retained 1.7% at each cap. The paired two-sided exact McNemar tests pass at every point (p <= 4.45e-16). Entroly met all 180 caps; the baseline met the 2x/4x caps and exceeded the 8x cap, retaining 18.6% of tokens against the 12.5% maximum.

Maximum token cap Entroly answer retained / actual kept Published Headroom 0.31.0 baseline
2x (50%) 95.0% / 39.3% 1.7% / 18.6%
4x (25%) 93.3% / 19.2% 1.7% / 18.6%
8x (12.5%) 88.3% / 10.4% 1.7% / 18.6% (above cap)

A separate eight-question, randomized local qwen2.5:1.5b guard at 4x scored raw context at 62.5% exact match, Entroly at 87.5%, and the published Headroom 0.31.0 baseline at 12.5%, with no errors. This small local-model sample is a veto guard, not the headline or a frontier-model claim.

Generated report · full auditable artifact · protocol and reproduction. Verify it with python -m benchmarks.compression_frontier verify benchmarks/results/compression_frontier.json.

Scope: extractive answer retention in structured SQuAD-v2 RAG results. The published Headroom 0.31.0 baseline's CCR pointers remain in its output, but retrieval recovery is not run; this measures immediately visible active context, not Headroom's end-to-end CCR workflow. Entroly is measured from the 1.0.59 source candidate; do not call this a released-package result until 1.0.59 is published. This does not establish superiority for every task, model, compressor, or production workload.

Same-input compression gauntlet: on four deterministic agent-tool fixtures, current Entroly source (package version 1.0.59) and the published Headroom 0.31.0 baseline both retained 100% of the preregistered answer evidence. Under the shared o200k_base tokenizer, Entroly reduced weighted input tokens by 95.1% versus 31.4% for the baseline's public compress() pipeline with its documented agent-90 high-savings profile. Entroly compressed all four fixtures; the baseline compressed two and safely passed two through.

Generated report · raw inputs and outputs · protocol and reproduction. Verify the artifact with python -m benchmarks.compression_gauntlet verify benchmarks/results/compression_gauntlet.json.

This is a synthetic, no-model compression/evidence result. It does not measure downstream answer quality or establish neural/ML superiority. The Context Efficiency Frontier above is the required gate for a real-model claim.

Cross-process recovery holdout: the preregistered six-writer test first exposed a serious Entroly failure (only 8/32 development payloads survived), which is preserved in the evidence. The original Entroly 1.0.59 holdout and the immutable v2 revalidation both recorded Entroly and the published Headroom 0.31.0 recovering 66/66 payloads. On the fresh-seed v3 revalidation of the current complete-line recovery implementation, Entroly again recovered 66/66 byte-exactly; the published baseline recovered 55/66. The raw artifact preserves the incomplete writer and exact failure evidence. Entroly was the participant that satisfied the frozen integrity gate on this run. That is a scoped concurrent-writer result; it does not establish universal recovery superiority.

On the current-implementation Windows/Python 3.10 revalidation, the published Headroom 0.31.0 baseline had lower successful store-call latency (1.786 ms versus 36.972 ms p50). Entroly had lower retrieval latency (0.165 ms versus 0.876 ms p50) and a smaller live state footprint (95,438 versus 1,354,888 bytes). The baseline used SQLite WAL with synchronous=NORMAL; Entroly fsynced its state file on each commit, so this is not a matched power-loss durability comparison. These are scoped workload measurements, not universal claims.

Frozen protocol and full result table | current v3 revalidation | prior v2 tie | original post-repair holdout | original failing artifact.

Quality-gated compression latency holdout: on the same four deterministic agent-tool fixtures and public entry points as the gauntlet, Entroly 1.0.59 source was 2.94x faster than the published Headroom 0.31.0 baseline for warm compressor calls (95% bootstrap CI 2.74x–3.13x) and 2.39x faster for product import plus the first call in a fresh process (1.89x–2.70x). Both systems completed every fixture, retained 100% of preregistered evidence, remained deterministic, and never inflated tokens.

Protocol, per-fixture timings, and limits | full holdout artifact | development artifact.

Scope: Windows/Python 3.10, synthetic local compression, 120 warm and 40 cold observations per participant. Cold excludes interpreter startup and includes product import plus first call. This is not provider latency, downstream answer quality, neural superiority, or universal product superiority.

Model-triggered recovery holdout: after compression for one question, a different future audit question was revealed to a local qwen2.5:1.5b guard. On 24 frozen query-shift cases, raw context and Entroly both scored 24/24 exact; the published Headroom 0.31.0 baseline scored 18/24. All six paired differences favored Entroly (two-sided exact McNemar p = 0.03125). Entroly's mean effective context ratio, including recovery evidence on every triggered retry, was 28.88% versus 42.97% for the baseline.

Every Entroly row triggered retrieval and recovered a complete source-exact JSON object. The published baseline answered 18 rows from active context; its remaining six rows were scored under the frozen no-oracle retrieval rule. The raw artifact retains every response. The complete artifact passed the strengthened verifier with zero execution errors.

Protocol, rejected variants, reproduction, and limits | full holdout artifact | development artifact.

Scope: synthetic 48-record JSON audit logs, Windows/Python 3.10, 24 holdout cases, local Qwen2.5 1.5B Q4_K_M at temperature zero. The published Headroom 0.31.0 baseline uses its public compress() plus persistent CompressionStore contract; MCP transport is excluded. This is a scoped workflow result, not evidence about hosted frontier models, every agent workload, provider cost, or overall product superiority.

PRISM-R neural research preview: a generic MiniLM encoder did not beat BM25 as a primary paragraph scorer (97.7% versus 99.0% held-out evidence recall), so Entroly rejects that neural-primary claim. A disagreement guard reached 99.3% while selecting 1.02 of 16 passages on average. In a separate 200-pair query-shift pilot at a nominal 25% active budget, PRISM-R retained 87.0% of current-query evidence versus lexical selection's 60.5%; when a different future question was revealed, exact receipt-backed rehydration raised its evidence retention from 9.0% to 90.5%. Active plus recovered context was 50.6% of the original.

Research design and prior art · held-out retrieval artifact · query-shift artifact.

These are offline exact-evidence pilots on frozen SQuAD v2 subsets, not downstream answer-quality, latency, production-savings, or general neural superiority claims. PRISM-R remains opt-in research code.

The tables below link each reported number to its committed result. Treat them as evidence for those specific datasets, budgets, models, and commits—not as a guarantee for another repository. entroly simulate uses a local token estimate; use provider-observed usage for a billing or production claim.

Accuracy retention — does compression hurt answers? Measured with gpt-4o-mini; intervals are Wilson 95% CIs. Each row links its raw result file.

Benchmark n Budget Baseline With Entroly Retention Token savings
NeedleInAHaystack 20 2K 100% 100% 100% 99.5%
LongBench (HotpotQA) 50 2K 64% 66% 103% 85.3%
Berkeley Function Calling 50 500 100% 100% 100% 79.3%
SQuAD 2.0 50 100 80% 72% 90% 43.8%
GSM8K 20 50K 85% 85% 100% pass-through*

*pass-through: context already fit the budget, so Entroly left it unchanged. Reproduce: python benchmarks/run_readme_benchmarks.py (needs OPENAI_API_KEY). Scope, additional artifacts, and limitations are in the public evidence ledger.

Hallucination detection — committed HaluEval-QA balanced, both-answers-scored run:

Result Decisions Accuracy AUROC Scope
WITNESS full benchmark 20,000 84.92% on the 16,000-decision held-out split 0.7976 Local, deterministic verifier
WITNESS on the shared GPT sample 1,200 86