Skip to content
tayyab-ilyasPublic

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

Repository files navigation

Nuntio – (Webapp + Browser Extension)

Nuntio is a local-first AI pipeline for evidence-backed claim verification. It ingests arbitrary sources (news articles, social posts), extracts factual claims, retrieves cross-source evidence via search, builds truth vectors using semantic stance weighting, and returns a continuous truth score for each claim. No external AI APIs. No OpenAI. Fully local and inspectable.


What Nuntio Actually Does

Given a URL like:

curl -X POST http://localhost:4000/analyze \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.bbc.com/news/world-asia-67072373"}'

Nuntio returns decomposed claims with truth score, confidence, semantic explanation, and retrieved evidence:

{
  "claim": "Oliver Glasner is in talks with Crystal Palace...",
  "truth_score": 1.0,
  "confidence": 0.79,
  "truth_explanation": "Aggregated 8 sources (support=3.84,...",
  "evidence": [
    { "url": "https://bbc.com/...", "stance": "supports", "score": 0.53 }
  ]
}

Pipeline

Nuntio doesn't hallucinate truth. It computes it using retrieval + semantic scoring.

[Raw URL] 
   ↓
Extract readable text (Mercury-like parsing)
   ↓
Local LLM claim extraction (Ollama Llama 3)
   ↓
Web search evidence retrieval (gNews RSS + DuckDuckGo HTML)
   ↓
Evidence embedding + cosine similarity
   ↓
Truth vector construction → scoring function
   ↓
Return per-claim result with evidence + explanation

Claim Extraction – Atomic Fact Units

We use Llama 3 (local) to decompose article text into atomic fact statements. The LLM is not used for scoring truth, only for structured decomposition.

Example:

Input Paragraph:
"NASA confirmed a water pocket 40km beneath Mars surface. 
  The rover will begin drilling next month."

Extracted Claims:
- NASA confirmed underground water on Mars.
- Mars rover will begin drilling next month.

Evidence Retrieval (No Paid APIs)

We crawl structured evidence using:

Source Strategy
Google News RSS Topical news retrieval
DuckDuckGo HTML Full-text fallback crawl
Wikipedia Neutral fact grounding

We do title+snippet parsing and HTML extraction using fetchReadable().


Truth Vectors (Core Logic)

Truth is represented using a semantic evidence tensor per claim:

T = [support_sum, neutral_sum, contradict_sum]

Each evidence document contributes:

weight = cosine(claim_embedding, evidence_embedding)
         × source_credibility
         × recency_boost

Final truth score is computed as:

truthScore = (support + 0.5×neutral) / (support + neutral + contra)
  • Range: [0,1]
  • Continuous truth, not binary
  • Resistant to single-source bias

Semantic Reuse (Vector Cache)

We don’t reprocess similar claims. We embed each claim and search pgvector:

SELECT * FROM claims
ORDER BY claim_embedding <=> $query
LIMIT 1;

If cosine similarity > 0.92 → semantic cache hit.:

"Semantic cache reused (similarity 100%)"

That’s not magic — that’s vector reuse.


Confidence Score

Confidence isn't random; it's computed:

confidence =
  0.35 × avg_source_credibility
+ 0.25 × evidence_density
+ 0.20 × support_vs_contra_ratio
+ 0.10 × avg_semantic_similarity
+ 0.10 × recency_boost

Evidence Object

Each evidence is ranked:

{
  "url": "https://news.google.com/...",
  "stance": "supports",
  "score": 0.53,
  "credibility": 0.5,
  "sim": 0.36,
  "snippet": "Crystal Palace chairman confirms...",
  "source": "gnews"
}

Setup & Installation Guide


Requirements

Tool Version
Node.js v18+
npm v8+
Python 3.10+
Git latest
Ollama latest
PostgreSQL 14+ with pgvector
Supabase Account free tier optional

Clone Repo

git clone https://github.com/yourusername/nuntio.git
cd nuntio

Backend Setup (/backend)

cd backend
npm install

Install & run Ollama

Download from https://ollama.com

Pull the model used for claim extraction:

ollama pull llama3

Environment Variables

Create .env inside /backend:

PORT=4000
DATABASE_URL=xxxxxxxx

PostgreSQL Vector Setup (via Supabase)

Enable pgvector in SQL editor:

create extension if not exists vector;

Create table for semantic claim cache:

create table claims (
  id uuid default gen_random_uuid() primary key,
  url text,
  raw_text text,
  claim text,
  emb vector(768),
  truth_score float,
  truth_explanation text,
  confidence float,
  evidence jsonb,
  sentiment jsonb,
  created_at timestamp default now()
);

create index on claims using ivfflat (emb vector_cosine_ops);

Run Backend

npm start

API will start on:

http://localhost:4000

Test it:

curl -X POST http://localhost:4000/analyze \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.bbc.com/news/world-asia-67072373"}'

Frontend Setup (/frontend)

cd ../frontend
npm install
npm run dev

Create .env inside /frontend:

VITE_API_URL=http://localhost:4000

Frontend runs at:

http://localhost:5173

Browser Extension (/extension)

  1. Go to chrome://extensions
  2. Turn on Developer Mode
  3. Click Load Unpacked
  4. Select the nuntio/extension folder
  5. Open any article → click Analyze with Nuntio

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages