Pillar · Experience-Driven

Agents That Learn From Mistakes.

Not facts stored — skill compounded. Every session's outcomes become tomorrow's instincts, gated by evidence at every step.

Direct answer

An experience-driven agent turns session outcomes into compounding skill instead of disposable transcripts. Anvaya's learning loop runs in five stages: a ledger records every tool call append-only; episode shaping cuts sessions at intent and file-disjoint boundaries and keeps only learning-rich shapes (struggles resolved, reverts, corrections); contrastive extraction pulls grounded claims with counterfactuals through ten reject filters; adjudication holds claims invisible until independent sessions corroborate them; shadow evaluation scores candidates against real queries before anything goes live. Research backs the thesis — MemCoder's commit-history co-evolution hit state-of-the-art on SWE-bench with +9.4% over its base model. The motto: memory shrinks as capability grows.

The Learning Loop

Ledger to Instinct in Five Stages.

Each gate exists because the naive version fails: raw logs bloat, naive summaries hallucinate, uncorroborated rules mislead.

01Ledger — record everythingEvery tool call lands in an append-only, TTL-bound ledger: args, output, error, duration, denials. Total recall of what happened, cheap to keep, bounded to forget.
02Episodes — shape the storySession activity is cut into episodes at todo, intent, and file-disjoint boundaries. Shapes like Struggle-Resolved, Reverted, User-Corrected, and Contradicted mark where learning lives; clean runs and pure exploration are skipped.
03Extract — contrast, don't summarizeOne LLM pass per episode pulls contrastive claims — what was tried, what failed, what the counterfactual is — with grounding and durability attached. Ten automatic reject filters kill vague, ungrounded, or duplicate lessons.
04Adjudicate — corroborate or waitClaims stay invisible hypotheses until N-of-M distinct sessions corroborate them (Beta posterior), or contradict and supersede. Nothing is deleted; history is preserved while the live graph stays trustworthy.
05Shadow — prove it before servingCandidate knowledge runs in shadow mode first: scored against real queries without affecting answers. UNKNOWN is never treated as zero. Only what beats the baseline in shadow gets promoted to live memory.

Why Believe It

Failure Is the Dataset.

Flat memories store what happened. Experience stores what it meant — with the receipt attached.

01Counterfactuals requiredEvery claim carries what would have worked instead. Lessons without alternatives are rejected at extraction — no fortune-cookie rules.
02N-of-M corroborationOne session's pain is a hypothesis; repeated independent confirmation is knowledge. The Beta posterior tracks the difference numerically.
03History preservedSuperseded claims leave the live index but keep full version chains. Audit any lesson back to the sessions that forged it.

Questions

Asked About Learning Agents.

Q

What is an experience-driven agent?

An agent that converts session outcomes into durable skill: failures become lessons, corrections become rules, successes become corroborated knowledge. Instead of accumulating facts linearly, its memory evolves — incidents captured, confirmed into behavioral rules, generalized into principles. Memory shrinks as capability grows.

Q

How is this different from training or fine-tuning?

No weights change. Learning happens in the memory layer between sessions: structured claims with grounding, durability, and utility scores. It works with any provider model (Ollama to frontier APIs) and each project's lessons stay project-scoped unless explicitly federated.

Q

What stops the agent learning the wrong lesson?

Four gates: contrastive extraction requires counterfactuals (what would have worked), adjudication requires independent corroboration before serving, shadow eval measures against baselines first, and git-anchored drift detection demotes knowledge the codebase has outgrown. A bad session corrupts nothing.

Q

What is shadow evaluation?

New candidate knowledge is scored against real historical queries in parallel with live serving — measured, never served — until it proves better than baseline. It is the memory equivalent of a canary deploy: promote on evidence, not optimism.

Q

How do I see what my agent learned?

Everything is inspectable: the ledger, episode shapes, claim status (hypothesis → confirmed → superseded), utility scores, and shadow results. mind_stats exposes graph size, session counts, and mean injection utility — the number that should climb as your project matures.

Stop Starting From Zero.

One binary. 11+9 Rust crates. 545 tests. Hand-written HNSW index. Three transport modes. Four providers, Ollama, Anthropic, OpenAI, Siemens. Zero API keys required to start. Mind remembers everything after the first session.