Technical overview

How CLARITY Works

CLARITY turns your argument into a formal graph, proves contradictions with a SAT solver, and surfaces fallacies, ambiguities, and tensions. Gemini handles all language understanding and explanation; Python engines (SAT + graph algorithms) handle formal verification. Voice mode adds Gemini Live for instant spoken feedback and for “Ask CLARITY” read-aloud.

Next.jsReact FlowFastAPIGemini 3Gemini Live

Two ways to analyze

Text mode

You type → the app calls the backend /analyze/stream (SSE). Events stream back: propositions first, then contradictions, fallacies, ambiguities, and the reconstructed argument. The graph and sidebar update in real time.

Voice mode

You speak; mic audio goes to the backend over WebSocket. Gemini Live returns a short spoken acknowledgment. When you stop, the full transcript runs through the same SSE analysis pipeline as text.

Gemini integration

We use two Gemini products: Generate Content (text/JSON) for understanding and explaining, and Gemini Live (audio) for voice.

Generate Content (Gemini 3 Flash / Pro)

Powers nine steps: (1) Proposition parser — raw text → propositions, relationships, formal logic. (2) Semantic implications — implicit contradictions for SAT. (3) Semantic contradictions fallback. (4) Validity checker. (5) Ambiguity detector. (6) Tension detector. (7) Temporal tracker. (8) Argument reconstructor. (9) Pre-generated explanation for “Ask CLARITY.”

Gemini Live (native audio)

Voice acknowledgment — mic → Live returns “I heard you…” while analysis runs on SSE. Ask CLARITY — cached explanation text → Live read-aloud → PCM audio, accumulate-then-play for natural speech.

Pipeline

1

Parse with Gemini

Gemini extracts propositions (premises, conclusions, assumptions, evidence, constraints, risks) and relationships (supports, contradicts, assumes, concludes_from). Each proposition gets a formal expression (e.g. P → Q, ¬R). The rest of the pipeline runs on this structure.

2

Verify with SAT & graph algorithms

Propositions and relationships are converted to CNF. Glucose3 SAT solver: if UNSAT, contradiction is proven (minimal core + formal proof). NetworkX detects circular reasoning, hasty generalization, false dilemma, load-bearing assumptions. Gemini validity checker: argument form and formal fallacies.

3

Ambiguities, tensions, reconstruction

Gemini finds ambiguous terms, practical tensions, and temporal drift. It reconstructs a coherent argument and presentable summary. App pre-generates spoken-style explanation and caches it for “Ask CLARITY” (Gemini Live read-aloud).

Analysis engines

Adversarial / tension

Gemini tension detector: practical tensions and probing questions.

Assumption & ambiguity

Gemini: ambiguous terms and clarification questions; parser and graph: implicit and load-bearing assumptions.

SAT verification

CNF + Glucose3: formal proof and minimal core. NetworkX: circular reasoning and structural fallacies.

Reconstruction

Gemini argument reconstructor: presentable argument and summary in insights.

Ready to try it?

See CLARITY analyze a real decision in under a minute

Start Analyzing