← Back to work
Defense Technology · Retrieval-Augmented Generation · Trust Architecture

Answers you can defend, inside the data boundary.

C2RAG resolves the structural conflict between capable cloud AI and documents that cannot leave the enclave: a federated LLM architecture with local-first inference, dual-tier confidence scoring, virtual-question relevance mathematics, and page-level evidence citations — so every answer arrives with a reliability verdict and one-click links to the source pages that support it.

RAGFederated LLMConfidence ScoringEvidence CitationsDefense
03 / Document Intelligence
Product
C2RAG (Command & Control Retrieval-Augmented Generation)
Service line
AI/ML Engineering
Period
11-month development cycle · August 2025 – July 2026
Distribution
Distribution A — Approved for Public Release

C2RAG is a capability demonstration platform. Every metric below is a measured system property or configuration value from the deployed demonstrator — not a customer outcome. Figures requiring an operational pilot to substantiate are identified as such.

C2RAG operator console showing the confidence and relevance overview for a live query, with yes/no confidence, mean cosine similarity, and retrieved sources.
The C2RAG operator console: yes/no confidence, virtual-question relevance, and retrieved sources with per-page similarity scores — captured live on local inference.
The problem · Trust architecture

An uncited answer cannot enter a decision cycle.

Challenge

Large language models answer fluently whether or not they are correct. In a decision cycle that feeds legal positions, acquisition strategy, or operational planning, that is disqualifying — and three constraints compound it: sensitive data cannot leave the enclave, answers without provenance cannot survive review, and standard LLM output carries no visible reliability signal.

Approach

Each constraint is answered with a specific architectural commitment: local Ollama inference with policy-gated cloud fallback for the data boundary, a five-step step-back reasoning trace for the black box, two independent confidence checks for invisible uncertainty, self-generated virtual questions scored by cosine similarity for answer drift, and integrated PDF.js deep links for provenance.

The design · Five commitments

Every constraint answered with architecture.

01

Federated LLM architecture

Primary inference runs on local Ollama models (Llama 3.1, Phi-3, Mistral) on ~8 GB commodity hardware. Cloud fallback (Gemini) is a configuration choice, disabled entirely for air-gapped operation. Documents, embeddings, and the vector store never leave local infrastructure.

02

Structured step-back reasoning

Every query executes a five-step framework: restate the question, identify needed information, evaluate retrieved context, rate confidence, then answer. The full reasoning trace is retained and inspectable — auditable analysis, not oracle output.

03

Dual-tier confidence scoring

Two independent checks run on every answer: the five-point internal rating from the reasoning framework, and a separate binary yes/no verdict with percentage confidence from a second LLM pass. Disagreement between the tiers is itself a signal.

04

Virtual-question relevance

The system generates three paraphrased virtual questions from its own answer and computes mean cosine similarity back to the original query embedding — a mathematical check that the answer addresses what was actually asked.

05

Page-level evidence citations

Each answer carries its retrieved sources with per-document similarity scores and deep links that open the source PDF at the cited location via an integrated PDF.js viewer. The distance from claim to evidence is one click.

Measured properties

What the demonstrator measures.

These are system properties and configuration values, not customer outcomes. Operational metrics require the structured pilot identified below.

local inference available
100%

Zero data egress in air-gapped configuration; cloud fallback is opt-in policy, not dependency.

independent confidence checks
2

Five-point internal rating plus a binary yes/no verdict with percentage, per answer.

virtual questions per answer
3

Scored by mean cosine similarity against the original query, 0–1 scale to three decimals.

live-tunable retrieval params
7

Real-time quality feedback replacing hard-coded pipeline behavior.

reasoning trace
5-step

Retained and inspectable on every query.

RAM footprint
~8 GB

Commodity hardware on Windows, Linux, or macOS — no accelerator dependency.

local model options
3

Llama 3.1, Phi-3, Mistral — provisioned by a single setup script.

to cited source page
1-click

Page-level citation on every retrieved source via integrated PDF viewer.

Live demonstration · Three queries

Three queries, three safeguards caught on camera.

Unedited assessments from three consecutive live queries against the CRS directed-energy-weapons report, on local inference with zero cloud involvement. Each run exposed a different safeguard working — including a system willing to say the evidence does not support an answer.

Query 1 · The judge catches a narrow answer

What are the main types of directed energy weapons discussed in the document?

Relevance
0.814
0.791 / 0.882 / 0.768
Confidence
NO (90%)

The answer fixated on a single program (THOR) instead of the full HEL/HPM program overview the document provides — and the independent judge caught it.

