By Lambda Alpha Labs · Open-Source Core (v0.21.0)

The relational codebase compiler and spec-driven containment engine for AI agents.

Compilers verify syntax. Type checkers verify types. Test runners verify behavior. Graphenium (gm) verifies architecture, topological modularity, and epistemic provenance - compressing your codebase into a sub-50ms relational index and mechanically blocking structural drift before a single file is written.

  • MIT Core 100% local relational compiler & Datalog solver
  • Zero-Config ΔQ Gate Mathematical Louvain modularity & drift protection
  • Spec-Driven Containment Virtual AST pre-flight proofs & post-edit scope audits
graphenium gate · pr #1842 live block
BLOCK

Agent violated architectural contract in authentication flow

+128 −41 · auth/session_manager.rs · Risk: High

Risk High
diff · session_manager.rs
@@ session refresh path @@
 fn refresh_token(ctx: &Ctx) -> Result {
-  auth_service.validate_scope(ctx.scope)?;
+  // agent: bypass auth_service
+  db_pool.scope_for(ctx.session_id)?;
   rotate(ctx.session_id)
 }

8 direct callers · 2 public APIs

blast radius · 14 downstream symbols
auth session api tests ?
  • direct callers8 · 2 public APIs
  • blast radius14 downstream symbols
  • AST-proven paths14
  • public API routes3
  • unresolved edges1
confidence profile
EXTRACTED (AST-Proven)43%
Compiler-backed facts; safe planning backbone
INFERRED (Heuristics)57%
Hypotheses; blocked from editing until source is read
AMBIGUOUS (Collisions / Proof Gaps)0%
Gated; requires manual disambiguation
gate decision
Rejected

Pre-flight specification & topological entropy violation

  • Datalog proof: bypasses_layer('session_ctrl', 'auth_service', 'db_pool')
  • Modularity decay: ΔQ -0.041 exceeds tolerance (-0.020); surprise score 6.8 (peripheral→hub)
  • Run 'gm check --delta --plan plan-xyz' to validate Virtual AST in memory
DELTA GATE Zero-drift Louvain ΔQ audit
POLICY Pass · warn · review · block
MIT licensed Open-source Core
Local-first Zero cloud required
12 MCP tools Agent-native interface
10 languages Polyglot AST + Lean 4
~85% fewer tokens Compressed relational index
CLI + CI From laptop to pipeline
MIT licensed Open-source Core
Local-first Zero cloud required
12 MCP tools Agent-native interface
10 languages Polyglot AST + Lean 4
~85% fewer tokens Compressed relational index
CLI + CI From laptop to pipeline

The Structural Compilation & Containment Gap

AI agents write code at 100x human speed. Graphenium keeps your architecture intact.

AI coding agents are extraordinarily fluent at local edits, but they operate with total structural blindness and context decay. Over a long session, probabilistic prompts like CLAUDE.md are dropped as context windows fill up, and agents optimize for the path of least resistance - bypassing service layers, coupling peripheral modules directly to hubs, burning 30,000+ tokens on blind grep sweeps, and quietly editing unrelated files.

You cannot use a probabilistic prompt to enforce a deterministic invariant. Graphenium operates outside the LLM context window as Layer 4 of the compiler stack.

  1. Soft prompt guardrails decay

    Natural-language instructions (CLAUDE.md, .cursorrules) decay as context windows fill up, while agents burn tens of thousands of tokens re-reading raw files to guess how modules connect. Graphenium compiles structure once into a compact, AST-proven relational contract outside the LLM context.

  2. Legacy codebases defeat static regex linters

    Traditional architecture linters require hundreds of hand-written folder regexes and fail on contact with legacy code. Graphenium’s Zero-Config Louvain ΔQ Gate accepts your existing legacy complexity as baseline reality while mathematically blocking agents from introducing new modularity decay.

  3. Passing tests do not prove structural integrity

    Standard test suites and type checkers only verify local behavior. An agent can write tangled spaghetti code, bypass domain services, or leave unproved sorry stubs that still pass local unit tests. Graphenium fails the build on architectural drift and unrealized specs.

The missing layer

Syntax, types, and tests are not enough.

Graphenium adds the layer classical tooling never proved: topological, architectural, and epistemic integrity.

Layer Classical tooling What it proves
1 - Lexical & Syntactic rustc, tsc, Tree-sitter Code is syntactically valid.
2 - Type & Memory Safety Type checkers, borrow checkers Local types, signatures, and lifetimes align.
3 - Behavioral Correctness cargo test, pytest Specific inputs produce expected runtime outputs.
4 - Topological, Architectural & Epistemic Integrity Graphenium (gm) Transitive Datalog invariants hold, Louvain modularity (ΔQ) does not decay, formal proof gaps do not taint verified theorems, and physical diffs match an approved Virtual AST spec.

How it works

Compile, specify, prove, and audit in one closed-loop engine.

Step 1 · Before editing

Declare intent on a Virtual AST

Before touching disk, the agent queries Graphenium’s compressed index (~85% fewer tokens than raw file reads) and registers its proposed classes, functions, and dependency edges in an in-memory planning workspace (create_planning_workspace).

