TruthLens
Don't trust AI blindly — we mine for the truth
Created on 8th March 2026
•
TruthLens
Don't trust AI blindly — we mine for the truth
The problem TruthLens solves
AI-generated content is everywhere — but it lies. Confidently.
ChatGPT, Gemini, and other large language models routinely "hallucinate": they fabricate facts, invent URLs, misattribute quotes, and present outdated information as current — all with the same confident tone as accurate content. Most people have no way to tell the difference at a glance.
TruthLens is a real-time AI Hallucination Auditor that lets you paste any text and get a sentence-by-sentence breakdown of what's true, false, or unverifiable.
Who is it for?
- 🎓 Students & researchers — verify AI-written summaries before submitting assignments
- 📰 Journalists & writers — fact-check drafts and AI-assisted articles instantly
- ⚖️ Legal & medical professionals — catch misquoted laws, fake case citations, or wrong drug dosages
- 🧑💻 Developers & prompt engineers — test how much an LLM hallucinates on a given topic
- 👤 General users — stop trusting AI blindly
What it does differently
- Sentence-level analysis — not just "this text seems wrong", but exactly which sentence is false and why
- 5 hallucination types classified per claim: Fabricated Fact, False Source, False Connection, Context Distortion, Knowledge Gap
- Domain modes — stricter rules for Medical, Legal, and Journalism content
- Difficulty modes — Creative (lenient) / Survival (normal) / Hardcore (brutal)
- AI Rewrite — one click to get a corrected version of any false sentence
- Battle Mode — compare two texts head-to-head to see which is more trustworthy
- Trust Score — an overall health bar score for the entire text
Challenges we ran into
1. Gemini treating March 2026 as "future"
Gemini's training data has a cutoff, so it was flagging real current events as
"unverifiable future claims" and giving false confidence scores. Fix: we inject
TODAY'S DATE into every audit prompt and added a new KNOWLEDGE_GAP hallucination
type for claims that are plausible but too recent to verify — instead of wrongly
marking them FALSE.
2. The 4-model fallback chain
Single-model Gemini calls failed constantly during high traffic (rate limits,
model deprecations). We built an automatic fallback: gemini-2.0-flash-lite →
gemini-flash-lite-latest → gemini-2.0-flash → gemini-flash-latest. If one
fails, the next is tried transparently — users never see a raw API error.
3. btoa() crashing on emoji/Unicode text
The Share Link feature encodes results in a URL using base64. btoa() throws
a hard crash on any non-ASCII character (emojis, accented letters). Fix:
btoa(unescape(encodeURIComponent(data))) — a Unicode-safe encoding chain.
4. Three.js 3D background performance
The hero section runs 55 voxels + 600 stars in a WebGL canvas. Initial builds
caused jank on mid-range devices. We separated the Three.js code into its own
lazy-loaded chunk via Vite's manualChunks, reducing initial JS parse time
significantly.
5. Gemini returning inconsistent JSON
The AI occasionally returns malformed JSON, omits fields like uncertain_count,
or wraps the JSON in markdown code fences. We wrote a robust parser that strips
code fences, normalizes missing fields, and retries on parse failure before
surfacing an error to the user.
6. FloatingParticles re-render flicker
Background particle positions were generated with Math.random() inside the
component body — so every state update (loading spinner, toast, etc.) regenerated
all 30 particle positions, causing a visible flicker. Fix: moved the array to
module scope so positions are computed once at startup.
Tracks Applied (1)
Best Use of Gemini API
Major League Hacking
Technologies used

