Back to work / Case study

DeHalu.

A prototype-stage AI code hallucination detection platform using MCP gateways, streaming checks, RAG, GraphRAG, and governance pipelines.

RoleAI Infrastructure / RAG / Gateway Design
Year2026
PlatformAI Infra / MCP / Web
Status Prototype - 30% complete
9
Architecture layers
9
RAG stages
7
Governance stages
30%
Prototype progress

AI coding agents can invent APIs, versions, libraries, and signatures with convincing confidence.

DeHalu is a fast-moving prototype for catching code hallucinations before they become trusted implementation details.

The project is intentionally infrastructure-oriented: it treats hallucination examples, retrieval evidence, stream-time checks, and feedback loops as one system rather than a single classifier.

The design combines an MCP gateway, streaming detection, retrieval, storage, and governance.

  1. G1MCP gateway

    A TypeScript Hono gateway exposes validation, search, analytics, streaming detection, and GraphRAG-oriented tools through MCP-compatible endpoints.

  2. R1Retrieval pipeline

    The planned pipeline routes queries through rewriting, vector search, CRAG checks, reranking, graph context, reflection, summarization, and citation verification.

  3. M1Governance loop

    Submitted hallucinations move through deduplication, AST parsing, quality review, embedding generation, persistence, and graph updates.

The prototype optimizes for extensibility before claiming the model is solved.

Evidence pipelineover Single confidence score

The system is designed to return grounded evidence and citations, not just a binary hallucination label.

Streaming probesover Post-hoc checks only

Some failures should be caught while code is being generated, especially invented identifiers and incompatible versions.

Honest prototype statusover Inflated production claims

The current state is rapid prototype development, with roughly 30% of the planned baseline implemented and the architecture guiding the remaining buildout.

Even as a prototype, the project exercises real AI infrastructure concerns.

MCP tool surface

The gateway shape covers similar-case search, new hallucination submission, streaming detection, analytics, and code validation.

GraphRAG path

LazyGraphRAG and Full GraphRAG phases are planned so the system can scale from low-cost retrieval to richer graph context.

Security model

OAuth 2.1, DPoP, and workload identity are part of the target design for agent-facing infrastructure.

Observability model

OpenTelemetry spans and Prometheus metrics are planned around retrieval, governance, authentication, and evaluation loops.

The next milestone is turning the architecture into a dependable baseline.

  • - Complete the core RAG and governance baseline
  • - Add LazyGraphRAG and stronger MCP transport behavior
  • - Build evaluation gates before expanding model or graph complexity
Next case study
NovaSort
2026 / Adaptive C++20 sorting library