Step 2 · Pre-flight

Prove Datalog invariants & Louvain ΔQ

Graphenium’s indexed semi-naive Datalog solver proves whether the Virtual AST bypasses intermediary layers (bypasses_layer), creates cycles, introduces container aliasing hazards (aliased_container_call), or taints formal proofs (tainted_by_proof_gap). Even without a policy.json, the dual-graph Louvain engine rejects plans that decay modularity (ΔQ).

Step 3 · After edits

Audit realized nodes, edges & git scope

Once the agent writes physical code, gm check --plan and MCP verify_changes audit physical reality against the approved Virtual AST across three dimensions: realized symbols, realized dependency edges, and git/snapshot-diff file scope (blocking scope creep).

Step 4 · In CI

Gate snapshot drift & modularity decay

In CI/CD, gm check --delta and gm gate --diff block pull requests that introduce critical community drift, high-surprise cross-boundary shortcuts, or unresolved identifier/proof-gap ambiguities - and emit a risk-sorted verification plan for human reviewers.

Graphenium Core

The local relational codebase compiler and containment engine.

The MIT-licensed Rust engine compiles 10 languages - Rust, Python, Go, TypeScript, JavaScript, Java, C, C++, C# (with recursive .sln/.csproj assembly discovery), and Lean 4 - into strongly typed Datalog EDB relations (node, calls, imports, inherits, implements, contains, degree, hub) using Tree-sitter and import-scoped Stack Graphs.

quick start
$ gm init
$ gm run . --no-semantic --no-viz
$ gm doctor --graph graphenium-out/graph.json --resolution
$ gm query "authentication flow" --budget 2000
$ gm check --delta --plan refactor-auth
0
cloud required for Core

AST + Stack Graphs + Datalog + Louvain ΔQ · MIT

100% offline Tier 1 compilation: AST + import-scoped Stack Graphs + Datalog + Louvain ΔQ with zero API keys required.

In-memory Virtual AST workspaces: eliminate agent trial-and-error rewrite deadlocks by returning exact topological counterexamples before disk writes.

Indexed semi-naive Datalog stdlib: up to 10M EDB facts; built-in predicates for transitive reachability, layer bypasses, container aliasing, dead code, and Lean 4 proof taint.

Epistemic trust gating: agents are mechanically blocked from editing unverified targets or ignoring symbol collisions.

Epistemic Trust Model

Agents must know the difference between compiler facts, heuristics, and proof gaps.

Probabilistic vector search treats fuzzy similarity guesses as equal to compiler imports. Graphenium attaches explicit provenance and active gating policies to every edge in the index.

auth session api token tests
EXTRACTED

AST-proven compiler facts

Planning backbone. Discovered deterministically by Tree-sitter, import-scoped Stack Graphs, or .sln/.csproj parsers. Safe for automated change planning.

INFERRED

structural & semantic heuristics

Exploratory leads. Call-graph heuristics or optional semantic inferences. The agent is blocked from modifying these targets until it reads the implementation source files directly.

AMBIGUOUS

identifier collisions & formal proof gaps

Risk gated. Unresolved multi-target symbol collisions or Lean 4 sorry / admit proof gaps. Rejects automated edits and forces disambiguation or proof completion in CI.

Graphenium Gate

Automated PR and CI architectural containment.

Gate is the commercial CI/CD control layer. It automates pre-flight policy and Datalog checks, runs zero-config Louvain modularity delta (ΔQ) audits on every pull request, enforces 3-dimensional post-edit compliance (nodes, edges, and git scope), and posts risk-sorted verification plans directly to your PRs.

  • Transitive Datalog policy & layering proofs per PR
  • Zero-drift Louvain modularity delta (ΔQ) & surprise edge audits
  • Post-edit node, edge, and git-diff scope-creep blocking
  • Risk-sorted verification plans (must-read files, affected callers, covering tests)
Graphenium Gate · Pre-flight & ΔQ

BLOCK — Pre-flight spec & topological violation

block
blast radius14 symbols · 3 API routes
modularity deltaΔQ -0.041 (threshold: -0.020)
surpriseperipheral→hub edge score 6.8
datalog proofbypasses_layer · auth_service
post-edit scopenodes · edges · git diff
Pre-flight spec & topology check BLOCK
Graphenium Gate: BLOCK — Pre-flight spec & topological violation

Changed area
  auth/session_manager.rs
  api/middleware/token_guard.rs

Datalog proof
  bypasses_layer('session_ctrl', 'auth_service', 'db_pool')

Modularity delta
  ΔQ -0.041 exceeds tolerance (-0.020)
  Surprise score 6.8 (peripheral→hub)

Post-edit scope
  3 dimensions: nodes · edges · git diff

Request early access

For platform, DevEx, security, and AI tooling teams evaluating merge governance for agent-generated code.

We only use this to contact you about Gate early access. No spam.

Email us instead

Product family

Local relational compiler. CI containment gate. Enterprise control plane.

Start with the open-source local compiler and MCP server, then scale into automated PR governance and organization-wide architectural control.

