Skip to main content

The Analysis Pipeline

Argument Cartographer employs a sophisticated multi-stage AI pipeline to transform raw text or topics into structured logical blueprints. The entire process is orchestrated by Google Genkit and powered by Gemini 1.5 Pro, optimized for long-context reasoning.
1

Input Processing

User submits a topic query, URL, or document text for analysis
2

Search Query Generation

AI generates a concise 2-4 word search query capturing the core topic
3

Multi-Source Data Gathering

Parallel fetching from Firecrawl (news) and Twitter (social sentiment)
4

Context Synthesis

Aggregated data (up to 20k tokens) is fed to Gemini for analysis
5

Argument Decomposition

AI identifies thesis, claims, counterclaims, and supporting evidence
6

Fallacy Detection

System scans for logical errors and rhetorical manipulation
7

Credibility Scoring

Algorithm evaluates source quality and argument strength (1-10 scale)
8

Blueprint Generation

Structured JSON output validated via Zod for type safety

Architecture Diagram

Stage-by-Stage Breakdown

1. Input Processing

When you submit a topic, URL, or text, the system first determines the input type:
  • Topic query - Example: “Should AI be regulated?”
  • URL - Example: A news article or blog post
  • Document text - Pasted content for direct analysis

2. Search Query Generation

The AI analyzes your input and extracts a focused search query optimized for web and social media searches:
Example transformations:

3. Multi-Source Data Gathering

The system performs parallel searches across multiple sources: Fetches articles from 20+ trusted news outlets including:
  • BBC, Reuters, Al Jazeera, CNN, New York Times
  • The Hindu, Indian Express, Times of India
  • Business Today, Bloomberg, CNBC

Twitter Social Pulse

Searches Twitter/X for recent, relevant public discourse:

4. Context Synthesis

The system aggregates all gathered data into a structured context (up to 20,000 tokens):
The system prioritizes domain diversity - selecting articles from different news outlets to avoid echo chambers.

5. Argument Decomposition

Gemini 1.5 Pro analyzes the context and identifies:
The central contention or question being debated.Example: “Universal Basic Income should be implemented nationwide”

6. Fallacy Detection

The AI actively scans source text for logical errors:

Ad Hominem

Attacking the person instead of their argument

Straw Man

Misrepresenting an opponent’s position

False Dichotomy

Presenting only two options when more exist

Slippery Slope

Assuming a chain reaction without evidence
Each detected fallacy includes:

7. Credibility Scoring

A proprietary algorithm evaluates overall argument quality: Scoring factors:
  • Source diversity (1-3 points) - Multiple independent sources
  • Evidence strength (1-3 points) - Primary data vs. opinion
  • Fallacy presence (-1 to -3 points) - Deductions for logical errors
  • Logical consistency (1-2 points) - Internal coherence
Scores are intentionally harsh - even well-argued topics rarely score above 8/10. This “brutally honest” approach helps users understand that most debates have legitimate complexity.

8. Blueprint Generation & Validation

Final output is rigorously validated using Zod schemas to ensure type safety:

Real-Time Processing

The entire pipeline completes in 15-45 seconds depending on:
  • Number of sources found (target: 8 diverse articles)
  • Twitter API response time
  • Gemini processing load
The system uses optimistic UI patterns to show progress: “Searching web…”, “Analyzing claims…”, “Detecting fallacies…”

Error Handling & Fallbacks

The system gracefully degrades when external APIs are unavailable:
  1. Primary: Firecrawl trusted sources + general search
  2. Fallback 1: Search snippets only (no full scraping)
  3. Fallback 2: AI knowledge-only mode with clear disclaimer
When in Fallback 2 mode (API credits depleted), the system clearly indicates that sources could not be verified in real-time.

Next Steps

Key Features

Explore all platform capabilities

Architecture Deep Dive

Technical details of the AI orchestration layer