Build a Real-Time AI Fact Checker with Parallel & Cerebras | Parallel
Introducing Parallel Search Turbo: the fastest and lowest-cost search for AI. Learn more.Learn more.
HumanMachine
January 8, 2026
\# Build a real-time fact checker with Parallel and Cerebras
This guide demonstrates how to build a complete fact-checking application that extracts verifiable claims from any text or URL and validates them against live web sources. By the end, you'll have a streaming fact checker with a polished UI that highlights claims directly in the content as they're verified in real-time.
Tags:Developers
Reading time: 5 min
Fact-checking is critical to a wide range of business and academic fields. With today’s latest AI models, chips, and programmable web search, developers can quickly and easily add high-quality, ultra-fast fact-checking to virtually any workflow or application.
\## Key features
- - **Two Input Modes**: Paste text directly or fetch content from any URL
- - **Claim Extraction**: LLM-powered identification of verifiable factual claims
- - **Web Verification**: Each claim is searched and validated against live web sources
- - **Real-Time Streaming**: Results stream to the UI as claims are extracted and verified
- - **Source Citations**: Every verdict includes linked source references with excerpts
- - **Visual Highlighting**: Claims are highlighted directly in the content with color-coded verdicts
\## Architecture
The fact checker implements a multi-phase pipeline:
1. Content Ingestion: Accept text input or extract content from a URL
2. Claim Extraction: LLM identifies verifiable factual claims with exact source spans
3. Parallel Verification: Each claim is searched and analyzed concurrently
4. Real-Time Streaming: Results flow to the frontend via Server-Sent Events
This architecture enables sub-second feedback as claims are identified and surfaced in the UI, while verification happens in parallel to minimize total latency.
\## Technology stack
- - Parallel TypeScript SDKParallel TypeScript SDK for Search and Extract APIs
- - CerebrasCerebras for ultra-fast inference (gpt-oss-120B; up to 3000 tokens/second)
- - Vercel AI SDK for LLMVercel AI SDK for LLM orchestration and streaming
- - Cloudflare WorkersCloudflare Workers (for serverless deployment
- - Pure HTML/JavaScript/CSS for the frontend
\## Why this architecture
**Parallel's Search API for efficient web search**
Traditional fact-checking involves multiple steps: searching for relevant pages, scraping each page, extracting relevant content, and then analyzing it. Parallel's Search API collapses this into a single call that returns the most relevant content from multiple sources, already formatted for LLM consumption.
1
2
3
4
5
6
7
8
9
const searchResult = await parallel.search({
objective: `Find reliable sources to verify or refute this claim: "${claim}"`,
search_queries: [claim],
mode: "basic",
advanced_settings: {
max_results: 5,
excerpt_settings: { max_chars_per_result: 2000 },
},
});``` const searchResult = await parallel.search({
objective: `Find reliable sources to verify or refute this claim: "${claim}"`,
search_queries: [claim],
mode: "basic",
advanced_settings: {
max_results: 5,
excerpt_settings: { max_chars_per_result: 2000 },
},
});
```
This returns structured results with titles, URLs, and relevant excerpts, ready to feed directly into an LLM for claim analysis. This allows the app to efficiently find any mention of the claim on the web, across multiple sources, and feed the relevant excerpts surrounding the claim to an LLM for review. For example, the system can highlight that it is unsure, due to multiple reputable sources differing on the underlying claim; similarly, it can highlight that the claim is incorrect, because while several sources indicate that the claim may have some grounding, a primary source contradicts it.
\### Cerebras for fast inference
Real-time fact checking places unusually strict demands on inference latency. Claims must be identified, contextualized, and evaluated quickly enough that users can see verification results appear as they read.
Cerebras powers this experience by delivering extremely high-throughput, low-latency inference. Models like **gpt-oss-120B**, hosted on Cerebras systems, is today’s leading open-weight model developed by a U.S. company, widely used for its strong reasoning and coding capabilities. Based on benchmarks from Artificial Analysis, most vendors today run gpt-oss-120B in the ~100–300 tokens/second range, reflecting typical NVIDIA H100 performance. Cerebras substantially exceed this range at ~3000 tokens/second.
Output Speed as Shown on Artificial Analysis
For this fact checking UX, Cerebras powers the application’s ability to first, highlight the parts of a given text that are claims, almost immediately after receiving the extracted content, then analyze web search outputs related to the claim. This allows the system to make decisions about several claims almost immediately after receiving each piece of information, resulting in a responsive, interactive user experience.
\## Getting started
To start, you'll need API keys from:
1
2
3
4
5
6
7
8
9
10
11
# Clone and install
git clone https://github.com/parallel-web/parallel-cookbook
cd typescript-recipes/parallel-fact-checker-cerebras
npm install
# Configure API keys (create .dev.vars file)
echo "PARALLEL_API_KEY=your_key_here" >> .dev.vars
echo "CEREBRAS_API_KEY=your_key_here" >> .dev.vars
# Run locally
npm run dev``` # Clone and install
git clone https://github.com/parallel-web/parallel-cookbook
cd typescript-recipes/parallel-fact-checker-cerebras
npm install
# Configure API keys (create .dev.vars file)
echo "PARALLEL_API_KEY=your_key_here" >> .dev.vars
echo "CEREBRAS_API_KEY=your_key_here" >> .dev.vars
# Run locally
npm run dev
```
\## Implementation
This section walks through the key parts of the implementation. The full source is in `worker.ts`.
**1. Extracting Content from URLs**
When a user provides a URL, we use Parallel's Extract API to fetch and parse the page:
1
2
3
4
5
const extractResult = await parallel.extract({
urls: [url],
objective: "Extract the main article content and key claims",
advanced_settings: { full_content: true },
});``` const extractResult = await parallel.extract({
urls: [url],
objective: "Extract the main article content and key claims",
advanced_settings: { full_content: true },
});
```
The Extract API handles fetching, parsing, and cleaning—returning just the content, not the HTML boilerplate.
**2. Identifying Claims**
The LLM extracts verifiable claims using a structured output format. As a small prompt-tuning improvement, we ask for **exact quotes** from the source text so we can highlight them in the UI.
1
2
3
4
5
6
7
8
9
10
11
12
13
const factsResult = streamText({
model: cerebras("gpt-oss-120b"),
system: `Extract verifiable claims. Output format:
FACT: [EXACT QUOTE from text] ||| [claim to verify]
The quote before ||| must match the source exactly (for highlighting).`,
prompt: content,
});``` const factsResult = streamText({
model: cerebras("gpt-oss-120b"),
system: `Extract verifiable claims. Output format:
FACT: [EXACT QUOTE from text] ||| [claim to verify]
The quote before ||| must match the source exactly (for highlighting).`,
prompt: content,
});
```
As the LLM streams its response, we parse each `FACT:` line and immediately send it to the frontend—claims appear in the UI as they're discovered.
**3. Searching for Evidence**
Each claim is verified using Parallel's Search API. One call returns relevant excerpts from multiple sources:
1
2
3
4
5
6
7
8
9
const searchResult = await parallel.search({
objective: `Find reliable sources to verify or refute this claim: "${fact.text}"`,
search_queries: [fact.text],
mode: "basic",
advanced_settings: {
max_results: 5,
excerpt_settings: { max_chars_per_result: 2000 },
},
});``` const searchResult = await parallel.search({
objective: `Find reliable sources to verify or refute this claim: "${fact.text}"`,
search_queries: [fact.text],
mode: "basic",
advanced_settings: {
max_results: 5,
excerpt_settings: { max_chars_per_result: 2000 },
},
});
```
The Search API is designed for LLM consumption— it returns structured excerpts, not raw HTML, saving you from building a scraping pipeline.
**4. Rendering Verdicts**
The LLM analyzes the search results and returns a verdict:
1
2
3
4
5
6
7
8
9
10
11
12
13
const verdict = await streamText({
model: cerebras("gpt-oss-120b"),
system: `Analyze evidence and respond with:
VERDICT: [VERIFIED/FALSE/UNSURE]
EXPLANATION: [1-2 sentences]`,
prompt: `Claim: "${claim}"\n\nEvidence: ${JSON.stringify(searchResults)}`,
});``` const verdict = await streamText({
model: cerebras("gpt-oss-120b"),
system: `Analyze evidence and respond with:
VERDICT: [VERIFIED/FALSE/UNSURE]
EXPLANATION: [1-2 sentences]`,
prompt: `Claim: "${claim}"\n\nEvidence: ${JSON.stringify(searchResults)}`,
});
```
We parse the verdict and send it to the frontend along with source citations.
**5. Streaming with SSE**
All results stream to the browser using Server-Sent Events. The helper is as follows:
1
2
3
4
5
6
7
function sendSSE(controller: ReadableStreamDefaultController, data: object) {
controller.enqueue(encoder.encode(`data: ${JSON.stringify(data)}\n\n`));
}
// Usage
sendSSE(controller, { type: "fact_extracted", fact });
sendSSE(controller, { type: "fact_verdict", factId, status, explanation, references });``` function sendSSE(controller: ReadableStreamDefaultController, data: object) {
controller.enqueue(encoder.encode(`data: ${JSON.stringify(data)}\n\n`));
}
// Usage
sendSSE(controller, { type: "fact_extracted", fact });
sendSSE(controller, { type: "fact_verdict", factId, status, explanation, references });
```
The frontend listens for these events and updates the UI in real-time.
**6. Concurrent Verification**
Claims are verified concurrently to improve the user experience. With concurrency, several claims can be verified within the latency window of a single claim.
1
2
3
4
5
await Promise.all(
claims.map(claim => verifyFact(claim, parallel, cerebras, controller))
);``` await Promise.all(
claims.map(claim => verifyFact(claim, parallel, cerebras, controller))
);
```
For example, with 10 claims, this completes in ~3-5 seconds instead of 30+ seconds sequentially.
\## SSE event reference
**phase**: Processing phase changed (extracting, verifying)
**content_chunk: ** Streamed content chunk (URL mode)
**content_complete: ** Formatted content is ready
**fact_extracted**: New claim identified (highlighted in grey on the UI)
**fact_status: ** Claim status update (eg., “searching”)
**fact_verdict:** Final verdict with explanation and sources (highlighted red, orange or green)
**complete:** All processing finished
**error:** Error occurred
\## Resources
- - Live DemoLive Demo
- - Source CodeSource Code
- - Parallel API DocumentationParallel API Documentation
- - Parallel Search APIParallel Search API
- - Cerebras DocumentationCerebras Documentation
- - Vercel AI SDKVercel AI SDK
\## Ready to get started?
Sign up for free. No credit card required.
Try ParallelTry Parallel Contact salesContact sales
Are you an agent? Read this to onboard ParallelAre you an agent? Read this to onboard Parallel
By Parallel
January 8, 2026
\## Related Posts80
Jul 30, 2026\ - Building an always-on background agent to proactively support customers
Author: By Khushi Shelat
Jul 21, 2026\ - Introducing the Parallel Responses API
Author: By Parallel
Jul 20, 2026\ - Building a vendor intelligence system with Parallel
Author: By Sahith Jagarlamudi
Jul 16, 2026\ - Parallel and Google Cloud Announce Partnership for Agentic Web Search on Gemini Enterprise Agent Platform
Author: By Parallel
Jul 15, 2026\ - $5 in free Parallel credits, every month
Author: By Parallel
\ \ Jul 13, 2026\ \ - [Introducing Parallel Search Turbo](/content/blog/parallel-search-turbo/index.html) \ \ Author: By Parallel](/content/blog/parallel-search-turbo/index.html)
Jul 12, 2026\ - Building a realtime voice agent with GPT-Realtime-2.1 and Parallel Search Turbo
Author: By George Pickett
Jul 10, 2026\ - How Nooks cut web search costs 70.5% by switching to Parallel
Author: By Parallel
Jul 8, 2026\ - How Build created live geofenced alerts powered by Parallel for institutional real estate
Author: By Parallel
Jun 9, 2026\ - OpenClaw now has free, LLM-optimized web search by default powered by Parallel
Author: By Parallel
Jun 5, 2026\ - Introducing real-time Entity Search
Author: By Parallel
Jun 3, 2026\ - How we enrich & triage inbound leads using the Parallel Task API
Author: By Khushi Shelat
May 20, 2026\ - How AirOps creates citation-worthy content at scale, powered by Parallel
Author: By Parallel
May 18, 2026\ - Introducing Index by Parallel
Author: By Parallel
May 7, 2026\ - Parallel Monitor API: New processor tiers, snapshots and event streams, and Basis on every event
Author: By Parallel
May 4, 2026\ - How we built parallelmpp.dev
Author: By Son Do
Apr 29, 2026\ - How Actively's Per Account Agents use Parallel to turn the entire web into a proactive sales intelligence layer
Author: By Parallel
Apr 28, 2026\ - Parallel Raises at $2 Billion Valuation to Scale Web Infrastructure for Agents
Author: By Parallel
Apr 24, 2026\ - Building a free CLI agent with Pi, Ollama, Gemma 4, and Parallel
Author: By Matt Harris
Apr 23, 2026\ - Parallel Search is now free for agents via MCP
Author: By Parallel
Apr 21, 2026\ - Upgrades to the Parallel Search & Extract APIs
Author: By Parallel
Apr 20, 2026\ - How Finch is scaling plaintiff law with AI agents that research like associates
Author: By Parallel
Apr 8, 2026\ - Genpact and Parallel Web Systems Partner to Drive Tangible Efficiency from AI Systems
Author: By Parallel
Apr 8, 2026\ - How Genpact helps top US insurers cut contents claims processing times in half with Parallel
Author: By Parallel
Apr 7, 2026\ - A new deep research frontier on DeepSearchQA with the Task API Harness
Author: By Parallel
Mar 30, 2026\ - How Modal saves tens of thousands annually by building in-house GTM pipelines with Parallel
Author: By Parallel
Mar 25, 2026\ - How Opendoor uses Parallel as the enterprise grade web research layer powering its AI-native real estate operations
Author: By Parallel
Mar 19, 2026\ - Introducing stateful web research agents with multi-turn conversations
Author: By Parallel
Mar 18, 2026\ - Parallel is live on Tempo, now available natively to agents with the Machine Payments Protocol
Author: By Parallel
Mar 17, 2026\ - How Parallel helped Kepler build AI that finance professionals can actually trust
Author: By Parallel
Mar 10, 2026\ - Introducing the Parallel CLI
Author: By Parallel
Mar 4, 2026\ - How Profound helps brands win AI Search with high-quality web research and content creation powered by Parallel
Author: By Parallel
Mar 2, 2026\ - How Harvey is expanding legal AI internationally with Parallel
Author: By Parallel
Feb 23, 2026\ - How Tabstack by Mozilla enables agents to navigate the web with Parallel’s best-in-class web search
Author: By Parallel
Feb 4, 2026\ - Parallel Web Tools and Agents now available across Vercel AI Gateway, AI SDK, and Marketplace
Author: By Parallel
Jan 28, 2026\ - Authenticated page access for the Parallel Task API
Author: By Parallel
Jan 21, 2026\ - Introducing structured outputs for the Monitor API
Author: By Parallel
Jan 15, 2026\ - Introducing research models with Basis for the Parallel Chat API
Author: By Parallel
Dec 17, 2025\ - Parallel Task API achieves state-of-the-art accuracy on DeepSearchQA
Author: By Parallel
Dec 16, 2025\ - Introducing Granular Basis for the Task API
Author: By Parallel
Dec 11, 2025\ - How Amp’s coding agents build better software with Parallel Search
Author: By Parallel
Dec 10, 2025\ - Latency improvements on the Parallel Task API
Author: By Parallel
Nov 20, 2025\ - Introducing Parallel Extract
Author: By Parallel
Nov 18, 2025\ - Introducing Parallel FindAll
Author: By Parallel
Nov 13, 2025\ - Introducing Parallel Monitor
Author: By Parallel
Nov 12, 2025\ - Parallel raises $100M Series A to build web infrastructure for agents
Author: By Parallel
Nov 11, 2025\ - How Macroscope reduced code review false positives with Parallel
Author: By Parallel
Nov 6, 2025\ - Introducing Parallel Search
Author: By Parallel
Nov 3, 2025\ - Parallel processors set new price-performance standard on SealQA benchmark
Author: By Parallel
Oct 30, 2025\ - Introducing LLMTEXT, an open source toolkit for the llms.txt standard
Author: By Parallel
Oct 23, 2025\ - How Starbridge powers public sector GTM with state-of-the-art web research
Author: By Parallel
Oct 22, 2025\ - Building a market research platform with Parallel Deep Research
Author: By Parallel
Oct 17, 2025\ - How Lindy brings state-of-the-art web research to automation flows
Author: By Parallel
Oct 16, 2025\ - Introducing the Parallel Task MCP Server
Author: By Parallel
Oct 9, 2025\ - Introducing the Core2x Processor for improved compute control on the Task API
Author: By Parallel
Oct 8, 2025\ - How Day AI merges private and public data for business intelligence
Author: By Parallel
Oct 7, 2025\ - Full Basis framework for all Task API Processors
Author: By Parallel
Oct 6, 2025\ - Building a real-time streaming task manager with Parallel
Author: By Parallel
Sep 30, 2025\ - How Gumloop built a new AI automation framework with web intelligence as a core node
Author: By Parallel
Sep 16, 2025\ - Introducing the TypeScript SDK
Author: By Parallel
Sep 12, 2025\ - Building a serverless competitive intelligence platform with MCP + Task API
Author: By Parallel
Sep 11, 2025\ - Introducing Parallel Deep Research reports
Author: By Parallel
Sep 9, 2025\ - A new pareto-frontier for Deep Research price-performance
Author: By Parallel
Sep 5, 2025\ - Building a Full-Stack Search Agent with Parallel and Cerebras
Author: By Parallel
Aug 21, 2025\ - Webhooks for the Parallel Task API
Author: By Parallel
Aug 14, 2025\ - Introducing Parallel: Web Search Infrastructure for AIs
Author: By Parallel
Aug 7, 2025\ - Introducing SSE for Task Runs
Author: By Parallel
Aug 5, 2025\ - A new line of advanced Processors: Ultra2x, Ultra4x, and Ultra8x
Author: By Parallel
Aug 4, 2025\ - Introducing Auto Mode for the Parallel Task API
Author: By Parallel
Jul 31, 2025\ - A state-of-the-art search API purpose-built for agents
Author: By Parallel
Jul 31, 2025\ - Parallel Search MCP Server in Devin
Author: By Parallel
Jul 28, 2025\ - Introducing Tool Calling via MCP Servers
Author: By Parallel
Jul 14, 2025\ - Introducing the Parallel Search MCP Server
Author: By Parallel
Jul 8, 2025\ - Introducing Source Policy
Author: By Parallel
Jul 2, 2025\ - The Parallel Task Group API
Author: By Parallel
Jun 17, 2025\ - State of the Art Deep Research APIs
Author: By Parallel
Jun 10, 2025\ - Parallel Search API is now available in alpha
Author: By Parallel
May 29, 2025\ - Introducing the Parallel Chat API
Author: By Parallel
May 16, 2025\ - Introducing Basis with Calibrated Confidences
Author: By Parallel
Apr 24, 2025\ - Introducing the Parallel Task API
Author: By Parallel