Skip to main content

UsapPdf

The Brief

A RAG-powered PDF assistant that lets users ask questions, summarize sections, and retrieve document details through natural language chat.

UsapPdf interface shown on a laptop with PDF workflow features.

Tech Stack

tech.01React01
tech.02TypeScript02
tech.03Python03
tech.04FastAPI04
tech.05AI / LLM05
tech.06RAG06
tech.07LangChain07

Key Challenges & Solutions

01

Critical Challenge

High latency PDF processing

Extracting text, creating chunk embeddings, and saving to a vector database caused client-side request timeouts.

Engineered Solution

Designed an asynchronous task queue in FastAPI, returning a task ID immediately and streaming progress states through WebSockets.

02

Critical Challenge

Hallucination Mitigation

The AI model could reference details outside the uploaded PDF.

Engineered Solution

Configured a strict LangChain system prompt and implemented MMR retrieval to keep responses locked to source file chunks.

Impact & Metrics

01ConversationalPDFs
02InstantSummary
03LangChainOrchestration

Core Architecture

System Design4 views
React Web ClientFastAPI BackendVector Store (Chroma)OpenAI GPT-4o-mini
  1. React Web ClientPOST /query {doc_id, query: "summarize page 2"}FastAPI Backend
  2. FastAPI BackendSearch matching vectors for queryVector Store (Chroma)
  3. Vector Store (Chroma)Returns relevant text chunksFastAPI Backend
  4. FastAPI BackendSend system prompt + context chunks + queryOpenAI GPT-4o-mini
  5. OpenAI GPT-4o-miniReturns natural language answerFastAPI Backend
  6. FastAPI BackendStreams answer text back to clientReact Web Client
React Web ClientFastAPI BackendVector Store (Chroma)OpenAI GPT-4o-mini
GV
Voice ChatAutomated Male Voice

Ready to start a call

Click "Start Call" to connect to the automated male voice assistant.