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

Github Try the app

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

\## 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

\## 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

\## 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

Tags: Developers

Author: By Khushi Shelat

Jul 21, 2026\ - Introducing the Parallel Responses API

Tags: Product

Author: By Parallel

Jul 20, 2026\ - Building a vendor intelligence system with Parallel

Tags: Developers

Author: By Sahith Jagarlamudi

Jul 16, 2026\ - Parallel and Google Cloud Announce Partnership for Agentic Web Search on Gemini Enterprise Agent Platform

Tags: Product

Author: By Parallel

Jul 15, 2026\ - $5 in free Parallel credits, every month

Tags: Product

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

Tags: Developers

Author: By George Pickett

Jul 10, 2026\ - How Nooks cut web search costs 70.5% by switching to Parallel

Tags: Customers

Author: By Parallel

Jul 8, 2026\ - How Build created live geofenced alerts powered by Parallel for institutional real estate

Tags: Customers

Author: By Parallel

Jun 9, 2026\ - OpenClaw now has free, LLM-optimized web search by default powered by Parallel

Tags: Company

Author: By Parallel

Jun 5, 2026\ - Introducing real-time Entity Search

Tags: Product

Author: By Parallel

Jun 3, 2026\ - How we enrich & triage inbound leads using the Parallel Task API

Tags: Developers

Author: By Khushi Shelat

May 20, 2026\ - How AirOps creates citation-worthy content at scale, powered by Parallel

Tags: Customers

Author: By Parallel

May 18, 2026\ - Introducing Index by Parallel

Tags: Product

Author: By Parallel

May 7, 2026\ - Parallel Monitor API: New processor tiers, snapshots and event streams, and Basis on every event

Tags: Product

Author: By Parallel

May 4, 2026\ - How we built parallelmpp.dev

Tags: Developers

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

Tags: Customers

Author: By Parallel

Apr 28, 2026\ - Parallel Raises at $2 Billion Valuation to Scale Web Infrastructure for Agents

Tags: Company

Author: By Parallel

Apr 24, 2026\ - Building a free CLI agent with Pi, Ollama, Gemma 4, and Parallel

Tags: Developers

Author: By Matt Harris

Apr 23, 2026\ - Parallel Search is now free for agents via MCP

Tags: Product

Author: By Parallel

Apr 21, 2026\ - Upgrades to the Parallel Search & Extract APIs

Tags: Benchmarks

Author: By Parallel

Apr 20, 2026\ - How Finch is scaling plaintiff law with AI agents that research like associates

Tags: Customers

Author: By Parallel

Apr 8, 2026\ - Genpact and Parallel Web Systems Partner to Drive Tangible Efficiency from AI Systems

Tags: Company

Author: By Parallel

Apr 8, 2026\ - How Genpact helps top US insurers cut contents claims processing times in half with Parallel

Tags: Customers

Author: By Parallel

Apr 7, 2026\ - A new deep research frontier on DeepSearchQA with the Task API Harness

Tags: Benchmarks

Author: By Parallel

Mar 30, 2026\ - How Modal saves tens of thousands annually by building in-house GTM pipelines with Parallel

Tags: Customers

Author: By Parallel

Mar 25, 2026\ - How Opendoor uses Parallel as the enterprise grade web research layer powering its AI-native real estate operations

Tags: Customers

Author: By Parallel

Mar 19, 2026\ - Introducing stateful web research agents with multi-turn conversations

Tags: Product

Author: By Parallel

Mar 18, 2026\ - Parallel is live on Tempo, now available natively to agents with the Machine Payments Protocol

Tags: Company

Author: By Parallel

Mar 17, 2026\ - How Parallel helped Kepler build AI that finance professionals can actually trust

Tags: Customers

Author: By Parallel

Mar 10, 2026\ - Introducing the Parallel CLI

Tags: Product

Author: By Parallel

Mar 4, 2026\ - How Profound helps brands win AI Search with high-quality web research and content creation powered by Parallel

Tags: Customers

Author: By Parallel

Mar 2, 2026\ - How Harvey is expanding legal AI internationally with Parallel

Tags: Customers

Author: By Parallel

Feb 23, 2026\ - How Tabstack by Mozilla enables agents to navigate the web with Parallel’s best-in-class web search

Tags: Customers

Author: By Parallel

Feb 4, 2026\ - Parallel Web Tools and Agents now available across Vercel AI Gateway, AI SDK, and Marketplace

Tags: Product

Author: By Parallel

Jan 28, 2026\ - Authenticated page access for the Parallel Task API

Tags: Product

Author: By Parallel

Jan 21, 2026\ - Introducing structured outputs for the Monitor API

Tags: Product

Author: By Parallel

Jan 15, 2026\ - Introducing research models with Basis for the Parallel Chat API

Tags: Product

Author: By Parallel

Dec 17, 2025\ - Parallel Task API achieves state-of-the-art accuracy on DeepSearchQA

Tags: Benchmarks

