TK
HomePortfolioBlogAboutResume

Ask Prism

Document Analytics Platform with visual citations—click a citation and the PDF scrolls to the exact passage, highlighted with bounding boxes.
View on GitHubChainOfThought in StorybookRead Blog Post
Demo: AI-Powered Table Enrichment
What It Does

Upload PDFs, ask questions, get answers with clickable citations that highlight exact source text

AI Components

40+

LLMs

3 Models

Verification

Multi-model

Accuracy

~96%

Parsing

Dual

Key Stack

LangGraph + Supabase + pgvector

Architecture
┌─────────────────────────────────────────────────────────────────┐
│                         VERCEL                                  │
│  ┌───────────────┐  ┌───────────────┐  ┌──────────────────┐    │
│  │   Next.js     │  │  API Routes   │  │   Upstash Redis  │    │
│  │   Frontend    │  │  (SSE stream) │  │   (Query Cache)  │    │
│  └───────────────┘  └───────────────┘  └──────────────────┘    │
└─────────────────────────────────────────────────────────────────┘
         │                           │
         ▼                           ▼
┌─────────────────┐       ┌─────────────────────────┐
│    LangGraph    │       │       Supabase          │
│   (Q&A Agent)   │       │  PostgreSQL + pgvector  │
│                 │       │                         │
│  routeQuery     │       │  - documents            │
│      ↓          │◄─────►│  - chunks (embeddings)  │
│  retrieve       │       │  - conversations        │
│      ↓          │       └─────────────────────────┘
│  verify         │
│      ↓          │       ┌─────────────────┐
│  generate       │──────►│   LangSmith     │
└─────────────────┘       │   (Tracing)     │
                          └─────────────────┘
Key Features
Visual Citations

Click any citation to scroll the PDF to the exact location with bounding box highlighting.

How: PDF parsing extracts text with position data (bounding boxes), chunks preserve bbox coordinates, and react-pdf-highlighter-extended renders highlights.
Multi-Model Verification

Dual LLM verification catches hallucinations before users see them.

Pipeline: GPT-5 Mini (primary) → Claude Haiku 4.5 (verification) → o3 (reconciliation if disagreement)
Chain of Thought UI

Transparent AI reasoning with collapsible step-by-step visualization.

Ported to: Storybook Design System
AI Elements Library

40+ reusable components for building AI interfaces.

Categories: Reasoning, Messages, Verification, Citations, Processing, Code
Key Design Decisions
Why dual parsers?

pdfjs-dist is free but struggles with complex layouts. Reducto handles tables and scans but costs credits. Users choose based on document complexity.

Why multi-model verification?

Single LLMs can hallucinate. Using different models (GPT-5 Mini + Claude Haiku) catches errors. Research shows dual verification achieves ~96% accuracy vs ~85% baseline.

Why bounding boxes?

Page-level citations aren't precise enough. Bounding box extraction enables exact text highlighting, building trust and enabling quick verification.

Tech Stack
Next.js 15
TypeScript
LangGraph
Supabase
pgvector
GPT-5 Mini
Claude Haiku 4.5
Flowbite
Tailwind CSS
LangSmith
Learn More