Open source

Graphenium Core

The MIT-licensed local relational codebase compiler and spec-driven containment engine. Compile polyglot ASTs, manage Virtual AST workspaces, and run Datalog and Louvain ΔQ gates offline.

  • 10-language AST + Stack Graphs compiler
  • Virtual AST workspaces & embedded Datalog solver
  • Zero-config Louvain ΔQ modularity gate offline
Open on GitHub →
Commercial

Graphenium Gate

PR and CI containment gating. Automate Datalog policy proofs, block PR scope creep and missing planned edges, run relative modularity delta (ΔQ) audits, and generate risk-sorted review plans in CI/CD.

  • GitHub / CI automated PR gates
  • Modularity delta (ΔQ) & surprise audit per PR
  • 3-way post-edit realization & scope-creep blocking
Request access →
Enterprise

Graphenium Enterprise

Organization-wide architectural governance for high-velocity AI engineering: centralized policies, audit history, multi-repo graph registry, SSO, RBAC, and self-hosted deployment.

  • Central policy & compliance audit console
  • Cross-repo blast radius & dependency registry
  • Private cloud and self-hosted deployment
Talk to us →

Agent-native interfaces

Works where coding agents and reviewers already operate.

Use Graphenium locally through the CLI, expose sub-50ms topological queries and Virtual AST gates through MCP, then enforce the exact same contract in PRs and CI.

12 MCP tools
10 language families
0 cloud required for Core

For orientation & pathfinding

get_graph_info, get_architecture_summary, query_graph, inspect_symbol, trace_path

For Virtual AST specs

create_planning_workspace, add_planned_symbol, validate_plan, run_datalog

For post-edit audits & review

verify_changes, mutate_graph, reload_graph

Direct skill injection

Install scripts copy Graphenium’s operational skill (SKILL.md) directly into Claude Code’s native skill directory (~/.claude/skills/graphenium/SKILL.md), training the agent on the four-phase containment loop out of the box.

Quick start

Build your first graph in minutes.

Start local with the MIT Core. No API key is required for the AST, Stack Graphs, Louvain, or Datalog engines.

terminal
$ gm init

$ gm run . --no-semantic --no-viz

$ gm doctor --graph graphenium-out/graph.json --resolution

$ gm query "authentication flow" --budget 2000

$ gm serve --graph graphenium-out/graph.json --watch

The operating principle

AI agents code fast. Graphenium makes their architecture provable.

Graphenium gives AI coding workflows the relational compiler and spec-driven containment gates they need - compressing structural context, enforcing transitive invariants, and failing the build on modularity decay before code reaches production.

Questions about pilots, partnerships, or enterprise use? hello@graphenium.dev

FAQ

Built for serious AI coding adoption.

Is Graphenium another code search or GraphRAG tool?

No. Search and GraphRAG tools use text or fuzzy vector embeddings to help agents find files. Graphenium is a local relational codebase compiler and spec-driven containment engine. It compiles your codebase into AST-proven Datalog facts and Louvain communities - giving agents compact, sub-50ms structural intelligence while mechanically blocking layering bypasses, modularity decay (ΔQ), and scope creep before and after code is written.

How does Zero-Config Topological Delta Gating work on legacy codebases?

Traditional architecture linters fail on legacy codebases because teams don’t want to write hundreds of folder regexes, and existing code already contains technical debt. Graphenium partitions your physical baseline graph and the agent’s proposed Virtual AST in memory, runs Louvain community detection on both, and computes the modularity delta (ΔQ) and surprise edge scores (cross-community, peripheral→hub). It accepts your existing legacy complexity as baseline reality, while mechanically blocking the agent from introducing new structural decay - with zero configuration files required.

What is Graphenium Gate?

Graphenium Gate is our commercial PR and CI/CD governance layer. It enforces pre-flight policy and Datalog invariants, runs relative modularity delta (ΔQ) audits per PR, verifies post-edit realization (nodes, edges, and git-diff scope creep), and generates risk-sorted verification plans for human reviewers.

Does Graphenium send source code to a cloud service?

No. Graphenium Core runs 100% locally and offline by default. The AST, Stack Graphs, Louvain clustering, and Datalog engines require no API keys or network access. Source snippets only leave your machine if you explicitly opt into the optional LLM semantic pass.

Which languages are supported?

Graphenium supports 10 languages: Rust, Python, Go, JavaScript, TypeScript, Java, C, C++, C# (including recursive .sln and .csproj assembly and project-reference boundary discovery), and Lean 4 (including native declaration indexing and sorry/admit formal proof-gap taint auditing).

Who should use it?

Individual developers and teams can run Graphenium Core locally via CLI and MCP today. Platform engineering, DevEx, security, and engineering leadership teams should evaluate Graphenium Gate to enforce merge-time architectural governance on AI-generated pull requests.

Pilot & contact

Talk to us about Graphenium.

For design partners, enterprise pilots, partnerships, or general questions, reach out directly.

hello@graphenium.dev

Design partners, enterprise pilots, partnerships, and general questions.

security@graphenium.dev

Security and vulnerability reports