Author: By Parallel

Dec 16, 2025\ - Introducing Granular Basis for the Task API

Tags: Product

Author: By Parallel

Dec 11, 2025\ - How Amp’s coding agents build better software with Parallel Search

Tags: Customers

Author: By Parallel

Dec 10, 2025\ - Latency improvements on the Parallel Task API

Tags: Product

Author: By Parallel

Nov 20, 2025\ - Introducing Parallel Extract

Tags: Product

Author: By Parallel

Nov 18, 2025\ - Introducing Parallel FindAll

Tags: Product,Benchmarks

Author: By Parallel

Nov 13, 2025\ - Introducing Parallel Monitor

Tags: Product

Author: By Parallel

Nov 12, 2025\ - Parallel raises $100M Series A to build web infrastructure for agents

Tags: Company

Author: By Parallel

Nov 11, 2025\ - How Macroscope reduced code review false positives with Parallel

Tags: Customers

Author: By Parallel

Nov 6, 2025\ - Introducing Parallel Search

Tags: Benchmarks

Author: By Parallel

Nov 3, 2025\ - Parallel processors set new price-performance standard on SealQA benchmark

Tags: Benchmarks

Author: By Parallel

Oct 30, 2025\ - Introducing LLMTEXT, an open source toolkit for the llms.txt standard

Tags: Product

Author: By Parallel

Oct 23, 2025\ - How Starbridge powers public sector GTM with state-of-the-art web research

Tags: Customers

Author: By Parallel

Oct 22, 2025\ - Building a market research platform with Parallel Deep Research

Tags: Developers

Author: By Parallel

Oct 17, 2025\ - How Lindy brings state-of-the-art web research to automation flows

Tags: Customers

Author: By Parallel

Oct 16, 2025\ - Introducing the Parallel Task MCP Server

Tags: Product

Author: By Parallel

Oct 9, 2025\ - Introducing the Core2x Processor for improved compute control on the Task API

Tags: Product

Author: By Parallel

Oct 8, 2025\ - How Day AI merges private and public data for business intelligence

Tags: Customers

Author: By Parallel

Oct 7, 2025\ - Full Basis framework for all Task API Processors

Tags: Product

Author: By Parallel

Oct 6, 2025\ - Building a real-time streaming task manager with Parallel

Tags: Developers

Author: By Parallel

Sep 30, 2025\ - How Gumloop built a new AI automation framework with web intelligence as a core node

Tags: Customers

Author: By Parallel

Sep 16, 2025\ - Introducing the TypeScript SDK

Tags: Product

Author: By Parallel

Sep 12, 2025\ - Building a serverless competitive intelligence platform with MCP + Task API

Tags: Developers

Author: By Parallel

Sep 11, 2025\ - Introducing Parallel Deep Research reports

Tags: Product

Author: By Parallel

Sep 9, 2025\ - A new pareto-frontier for Deep Research price-performance

Tags: Benchmarks

Author: By Parallel

Sep 5, 2025\ - Building a Full-Stack Search Agent with Parallel and Cerebras

Tags: Developers

Author: By Parallel

Aug 21, 2025\ - Webhooks for the Parallel Task API

Tags: Product

Author: By Parallel

Aug 14, 2025\ - Introducing Parallel: Web Search Infrastructure for AIs

Tags: Benchmarks,Product

Author: By Parallel

Aug 7, 2025\ - Introducing SSE for Task Runs

Tags: Product

Author: By Parallel

Aug 5, 2025\ - A new line of advanced Processors: Ultra2x, Ultra4x, and Ultra8x

Tags: Product

Author: By Parallel

Aug 4, 2025\ - Introducing Auto Mode for the Parallel Task API

Tags: Product

Author: By Parallel

Jul 31, 2025\ - A state-of-the-art search API purpose-built for agents

Tags: Benchmarks

Author: By Parallel

Jul 31, 2025\ - Parallel Search MCP Server in Devin

Tags: Product

Author: By Parallel

Jul 28, 2025\ - Introducing Tool Calling via MCP Servers

Tags: Product

Author: By Parallel

Jul 14, 2025\ - Introducing the Parallel Search MCP Server

Tags: Product

Author: By Parallel

Jul 8, 2025\ - Introducing Source Policy

Tags: Product

Author: By Parallel

Jul 2, 2025\ - The Parallel Task Group API

Tags: Product

Author: By Parallel

Jun 17, 2025\ - State of the Art Deep Research APIs

Tags: Benchmarks

Author: By Parallel

Jun 10, 2025\ - Parallel Search API is now available in alpha

Tags: Product

Author: By Parallel

May 29, 2025\ - Introducing the Parallel Chat API

Tags: Product

Author: By Parallel

May 16, 2025\ - Introducing Basis with Calibrated Confidences

Tags: Product

Author: By Parallel

Apr 24, 2025\ - Introducing the Parallel Task API

Tags: Product,Benchmarks

Author: By Parallel