This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle
An open-source, zero-persistence evidence engine (MCP-native, built around open-weight Gemma, Llama and Mistral) that turns AI's confident guesses into verified, billable facts.
In Greek myth, Argus Panoptes was the giant who never fully slept: a hundred eyes, always watching. A prism takes a single beam of light and shows every colour hidden inside it.*
ARGUS PRISM does both for a claim. It watches the whole web, then splits one confident sentence into the evidence behind it: who said it, how recent it is, who disagrees, and how sure we can be.
The promise: Don't trust the confidence. Audit the claim.
| 🔗 | Link |
|---|---|
| Live demo | argus-prism-studio.onrender.com |
| Code | github.com/akshara-a/ARGUS-PRISM |
| Partner categories entered | Render · Gemma · Backboard · ElevenLabs · Sentry Agent Tracing · SerpApi |
The sentence that broke production
Picture this. It's Thursday night and a team is finalising a migration RFC. The draft says:
"Next.js 15 continues to support React 18 in production, and LegacyAPI v1 is recommended for high-load clusters."
Someone asks an AI assistant to confirm it. The answer comes back instantly, fluent and cheerful:
"Yes, absolutely! LegacyAPI v1 is a battle-tested, rock-solid solution. You can safely deploy this to production."
Every word of that is wrong. The assistant was echoing a pile of 2022 blog posts, which rank well and are badly out of date. The official 2026 changelog says LegacyAPI v1 was removed. The RFC merges, the deploy goes out, and the app crashes at runtime.
(This scenario is the illustrative one from the project's own agent walkthrough, docs/AGENT_WALKTHROUGH.md. The library names are fictional test fixtures.)
Nothing in that chain was malicious. The AI wasn't lying. It was confident, and confidence is cheap.
That is the gap ARGUS PRISM closes.
TL;DR
| What | A fact-verification engine for technical writing and AI answers. |
| How it decides | Deterministic math, not vibes: source tiers × time decay × contradiction detection × Bayesian scoring. |
| What makes it different | When sources disagree, it hunts down the primary source and settles the dispute itself. |
| Open-source AI inside | Gemma 2 (local via Ollama), Llama 3 and Mistral 7B (via Backboard), and a TabPFN-style Bayesian uncertainty oracle. No closed API is required. |
| Privacy | Zero persistence. Your draft is never written to disk, a database, or logs. |
| Who pays | Ghostwriters, docs agencies, DevRel teams, and migration reviewers. They get a branded Verified certificate, a corrected draft, and a spoken debrief. |
| For agents | 15 MCP tools. Any agent can call "verify before you answer." |
| Try it | Live Studio, or uv run python backend/demo.py locally. No API keys needed. |
| Proof | 7/7 benchmarks and 82/82 unit tests, with the benchmarks finishing in about 0.21 s. |
What happens when ARGUS reads the same sentence
flowchart LR S["❝ LegacyAPI v1 is recommended<br/>for high-load clusters ❞"] --> A["👁 ARGUS PRISM"] A --> P1["2022 blog (Tier 3 × 0.5)<br/>decayed by e^(−λt) → nearly weightless"] A --> P2["2026 official changelog (Tier 1 × 1.5)<br/>fresh → heavyweight"] P1 & P2 --> X{"⚔ Contradiction"} X --> T["Tie-breaker search<br/>aimed at primary sources"] T --> R["❌ REFUTED"] R --> F["✅ Corrected sentence<br/>with citation + git-style diff"] R --> D["⛓ Dependent claims<br/>downgraded automatically"] The output: a score with honest ±σ% error bars, a claim-by-claim ledger with citations, a red/green diff, a client-ready certificate, and a 60-second voice briefing, all produced from RAM and none of it stored.
What Sets It Apart
- It argues with itself, and that is the point. It runs an optimistic search, a skeptical search, and a temporal search, then lets the evidence fight it out.
- It shows its work. Every score has a formula, every claim has a URL, and identical input gives bit-identical output. You can audit the auditor.
- It is a real side hustle, not a demo. The CLI turns a client draft into a billable deliverable, including a time-saved figure for the invoice.
- It is built on open parts. Local Gemma, three open-weight models cross-examining each other, and a pluggable connector design anyone can extend.
- It plugs into the agent ecosystem on day one. It speaks MCP, so Claude Desktop, Cursor, and the MCP Inspector can use it with no glue code.
How the Pieces Fit Together
ARGUS PRISM is a single pipeline in which every open-source or partner component has one clear job. Nothing is bolted on.
flowchart LR IN["Draft or live URL"] --> EX["Extract claims<br/>Gemma 2 local / regex"] EX --> SR["Gather evidence<br/>SerpApi: Web, Scholar, News<br/>or DuckDuckGo"] SR --> MATH["Deterministic scoring<br/>tiers x decay x Bayes"] EX --> BB["Cross-examine<br/>Backboard: Llama 3, Mistral, Gemma 2"] BB --> MATH MATH --> OUT["Verdict + diff + certificate"] OUT --> EL["Spoken debrief<br/>ElevenLabs"] MATH -. spans and latency .-> SEN["Sentry agent tracing"] OUT --> RND["Served from Render<br/>API, Web Studio, Dashboard"] | Pipeline stage | Technology | Role |
|---|---|---|
| Extract | Gemma 2 via Ollama | Local claim extraction, so private drafts stay on the machine |
| Retrieve | SerpApi or DuckDuckGo | Live Google Web, Scholar, and News telemetry for the evidence pool |
| Cross-check | Backboard | One key reaches Llama 3, Mistral, and Gemma 2 for an agreement ratio |
| Score | Deterministic kernel | Source tiers, freshness decay, contradiction detection, Bayesian update |
| Deliver | ElevenLabs | A 60-second spoken debrief with three personas |
| Observe | Sentry | Spans for each pipeline stage, plus latency and cost visibility |
| Ship | Render | A blueprint that deploys the API, the Web Studio, and the dashboard |
1. What I Built
1.1 The problem
LLMs write fluent text that is often wrong. They state outdated facts, such as an API removed last quarter, with total confidence. Single-pass RAG makes this worse. It retrieves the top-ranked pages, and those are often SEO-heavy 2022 tutorials that contradict the current changelog.
This hurts a specific group of people who get paid for correctness:
| Who | What goes wrong for them |
|---|---|
| Technical ghostwriters and freelance writers | A single wrong version number in a client's article costs credibility and sometimes the contract. |
| DevRel and docs agencies | They ship tutorials that must not break on copy-paste. |
| Due-diligence reviewers and consultants | They sign off on migration RFCs. |
| AI agent builders | They need a trustworthy "verify before you answer" tool. |
1.2 The solution
ARGUS PRISM treats search engines as telemetry streams. It does not ask an LLM whether a claim "seems right." It computes a verdict with explicit, reproducible math:
| Idea | How it works |
|---|---|
| Source credibility tiers | Official registries and docs count 1.5x, community hubs 1.0x, and SEO blogs 0.5x. |
| Temporal decay | Evidence ages as e^(-λt), with λ inferred from how fast the domain moves. |
| Contradiction detection | Opposing polarities on the same entity are flagged. |
| Self-correcting loop | On a high-severity conflict, it runs a tie-breaker search against primary sources. |
| Evidence DAG | If claim A refutes claim B and C depends on B, C is downgraded too. |
| Bayesian uncertainty oracle (TabPFN-style) | Every score ships with calibrated ±σ% bounds. |
| Auto-fixer | Refuted claims are rewritten with primary citations and shown as a git-style diff. |
1.3 Who would pay, and why
flowchart LR subgraph Buyers["Who pays"] A["Freelance technical writers<br/>& ghostwriters"] B["DevRel / docs agencies"] C["Engineering managers<br/>(migration RFC review)"] D["AI agent developers"] end subgraph Deliverables["What they get"] E["Client Verification Certificate<br/>(HTML, print-ready)"] F["Evidence Dossier"] G["Verified badge (SVG)<br/>for README / Substack"] H["Spoken 60s audio debrief"] I["Corrected draft<br/>+ git-style diff"] J["MCP tool: verify-before-answer"] end A --> E & G & I B --> F & E & I C --> F & H D --> J 1.4 The side-hustle business model
A freelancer runs a client's draft through ARGUS PRISM and delivers a branded certificate plus a corrected draft. The CLI tracks the time saved against a manual fact-check (priced at $50/hr in the report) so the value is visible on the invoice.
flowchart LR Client["Client sends draft"] --> Run["Freelancer runs<br/>argus validate --file draft.txt"] Run --> Score["Integrity score ±σ%<br/>claim ledger + citations"] Score --> Fix["Auto-fix: refuted claims<br/>replaced with primary sources"] Fix --> Pack["Package: Certificate + Dossier<br/>+ Badge + Audio debrief"] Pack --> Invoice["Invoice: 'Fact-check & Verification Audit'<br/>(manual hours saved shown)"] Invoice --> Repeat["Retainer / per-article pricing"] Illustrative pricing ladder (suggested, not market-tested):
| Tier | Deliverable | Idea |
|---|---|---|
| Per-article audit | Certificate + corrected draft | One-off, per piece |
| Monthly retainer | N audits + dossiers + badges | For agencies and newsletters |
| Migration RFC review | Dossier + stack comparison + audio debrief | Higher-value, one-off consulting |
| API / MCP seat | Self-hosted, open source | Agent builders |
These prices are illustrative starting points to validate with real clients. They are not market-tested figures.
1.5 Feature map
mindmap root((ARGUS PRISM)) Verification Core GoF State Machine, 6 states Credibility tiering Freshness decay e^-λt Contradiction detector Tie-breaker self-correction Evidence DAG and transitive invalidation Bayesian posterior Open-Weight AI Gemma 2 via Ollama Backboard tri-model arena Llama 3 8B Mistral 7B Gemma 2 9B TabPFN-style uncertainty oracle Regex fallback with no model Deliverables Client certificate Evidence dossier SVG badge Academic export, footnotes, IEEE/APA Spoken debrief, ElevenLabs Git-style diff auto-fix Interfaces MCP server, 15 tools FastAPI REST, 12 endpoints Next.js 16 Web Studio Streamlit explorer CLI Operations Cost-Guard two-tier cache Sentry tracing Zero persistence SSRF, XSS, CSP hardening Docker, Render, GitHub Actions 2. Demo
2.1 Links
| Asset | Link |
|---|---|
| Live app (Web Studio) | argus-prism-studio.onrender.com |
| API health check | argus-prism-api.onrender.com/api/health |
| Telemetry dashboard (Streamlit) | argus-prism-dashboard.onrender.com |
| Source code | github.com/akshara-a/ARGUS-PRISM |
Try the Studio in under a minute:
- Open the Studio.
- Click one of the six enterprise presets:
FastAPI Concurrency,Kafka KRaft Consensus,PyTorch 2.5 Inductor,OAuth 2.1 Security,LegacyAPI v1 Stale Spec, or theQuantumReactJS Trap. - Pick a provider (DuckDuckGo, SerpApi, or the offline Mock Engine), a search engine (Web, Scholar, or News), and an extractor (regex, Gemma 2, or tri-model).
- Press Run Deterministic Factual Audit.
The free-tier host sleeps when idle, so the first request can take a short while to wake. The Studio also has a Mock Engine for deterministic offline runs, and the presets are meant to show the range from verified to hallucinated.
2.2 Five-second quickstart
No API keys needed. The offline path uses the mock provider and the regex extractor.
git clone https://github.com/akshara-a/ARGUS-PRISM cd "ARGUS-PRISM" uv venv && uv pip install -e . uv run python backend/demo.py # hallucination trap, contradiction catch, # cost-guard economics, comparison, HTML dossier uv run python backend/evaluate.py # 7/7 benchmark checks 2.3 Demo storyline
sequenceDiagram autonumber actor W as Freelance writer participant UI as Web Studio (Next.js) participant API as FastAPI participant ENG as ARGUS Engine participant WEB as Search provider participant AI as Open models W->>UI: Paste draft or a live docs URL UI->>API: POST /api/validate API->>ENG: run 6-state pipeline ENG->>WEB: optimistic, skeptical, temporal queries WEB-->>ENG: raw documents (cached by Cost-Guard) ENG->>AI: extract claims, triangulate models, uncertainty ENG->>ENG: tier, decay, detect conflict, tie-break ENG-->>API: score ±σ%, claim ledger, DAG API-->>UI: report + audio (base64, in-RAM) UI-->>W: gauge, claim cards, red/green diff W->>UI: Apply Fixes, then Download Certificate 2.4 What you will see
| # | Moment | What happens |
|---|---|---|
| 1 | Hallucination trap | A made-up library (QuantumReactJS) scores 0.0% with an empty claim ledger. |
| 2 | Contradiction catch | A stale 2022 tutorial says LegacyAPI v1 is fine. A 2026 changelog says it is removed. ARGUS decays the tutorial, runs a tie-breaker query, elevates the changelog, and marks the old claim REFUTED. |
| 3 | Auto-fix diff | Red strikethrough for the false claim and green for the grounded replacement. One click applies it to the editor. |
| 4 | Certificate modal | A live HTML preview in a sandboxed iframe, ready to download. |
| 5 | Voice persona switch | Rachel, Adam, or Drew reads the 60-second debrief. |
3. Code
3.1 Repository
ARGUS PRISM
Deterministic Evidence Intelligence Layer via Model Context Protocol (MCP)
Autonomous Hallucination Elimination & Deterministic Evidence Intelligence Engine
🎯 Executive Summary
Modern AI agents suffer from an over-reliance on single-pass retrieval, leading to hallucination disguised as confidence. ARGUS PRISM solves this by treating live search APIs (SerpApi) as pluggable telemetry streams to mathematically validate, contradict, and score AI claims.
Instead of subjective LLM summaries, ARGUS PRISM evaluates assertions with deterministic mathematics, source credibility tiering, temporal exponential decay, multi-hop entailment graph topology, and autonomous self-correcting tie-breaker search loops.
The full architecture specification and developer documentation are located in docs/.
🌐 Next.js 16 Web Studio & Autonomous Remediation
ARGUS PRISM delivers both an open-standard MCP 2.x server for autonomous agents and an executive zero-login Next.js 16 Web Studio for human creators, technical ghostwriters, and due-diligence reviewers:
- 🔬 100% Zero-Persistence Architecture (TabPFN + Backboard): Evaluates drafts strictly in volatile…
Link: github.com/akshara-a/ARGUS-PRISM
| Folder | Contents |
|---|---|
backend/src/argus/engine/ | State machine, scoring, contradiction detector, DAG engine, auto-fixer, exporters |
backend/src/argus/llm/ | Gemma (Ollama) and Backboard clients |
backend/src/argus/providers/ | ISearchProvider, DuckDuckGo, SerpApi, mock, and the two-tier cache |
backend/src/argus/mcp/ | MCP server: 15 tools, 4 resources, 3 prompts |
backend/src/argus/api/ | FastAPI REST server |
backend/src/argus/audio/, observability/ | ElevenLabs client and Sentry tracer |
frontend/ | Next.js 16 Web Studio |
tests/ | 82 pytest tests |
docs/, learnings.md | API reference, connector SDK guide, deployment, full architecture write-up |
Dockerfile, render.yaml, .github/workflows/ci.yml | Container, Render blueprint, CI |
3.2 Quality gates
| Gate | Result |
|---|---|
Benchmark harness (backend/evaluate.py) | 7/7 pass in about 0.21 s |
Unit tests (pytest) | 82/82 pass |
| CI | GitHub Actions |
| Offline operation | Full run with no API keys |
4. How I Built It
The build is described in seven parts: architecture, scoring math, reasoning, the open-weight AI layer, platform services, interfaces, and hardening and delivery.
Part A: Architecture
4.1 System architecture
flowchart TB subgraph Clients["Clients"] WEB["Next.js 16 Web Studio"] ST["Streamlit Explorer"] CLI["CLI"] AGENT["AI Agents<br/>Claude Desktop, Cursor, any MCP client"] end subgraph Surface["Interface layer"] REST["FastAPI REST"] MCP["MCP 2.x Server<br/>15 tools, 4 resources, 3 prompts"] end subgraph Core["ARGUS Deterministic Kernel"] SM["GoF State Machine<br/>(6 master states)"] EXT["Claim Extractor"] SC["Scoring: tiers x decay x Bayes"] CON["Contradiction Detector"] GR["Evidence DAG Engine"] FIX["Auto-Fixer"] EXP["Exporters<br/>dossier, certificate, badge, academic"] end subgraph Providers["Pluggable connectors (open interfaces)"] DDG["DuckDuckGo (free, no key)"] SERP["SerpApi: Web, Scholar, News"] MOCK["Mock (offline, CI)"] CACHE[("Cost-Guard cache<br/>LRU RAM + SQLite")] end subgraph AI["Open-weight AI connectors"] GEM["Gemma 2 local (Ollama)"] BB["Backboard: Llama 3, Mistral, Gemma 2"] TAB["TabPFN-style<br/>Bayesian oracle"] RX["Regex fallback"] end subgraph Side["Side channels"] EL["ElevenLabs TTS<br/>(ephemeral base64)"] SEN["Sentry tracing"] end WEB & ST & CLI --> REST AGENT --> MCP REST & MCP --> SM SM --> EXT --> SC --> CON --> GR --> FIX GR --> EXP SM <--> CACHE CACHE <--> DDG & SERP & MOCK EXT -.-> GEM & RX SC -.-> TAB CON -.-> BB REST -.-> EL SM -.-> SEN 4.2 The six master states (GoF State pattern)
Every run walks the same deterministic path. Transitions are explicit, and there is exactly one tie-breaker recursion. This is why identical inputs produce bit-identical scores.
stateDiagram-v2 [*] --> STATE_INITIALIZED STATE_INITIALIZED --> STATE_PLANNING: configure(topic, domain, lambda) state STATE_PLANNING { [*] --> OptimisticVector OptimisticVector --> SkepticVector SkepticVector --> TemporalVector TemporalVector --> [*] } STATE_PLANNING --> STATE_GATHERING: vectors_ready state STATE_GATHERING { [*] --> ProviderDispatch ProviderDispatch --> Normalize Normalize --> Dedupe Dedupe --> [*] } STATE_GATHERING --> STATE_EVALUATING: documents_normalized state STATE_EVALUATING { [*] --> ExtractClaims ExtractClaims --> CredibilityTiering CredibilityTiering --> FreshnessDecay FreshnessDecay --> DetectContradictions DetectContradictions --> [*] } STATE_EVALUATING --> STATE_CONFLICT_RESOLUTION: high_severity_conflict [depth < 1] STATE_EVALUATING --> STATE_REPORTING: no_conflicts state STATE_CONFLICT_RESOLUTION { [*] --> TieBreakerQuery TieBreakerQuery --> TargetedSearch TargetedSearch --> ReEvaluate ReEvaluate --> ReconcileOrFlag ReconcileOrFlag --> [*] } STATE_CONFLICT_RESOLUTION --> STATE_REPORTING: depth == 1 state STATE_REPORTING { [*] --> BuildDAG BuildDAG --> Synthesize Synthesize --> GlobalConfidence GlobalConfidence --> EvidenceReport EvidenceReport --> [*] } STATE_REPORTING --> STATE_COMPLETED: payload_validated STATE_COMPLETED --> [*] | State | Job |
|---|---|
STATE_INITIALIZED | Receive topic, domain, and decay constant |
STATE_PLANNING | Build the optimistic, skeptical, and temporal query vectors |
STATE_GATHERING | Dispatch to the provider, normalise documents, deduplicate |
STATE_EVALUATING | Extract claims, tier sources, apply decay, detect contradictions |
STATE_CONFLICT_RESOLUTION | One bounded tie-breaker round against primary sources |
STATE_REPORTING | Build the DAG, synthesise, compute global confidence, emit the report |
4.3 Claim lifecycle
stateDiagram-v2 [*] --> WEAK: extracted, uncorroborated or stale (score < 50) WEAK --> VERIFIED: multi-domain corroboration, score >= 70, no conflict WEAK --> CONTESTED: opposing polarity found VERIFIED --> CONTESTED: fresher conflicting source CONTESTED --> VERIFIED: tie-breaker confirms CONTESTED --> REFUTED: Tier 1 doc overrules REFUTED --> [*] VERIFIED --> [*] | State | Meaning |
|---|---|
🟢 VERIFIED | Score ≥ 70, multi-domain corroboration, no active conflict |
🟡 CONTESTED | Opposing sources, under tie-breaker evaluation or flagged unresolved |
🔴 WEAK | Score < 50: stale, uncorroborated, or unverified origin |
❌ REFUTED | Overruled by fresher Tier 1 documentation |
Part B: The scoring math
4.4 Credibility tier weight W(d)
| Tier | Multiplier | Examples |
|---|---|---|
| Tier 1, authoritative | 1.5x | github.com, gitlab.com, docs.*, learn.microsoft.com, python.org, pypi.org, npmjs.com, kubernetes.io, ietf.org, w3.org, .gov, .edu |
| Tier 2, community | 1.0x | stackoverflow.com, stackexchange.com, lwn.net, dev.to, news.ycombinator.com, arxiv.org, infoq.com, engineering blogs |
| Tier 3, unverified | 0.5x | Medium, SEO listicles, generic web |
4.5 Freshness decay
DecayMultiplier(t) = e^(−λ · t) t = document age in months | Domain velocity | λ | Approx. half-life | Typical examples |
|---|---|---|---|
| Fast: AI and web frameworks | 0.35 | about 2 months | LLM tooling, JS frameworks |
| Cloud and orchestration | 0.22 | about 3 months | Docker, Kubernetes, cloud APIs |
| Core systems and protocols | 0.05 | about 14 months | POSIX, Linux syscalls, RFCs |
xychart-beta title "Evidence weight vs. document age (decay multiplier)" x-axis "Age in months" [0, 3, 6, 12, 18, 24] y-axis "Multiplier" 0 --> 1 line [1.0, 0.35, 0.12, 0.015, 0.002, 0.0002] line [1.0, 0.52, 0.27, 0.07, 0.02, 0.005] line [1.0, 0.86, 0.74, 0.55, 0.41, 0.30] Lines, top to bottom at 3 months: systems λ=0.05, cloud λ=0.22, fast λ=0.35. These values are computed from the formula, not measured.
4.6 Conflict discount and Bayesian update
Proportional conflict discount (instead of zeroing a claim on the first dispute):
DiscountedScore = RawScore × max(0.40, 1.0 − 0.15 × n_conflicts) Bayesian update:
P(H|E) = P(E|H) · P(H) / P(E) 4.7 Score pipeline per claim
flowchart LR D["Retrieved document"] --> T["Tier weight W(d)<br/>1.5 / 1.0 / 0.5"] D --> A["Age t (months)"] A --> E["Decay e^(−λt)"] T --> M(("×")) E --> M M --> C["Corroboration<br/>(independent domains)"] C --> B["Bayesian posterior<br/>P(H|E)"] B --> X["Conflict discount<br/>max(0.40, 1 − 0.15n)"] X --> TP["Bayesian oracle: P(VER), P(CON), P(REF)<br/>and ±σ%"] TP --> S["Claim score 0–100<br/>+ state"] Part C: Reasoning and self-correction
4.8 Self-correcting tie-breaker loop
This is the core anti-hallucination idea. When sources disagree, ARGUS does not average them. It goes and finds a primary-source answer.
flowchart TD S["Claim extracted"] --> V1["Optimistic query<br/>(general web)"] S --> V2["Skeptic query<br/>(issues, PRs, deprecations)"] S --> V3["Temporal query<br/>(release notes, changelog)"] V1 & V2 & V3 --> POOL["Document pool"] POOL --> SCORE["Tier x decay scoring"] SCORE --> Q{"High-severity<br/>contradiction?"} Q -- No --> REP["Report"] Q -- Yes --> DEPTH{"depth < 1 ?"} DEPTH -- No --> FLAG["Flag as CONTESTED / unresolved"] DEPTH -- Yes --> TB["Generate tie-breaker query<br/>aimed at Tier 1 primary docs"] TB --> RS["Targeted search"] RS --> RE["Re-evaluate claims"] RE --> WIN{"Fresher Tier 1<br/>overrules?"} WIN -- Yes --> REF["Loser → REFUTED<br/>winner elevated"] WIN -- No --> FLAG REF --> REP FLAG --> REP 4.9 Evidence DAG and transitive invalidation
flowchart LR A["Claim A (2026 changelog):<br/>'LegacyAPI v1 removed Mar 2026'<br/>VERIFIED"] B["Claim B (2022 blog):<br/>'LegacyAPI v1 is production-ready'<br/>REFUTED"] C["Claim C:<br/>'High-load clusters should use v1'<br/>depends on B"] D["Claim D:<br/>'Migrate to UnifiedAPI v2'<br/>ENTAILS from A"] A -- CONTRADICTS --> B C -- REQUIRES --> B A -- TRANSITIVELY_CONTRADICTS --> C A -- ENTAILS --> D classDef good fill:#d1fae5,stroke:#047857,color:#064e3b classDef bad fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f class A,D good class B bad class C warn | Edge type | Meaning |
|---|---|
CONTRADICTS | Direct opposing polarities on the same entity |
REQUIRES | Prerequisite dependency between propositions |
ENTAILS | Logical downstream consequence |
TRANSITIVELY_CONTRADICTS | A refutes B, C depends on B, so C is downgraded with a transitive-risk rationale |
Graph-level metrics:
- Contradiction density = conflicting pairs ÷ total claim pairs (0.0 to 1.0).
- Consensus centrality = corroboration weighted by node degree (0 to 100).
Part D: The open-weight AI layer
4.10 Model layer
flowchart TB IN["Draft text"] --> CHOOSE{"LLM mode"} CHOOSE -->|"--llm gemma"| G["Gemma 2 2B<br/>local via Ollama<br/>0 cost, 0 data leaves machine"] CHOOSE -->|"Backboard key set"| B["Backboard gateway<br/>one key, three open models"] CHOOSE -->|"default / offline"| R["Regex extractor<br/>deterministic, 0.2s"] B --> L["Llama 3 8B"] B --> M["Mistral 7B"] B --> GG["Gemma 2 9B"] L & M & GG --> AGR{"Agreement ratio"} AGR -->|"3 of 3"| OK["3/3 Models Concur"] AGR -->|"2 of 3"| MID["2/3 Concur: review"] AGR -->|"dissent"| HI["High Hallucination Risk"] G --> CL["Structured JSON claims"] R --> CL OK & MID & HI --> CL CL --> ENGINE["Deterministic scoring kernel"] | Path | When it runs | Strength | Trade-off |
|---|---|---|---|
| Gemma 2 2B (Ollama) | --llm gemma | Free, local, private | Small model, can miss subtle claims |
| Backboard tri-model | BACKBOARD_API_KEY set | Real cross-model agreement signal from Llama 3, Mistral, and Gemma 2 | Needs a key and network. Without a key it falls back to a deterministic offline simulation so demos and tests still run. |
| Regex extractor | Default and offline | Instant and fully deterministic | Coarse extraction |
Design principle: open models extract and cross-examine. They never decide the score. The math does. If every model is unavailable, the regex path still works end to end, which keeps CI and the benchmark deterministic.
4.11 Bayesian uncertainty oracle (TabPFN-style)
Each claim becomes a 4-feature vector [W(d), age, corroboration_count, conflict_count] plus its deterministic base score. The oracle turns that into [P(VERIFIED), P(CONTESTED), P(REFUTED)] and an uncertainty interval, shown on the gauge as, for example, 94.5% (±2.4%).
How it actually works, stated plainly: it is a hand-written, closed-form calibrated model. It computes a logit for each class from the features, applies a softmax, and derives ±σ from the entropy of the resulting distribution (bounded between 1.2% and 8.5%). It runs entirely in memory with no download and no GPU.
What it is not: it does not load the pretrained TabPFN network. It is named for the idea, which is a prior-fitted, tabular, in-memory probabilistic classifier. Swapping in the real TabPFN as a drop-in evaluate_claim implementation is on the roadmap.
Part E: Platform services
4.12 Zero-persistence data flow
flowchart LR U["User draft"] -->|HTTPS| API["FastAPI process RAM"] API --> ENG["Engine: transient objects"] ENG --> OUT["Report + base64 audio"] OUT -->|HTTPS| U ENG -. "X no disk write" .-> DISK[("Disk / DB")] ENG -. "X no draft logging" .-> LOG[("Logs")] CACHE[("Cost-Guard cache<br/>search results ONLY")] <--> ENG note1["Cache stores search-query to results,<br/>never user drafts or claims text"] -.-> CACHE Guarantees:
- Drafts and extracted claims live only in process memory for the life of the request.
- No draft is written to disk, SQLite, or logs.
- Audio is streamed as base64 in the HTTP response, with no server-side files.
- The SQLite tier of the cache holds public search results keyed by query. It never holds user drafts.
4.13 Cost-Guard two-tier cache
flowchart LR Q["Search query"] --> T1{"Tier 1: in-memory LRU"} T1 -- hit --> R["Return, sub-millisecond"] T1 -- miss --> T2{"Tier 2: SQLite<br/>.cache/serpapi_cache.sqlite"} T2 -- hit --> P["Promote to LRU, return"] T2 -- miss --> API["Live provider call"] API --> W["Write both tiers"] --> R R --> TEL["Telemetry: hit rate, calls,<br/>USD saved ($0.01/query est.), avg latency"] Benchmark result: 12 repeated requests gave 7 hits, a 58.3% hit rate, and an estimated $0.07 saved. The score stayed identical.
4.14 Deliverables pipeline
flowchart LR REP["Evidence report"] --> DOS["Evidence Dossier<br/>battle cards, claim ledger, formulas"] REP --> CERT["Client Certificate<br/>(HTML, billable time saved)"] REP --> BADGE["SVG badge<br/>GET /api/badge"] REP --> ACAD["Academic export<br/>[^1] footnotes + IEEE/APA"] REP --> FIXD["Auto-fixed Markdown<br/>+ git-style diff"] REP --> AUD["60s audio debrief<br/>Rachel / Adam / Drew"] BADGE --> SNIP["Markdown / HTML snippet<br/>GitHub, Notion, Substack"] ACAD --> PUB["Notion, Substack, Medium,<br/>Ghost, Obsidian"] Part F: Interfaces and integrations
4.15 MCP integration (15 tools)
flowchart LR AG["Agent (Claude Desktop / Cursor / Inspector)"] -->|stdio or SSE| MCPS["ARGUS MCP Server"] subgraph Tools["15 Tools"] T1["validate_response"] T2["execute_research"] T3["execute_targeted_search"] T4["inspect_evidence"] T5["inspect_confidence"] T6["inspect_conflicts"] T7["compare_technologies"] T8["inspect_telemetry"] T9["generate_dossier"] T10["auto_repair_draft"] T11["crawl_and_audit_url"] T12["export_academic_markdown"] T13["generate_verification_badge"] T14["backboard_compare_models"] T15["tabpfn_bayesian_uncertainty"] end subgraph Res["4 Resources"] R1["argus://reports/latest"] R2["argus://conflicts/active"] R3["argus://reports/dossier"] R4["argus://graph/dot"] end subgraph Pr["3 Prompts"] P1["validate_response"] P2["adversarial_fact_check"] P3["migration_risk_audit"] end MCPS --> Tools & Res & Pr Agent before and after:
sequenceDiagram actor Dev participant LLM as Naive LLM participant AG as ARGUS-equipped agent participant AR as ARGUS MCP Dev->>LLM: "Next.js 15 supports React 18 and LegacyAPI v1 is production-ready?" LLM-->>Dev: "Yes, absolutely!" (stale blog bias, WRONG) Dev->>AG: same question AG->>AR: auto_repair_draft(draft, domain) AR->>AR: tier, decay, tie-break to the changelog AR-->>AG: refuted claims + diff + ±σ confidence AG-->>Dev: "Not accurate. v1 was removed (source, date). Corrected text attached." 4.16 REST API (12 endpoints)
| Method | Path | Purpose |
|---|---|---|
| GET | /api/health | Liveness and readiness probe |
| POST | /api/fetch-url | SSRF-safe crawl of a live page |
| POST | /api/validate | Full audit of a draft |
| GET | /api/badge | Embeddable SVG verification badge |
| POST | /api/compare-models | Backboard tri-model comparison |
| POST | /api/bayesian-evaluate | Class probabilities and uncertainty interval |
| POST | /api/export-footnotes | Footnoted Markdown with IEEE/APA references |
| POST | /api/auto-fix | Grounded rewrite plus diff |
| POST | /api/research | Adversarial multi-vector research |
| POST | /api/compare | Head-to-head technology comparison |
| POST | /api/chat | Documentation-anchored assistant |
| GET | /api/telemetry | Cache and cost telemetry |
4.17 Head-to-head comparator
compare FastAPI Django runs two research pipelines and scores each on four dimensions:
| Dimension | What it measures |
|---|---|
| Global evidence confidence | Deterministic score across all sources |
| Authoritative verified claims | Count of Tier 1 verified propositions |
| Operational stability | Inverse of conflict and weak-claim density |
| Ecosystem freshness | Exponentially decayed recency |
quadrantChart title Illustrative comparator output (example shape, not real data) x-axis "Low freshness" --> "High freshness" y-axis "Low evidence confidence" --> "High evidence confidence" quadrant-1 "Strong and current" quadrant-2 "Well-evidenced but aging" quadrant-3 "Weak and stale" quadrant-4 "Fresh but thinly evidenced" "Tech A": [0.78, 0.82] "Tech B": [0.55, 0.88] 4.18 Pluggable connector design
Every external dependency sits behind an interface, so contributors can add engines without touching the kernel:
classDiagram class ISearchProvider { <<interface>> +provider_name str +search(query, ...) list~RawDocument~ } class DuckDuckGoSearchStrategy class WebSearchStrategy class MockSearchStrategy class CustomEnterpriseProvider ISearchProvider <|.. DuckDuckGoSearchStrategy ISearchProvider <|.. WebSearchStrategy ISearchProvider <|.. MockSearchStrategy ISearchProvider <|.. CustomEnterpriseProvider class CredibilityDecorator { +evaluate_source_tier(url) } class SerpApiCache { +get() +put() +telemetry() } class ClaimGraphEngine { +add_claim() +relate() +transitive_invalidate() } class ArgusStateMachine ArgusStateMachine --> ISearchProvider ArgusStateMachine --> CredibilityDecorator ArgusStateMachine --> SerpApiCache ArgusStateMachine --> ClaimGraphEngine | Pattern | Used for |
|---|---|
| State | The six-state pipeline |
| Decorator | Credibility tiers |
| Strategy | Swappable search providers |
| Observer | Traceability drawer |
| Adapter | The SerpApi engines |
Part G: Hardening, delivery, and proof
4.19 Security hardening
flowchart TB subgraph Threats T1["SSRF via URL auditor"] T2["XSS in generated HTML"] T3["Malicious certificate preview"] T4["Wildcard CORS"] T5["SVG stored XSS"] T6["Regex backreference injection"] end subgraph Mitigations M1["is_safe_public_url: DNS pre-resolve,<br/>block loopback, 169.254.169.254, RFC1918,<br/>redirects disabled"] M2["http/https scheme allow-list,<br/>html.escape on every href and content"] M3["iframe sandbox=''"] M4["Origin whitelist + onrender.com regex"] M5["CSP default-src 'none'<br/>+ nosniff on badge"] M6["pattern.sub(lambda _: repl, text)"] end T1 --> M1 T2 --> M2 T3 --> M3 T4 --> M4 T5 --> M5 T6 --> M6 


