Inspiration

The OECD warns that the spread of false and misleading information threatens societal well-being, fuels polarization, undermines policy implementation, and erodes trust in democratic institutions. Despite the scale of the problem, fact-checking remains tedious for most people. Verifact was built to close that usability gap.

What it does

Verifact is a Chrome extension that leverages Claude AI to help users fact-check any text they highlight on a webpage. After highlighting, the extension’s widget shows whether the claim is verified, misleading, or inconclusive. Unlike traditional fact-checking tools, Verifact doesn’t require switching tabs or copy-pasting text. It also cites sources so users can confirm results and build digital literacy. The accompanying website includes a dashboard showing popular topics being fact-checked, verdict distributions over recent days, and the recent queries submitted by users.

How we built it

Backend: We built a Node.js/Express server that handles fact-checking requests and uses NodeCache for in-memory caching. The server integrates with the Anthropic Claude API to perform AI-powered fact verification. We implemented analytics tracking that monitors total checks, cache performance, verdict distributions, daily check patterns, and trending topics. The analytics is saved to a JSON file every 30 seconds to ensure persistence across server restarts.

Frontend: The Chrome extension includes a draggable overlay widget designed to be intuitive and unobtrusive. Users simply highlight text and click to fact-check. We also built a landing page using HTML/CSS with interactive data visualizations (canvas-based donut charts and stacked bar graphs) to display real-time fact-checking statistics from the dashboard API. The frontend uses vanilla JavaScript for the extension and implements smooth animations and responsive design patterns.

Infrastructure: The extension architecture consists of a background service worker for handling extension lifecycle events, a content script that injects the fact-checking overlay into webpages, and a popup interface for quick access. We implemented CORS-enabled API endpoints for seamless communication between the extension and local server. The in-memory caching system reduces API costs by instantly serving repeated queries within a session.

AI: We integrated Claude Sonnet 4 via the Anthropic API to perform intelligent fact-checking with web search capabilities. Our prompts are carefully engineered to return structured JSON responses containing verdicts (True, False, Misleading, Unverifiable), explanations, and sources. The AI analyzes claims in context of the source URL and automatically categorizes content by topic (health, finance, news, climate change, wellness, or general).

Challenges we ran into

Token limitations: One of our biggest challenges was Claude's context window limitations. We pivoted from full-page fact-checking, which would be expensive and inefficient, to a highlight-based approach, making the feature more practical and cost-effective and putting users in control of what gets fact-checked.

JSON parsing reliability: Claude's responses sometimes included markdown formatting or extra text around the JSON, requiring robust parsing logic to extract clean JSON from varied response formats. We implemented fallback mechanisms to handle parsing errors gracefully.

Real-time dashboard updates: Building a dashboard that updates in real-time without constantly re-rendering or causing page jumps was challenging. We implemented scroll position preservation and data change detection to ensure a smooth user experience even with frequent updates.

What's next for Verifact

We hope to refine Verifact’s categorization and bring the extension to other browsers and to mobile devices.

Built With

Share this project:

Updates