Sources: p. 3 (0.679), p. 5 (0.676)
C2RAG scoring panel for query 1: relevance 0.814, confidence NO 90%, retrieved sources on pages 3 and 5.
Query 2 · Strong retrieval, held to a higher standard

What challenges does the Department of Defense face in developing and fielding directed energy weapons?

Relevance
0.781
0.836 / 0.731 / 0.777
Confidence
NO (80%)

The answer named four challenge categories — technological maturity, industrial-base stability, funding adequacy, arms-control implications — but the judge demanded they be enumerated in detail, not summarized.

Sources: p. 5 (0.730), p. 22 (0.717)
C2RAG scoring panel for query 2: relevance 0.781, confidence NO 80%, retrieved sources on pages 5 and 22.
Query 3 · Weak evidence, no fabrication

What does the document say about using directed energy weapons against drones and unmanned aircraft systems?

Relevance
0.761
best retrieval only 0.275 / 0.233
Confidence
NO (82%)

With retrieval scores collapsed, the system declined to overclaim: "the available information does not allow for a comprehensive assessment of their current use or planned applications." A system that can say the evidence doesn't support an answer is worth more than one that always answers.

Sources: p. 27 (0.275), p. 19 (0.233)
C2RAG scoring panel for query 3: relevance 0.761, confidence NO 82%, weak retrieval scores.

Two separate checks must agree before an answer is trusted — and when they don't, that disagreement is the most valuable signal in the system.

The operator surface

One dark-theme console, everything in view.

Full C2RAG operator console with the answer, confidence and relevance panels, and retrieved evidence cards.
The full operator surface: answer, dual-tier confidence, relevance mathematics, and evidence cards in one dark-theme console.
Close view of the C2RAG confidence and relevance scoring panels.
The scoring detail: binary yes/no verdict with justification beside the virtual-question relevance breakdown.
Implementation · Four phases

From prototype to defense-market demonstrator.

Phase 1

Core pipeline

RAG pipeline on LangChain/LangGraph with resilient ingestion (UnstructuredLoader with pypdf fallback), local embedding, vector retrieval, and the initial confidence-scoring framework.

Phase 2

Federation & hardening

Ollama integration with automated model provisioning, cloud-fallback policy layer, service-health monitoring for the PDF viewer and document servers, and CORS-safe deep-linking infrastructure.

Phase 3

Calibration & configurability

All retrieval hyperparameters externalized as live operator controls, plus real-time retrieval-quality telemetry with per-query similarity distributions and automated tuning recommendations.

Phase 4

Defense-market productization

A complete brand system applied across the console: dark Command Black theme, status instrumentation, evidence-card presentation, accessibility-checked contrast, an automated test suite, and a modular package structure.

Lessons learned
  • Trust is an architecture, not a disclaimer

    Reliability signals had to be first-class pipeline outputs — confidence tiers, relevance mathematics, citations — not a warning label retrofitted onto a fluent-but-opaque model.

  • Two cheap checks beat one expensive one

    A self-assessment plus an independent second-pass verdict catches failure modes neither catches alone, at the cost of one lightweight extra inference.

  • Expose the dials

    Externalizing retrieval hyperparameters turned tuning from a code-change cycle into an operator activity; live telemetry turned "the answers seem worse" into a diagnosable condition.

  • Presentation is a capability

    The defense-market UI overhaul, initially scoped as cosmetic, materially changed how the system was perceived in evaluation. A tool that must be trusted must look like it was built by people who take trust seriously.

  • Honest metrics build more credibility

    Distinguishing measured system properties from projected operational outcomes — rather than blending them — is itself a differentiator with technically sophisticated defense audiences.

Recommended next steps
  • Structured pilot with baseline measurement: time-to-answer, verification effort, and answer-acceptance rate against the current manual workflow.
  • Classification-aware deployment profile with distribution-marking support and enclave-specific configuration baselines to shorten accreditation.
  • Corpus scaling validation against document sets in the 10⁴–10⁵ range typical of program-level holdings.
  • Confidence-calibration study measuring how often the binary verdict agrees with human expert judgment — the single most persuasive artifact for a skeptical evaluator.

Commanding Intelligence. Ground Truth at Scale.

Live-query assessments captured July 6, 2026 against the Congressional Research Service report on DoD Directed Energy Weapons, on local qwen2.5:3b inference with zero cloud involvement. All figures are measured system properties or configuration values; operational-outcome metrics require a structured pilot and are identified as the next step.

Evaluating generative AI for sensitive document workflows?

If your holdings can't go to the cloud and your answers have to survive review, start with a free consultation. We can scope a data-boundary architecture and a confidence-calibration pilot around your environment.

Book a Free Consultation