Skip to main content
LatticeAG

Introducing Axion - Agent Cognitive Middleware

We have been watching a pattern repeat across every AI agent framework.

An agent picks the right approach, identifies the right files, makes sound architectural choices - then silently skips a step, contradicts a decision it made three turns ago, or gets stuck rewriting the same code five times in a row. When you ask "why did it do that?", the answer is: nobody knows. Not you, not the observability dashboard, not the agent itself.

Existing tools show what happened. Nobody shows why.

Today we are announcing Axion - agent cognitive middleware that inspects, detects, and verifies agent reasoning in real time.

The problem

We researched every major forum - Reddit, Hacker News, GitHub issues, Stack Overflow - looking for the problems developers actually complain about when building AI agents. Five patterns emerged:

  1. Agents are black boxes. You can see what they did. You cannot see why. There is no stack trace for reasoning.
  2. Agents get stuck in loops. They rewrite the same code, call the same tool four times, bounce between two approaches. The only fix is a crude max_iterations kill switch.
  3. Agents contradict themselves. They decide "use customer_uuid" in turn 3, then write "user_id" in turn 7. Nobody catches it.
  4. Agent actions are unverifiable. An agent writes a file, runs a command, calls an API - and you find out it was wrong when production breaks.
  5. Debugging is impossible. You cannot replay a non-deterministic agent run. The model will not produce the same tokens twice.

Every existing solution either observes (Langfuse, Arize, Braintrust - 7+ tools doing the same thing) or stores memory (Mem0, Zep, Supermemory - 6+ funded competitors). Nobody intervenes. Nobody explains why. Nobody stops bad actions before they execute.

What Axion does

Axion is a proxy that sits between any AI agent and the outside world. It intercepts model responses, agent outputs, and tool calls - then makes agent reasoning visible, diagnosable, and verifiable as it happens.

Agent <- HTTP -> Axion (CF Worker) -> Model API
                            -> Tools (file, shell, API)

Any agent that supports base_url override works. Zero code changes. Set the environment variable and the agent runs normally while Axion observes in the background.

Three layers

Axion ships in three phases. Each layer adds capability without breaking the previous one.

Axion Lens (Phase 1 - shipping now)

Observe. Read-only. Cannot break anything.

Lens intercepts model responses and extracts the agent's beliefs, assumptions, and reasoning chain. It uses rule-based parsing - regex patterns that detect causal claims ("because X"), assumptions ("assuming X"), intentions ("I'll do X"), and evidence ("based on X"). No model dependency. Sub-millisecond. Runs in waitUntil() after the response stream completes - zero added latency.

Beliefs are linked into a directed acyclic graph (DAG) across the session. When an action fails, you backtrack through the graph to the exact belief that caused the wrong action.

A dashboard shows every decision point, the beliefs behind it, confidence level, and evidence cited. Filter by type, confidence threshold, or "wrong beliefs only."

Axion Loop (Phase 2 - planned)

Detect + intervene.

Loop embeds each agent output using a cheap embedding model and maintains a sliding window of recent outputs. If cosine similarity exceeds a threshold, it flags a potential loop. It then classifies: is this productive iteration, a stuck loop, or thrashing between two approaches?

When a stuck loop is confirmed, Loop injects targeted feedback into the agent's context: "You have tried [X] 3 times with the same result. Consider: [alternatives not yet tried]." Not a kill signal - actionable guidance.

Axion Gate (Phase 3 - planned)

Block + correct.

Gate intercepts tool calls - file writes, shell commands, API calls - before they execute. It checks three things: does this action match the agent's stated plan? Does it contradict a prior decision? Does it match a known failure anti-pattern?

If any check fails, the action is blocked and a correction is injected: "Blocked: you decided to use customer_uuid in step 3 but are writing user_id." The agent self-corrects before damage is done.

Why this is different

We researched the competitive landscape exhaustively. Here is what exists:

  • Observability (Langfuse, Arize, Braintrust, Helicone, Galileo, Agenta): 7+ tools that show what happened. None show why.
  • Memory (Mem0, Zep, Supermemory, Letta): 6+ funded competitors storing agent state. None intervene in reasoning.
  • Loop detection: crude max_iterations limits. Nobody detects what the agent is stuck on or suggests what else to try.
  • Runtime verification: academic papers (AgentVerify, 86% accuracy). Zero products shipped.
  • Belief inspection: one early Claude Code plugin (Nautilus Compass). Zero production tools.

Axion is the only product that sits inside the agent loop and makes reasoning visible, catches loops, and blocks bad actions - all through a single proxy that requires zero code changes.

Open source

The core proxy, belief extraction engine, session state, and local dashboard are open source under MIT. We believe agent tooling should be inspectable and extensible.

A hosted SaaS dashboard (multi-session, cross-session analysis, team sharing, community pattern library) will come later. The open-source core is fully functional standalone.

What is next

Phase 1 (Axion Lens) is in active development. The proxy, belief extraction, and dashboard are built and tested. We are refining the extraction patterns and preparing for real-world testing with Claude Code and Codex CLI.

Explore the code at github.com/LatticeAG/Axion and the product page at latticeag.vercel.app/products/axion.

Agents, together.