KnowledgeForge is now open source. View the project on GitHub →

KnowledgeForge · Open Source

Most AI agent failures aren't model failures. They're mode failures.

The model picks the wrong kind of thinking for the problem in front of it — brainstorming when it should be debugging, hedging when it should be deciding, inventing structure when it should be following one — and the whole chain degrades from there.

Swap GPT-5 for Opus 4.7 and the same problem shows up wearing different syntax.

KnowledgeForge is the layer that fixes that.

What it is

A reasoning harness for AI coding assistants. It classifies each request by decision type and routes it to a mode built to prevent that type’s typical failure.

KnowledgeForge started in 2023 as a stack of instruction files. By late 2025 it had 43 modules. A Pareto pass cut it to nine — the other 34 existed because of coverage anxiety, not measurable results. What survived: nine modes, each one addressing a real, recurring failure. Nothing in the list exists for completeness.

Runs on Claude Code, Claude Projects, ChatGPT, and Codex CLI.

The circuit breaker

After the same failure mode appears three consecutive times, KnowledgeForge pauses instead of looping.

Every failed attempt is logged and stays in context. The next diagnosis must differ from everything already eliminated. The model cannot re-enter a hypothesis it has already ruled out.

Looping on the same error is the most expensive failure mode in agentic work. It compounds across sessions, burns context, and produces no new information. The circuit breaker kills the loop, forces a different angle, and surfaces the pattern so you can see it.

The opinion baked in

KF patches the model's weaknesses. It doesn't scaffold its strengths.

Deterministic first. Before invoking LLM judgment, exhaust deterministic checks. Before fixing, reproduce. Before acting, triage.

Most agent frameworks try to make the LLM do more. KF makes it do less, better. Every module exists because something specific was failing in production — hypothesis-skipping, hidden trade-offs, hallucinated groundings, runaway scope, stale knowledge surfacing as fact.

What's inside

KF is a stack of modules — each one a targeted patch for a known failure mode in LLM reasoning. Six worth describing:

Decision Classification

Every request gets sorted into one of four types — Reckoning (verifiable answer, give it directly), Evaluative (judgment against existing criteria), Predictive (future state), or Novel (no precedent, requires reasoning expansion). The classifier is the gate that decides whether the LLM should think hard or shut up and answer.

Metacognitive Monitor

Six runtime checks that watch the agent watch itself — stuck detection, hypothesis fixation, scope drift, premature closure. When a check trips, the monitor injects an intervention rather than letting the run rot quietly.

Grounding Scores

Every claim the model makes carries a grounding score. Low-grounding claims get flagged before they propagate. Accretion to long-term memory is gated on grounding — bad reasoning doesn't get to become institutional knowledge.

Operational Bounds

Eight hard limits on what an agent can do per mode — token spend, tool calls, scope expansion, autonomy level. Two-layer safety so a single jailbroken prompt doesn't blow up a deployment.

Temporal Knowledge

Facts decay. KF tracks the staleness window for every piece of stored knowledge and refuses to surface it as current when it's past its half-life. Importance-weighted — high-stakes facts expire faster than low-stakes ones.

Permission Model

Three-tier risk classification with mode-specific capability profiles. The Critic mode can read anything but can't write. The Builder can write but can't ship. The Debugger can run scripts in sandbox but not in prod. Permissions are structural, not vibes.

26 underlying modules (M00–M25) implement those nine modes plus cross-cutting infrastructure: memory architecture, decision classification, knowledge accretion, and grounding scores.

What each mode prevents

Nine modes. The orchestrator routes automatically based on what the request needs:

Builderskipped constraints; speculative features; over-engineering
Criticmissed edge cases; unstated assumptions; rubber-stamping
Debuggerpremature root-cause declaration; looping on the same hypothesis
Strategisthidden costs; false equivalence; “do everything” recommendations
Synthesizerpatterns without boundaries; abstraction without anti-patterns
Expertstopping at first-order findings; missing compound failures
Calibratorover-engineering guardrails for simple projects
Coordinatorhandoff failures; implicit dependencies; coordination without a graph
Navigatorwrong mode for the actual need

The orchestrator routes between them based on what the request actually needs — most don't need any mode at all, which is part of the point.

NOW OPEN SOURCE

Use it. Inspect it. Improve it.

KnowledgeForge is publicly available on GitHub. Explore the modules, install it in your preferred AI coding environment, open an issue, or contribute a better reasoning pattern.

The full story of how 43 modules became nine: Private Tools Don’t Export →

Explore KnowledgeForge on GitHub →