Advanced
RAG System
A production-grade architecture that ingests documents, generates robust embeddings, and retrieves precise semantic context to power accurate, human-like AI answers.
From Document to Answer.
A four-stage pipeline that handles ingestion, embedding, retrieval, and generation with full observability.
Ingest Docs
Upload PDFs, Markdown, and plain text files. Processed automatically via Celery background jobs.
Embed Data
Generate robust embeddings using text-embedding-3-small and securely store in Supabase pgvector.
Retrieve Context
Hybrid search combining dense (HNSW) and sparse (GIN) indexes, fused with Reciprocal Rank Fusion.
Answer Human
Stream accurate, human-like responses token-by-token with fully traceable inline citations.
Agentic
Chain-of-Thought.
A stateful LangGraph pipeline — classify, rewrite, expand, retrieve, generate, validate — with every step traceable in real time.
Smart Routing
One LLM call. Four routes. Format directives stripped before retrieval.
Query Expansion
Complex queries split into sub-queries. Vague ones generate a HyDE document to sharpen recall.
Response Validation
A background LLM scores sampled responses for accuracy and grounding. Results are logged to the analytics DB.
> User: "What are the termination clauses in this contract?"
[context_loader] Loaded 4 turns · 2,180 tokens · no trim needed
[classifier] Intent → retrieve_with_expansion
[classifier] Format directives stripped: none
[query_rewriter] Follow-up detected · resolving "this" → "the uploaded contract"
[query_expander] Strategy: sub-query decomposition
· "Termination conditions and notice periods"
· "Early termination penalties and consequences"
[retriever] Vector search (HNSW) · 10 candidates per sub-query
[retriever] Full-text search (GIN) · 10 candidates · parallel
[retriever] RRF fusion (α=0.7) → 20 merged · deduplicating...
[retriever] FlashRank re-ranking → top 5 chunks selected
[generator] Streaming response via SSE · citations [1][2][3]
[validator] Background task · score: 0.91 · ✓ PASS
Core Capabilities
Engineered to handle your private data at scale, securely.
AI Chat with Citations
Conversations stream token-by-token via SSE. Every answer includes inline citations linked back to the exact source chunk with text previews.
AI Chat with Citations
Conversations stream token-by-token via SSE. Every answer includes inline citations linked back to the exact source chunk with text previews.
Private Data at Scale
Upload PDFs, DOCX, and more. Docling parses and chunks each file asynchronously via Celery — parent-child chunking preserves context across retrieval.
Private Data at Scale
Upload PDFs, DOCX, and more. Docling parses and chunks each file asynchronously via Celery — parent-child chunking preserves context across retrieval.
Secure by Design
JWT auth on every request. Supabase RLS ensures strict user-data isolation. Rate limiting, presigned citation URLs, and no cross-tenant data leakage.
Secure by Design
JWT auth on every request. Supabase RLS ensures strict user-data isolation. Rate limiting, presigned citation URLs, and no cross-tenant data leakage.
Built for Production
A modern, scalable technical stack meticulously chosen for robust document retrieval and agentic coordination.
Core Technologies
Implementation Details
Identity & Security
- •Clerk Authentication
- •Postgres Row-Level Security (RLS)
- •Redis API Rate Limiting
- •Redis Response Caching (24hr TTL)
Advanced Retrieval
- •pgvector (HNSW) Dense Search
- •Full-text (GIN) Parallel Search
- •FlashRank Cross-Encoder Re-ranking
- •Reciprocal Rank Fusion (RRF)
Agentic & Async Ops
- •LangGraph State Machines
- •Async SSE Generation Streaming
- •Celery Background Document Jobs
- •LangSmith Tracing & Observability
Data Ingestion
- •Docling PDF / DOCX Parsing
- •Parent-Child Chunking Strategy
- •OpenAI text-embedding-3-small
- •Background Validation Scoring