1. Ingestion
Upload PDF, TXT, MD, HTML files. Supports local filesystem and Supabase S3 cloud storage with automatic fallback. Uses pdfplumber for PDF extraction with PyPDF2 fallback.
Interactive RAG Pipeline
Educational RAG Platform
Interactive web application that demonstrates and visualizes the complete Retrieval-Augmented Generation (RAG) pipeline. Experiment with document ingestion, preprocessing, chunking strategies, embeddings, vector search, and AI-powered generation across multiple providers.
Upload PDF, TXT, MD, HTML files. Supports local filesystem and Supabase S3 cloud storage with automatic fallback. Uses pdfplumber for PDF extraction with PyPDF2 fallback.
Configurable text cleaning: lowercase conversion, whitespace normalization, URL/email removal, OCR artifact fixes, and Unicode normalization with detailed statistics.
Three strategies: Fixed-size (1000 chars, 200 overlap), Recursive (paragraph-aware), and Semantic (sentence-boundary). All with token counting and metadata.
Generate vectors using Google Gemini (768-dim), OpenAI text-embedding-3-small/large (1536/3072-dim), or ada-002. Batch processing with error handling.
Index to Qdrant vector database with HNSW algorithm. Auto-creates collections, handles dimension mismatches, stores full chunk content in payloads for reconstruction.
Similarity search with query embedding, model auto-detection, and metadata filtering. Returns top-k chunks with scores and latency metrics.
Re-ranks retrieved chunks using keyword overlap scoring. Production systems would use cross-encoder models or Cohere Rerank API.
Generate responses using OpenAI GPT-3.5/4, Google Gemini, or Groq Llama. Multiple prompt templates: default, detailed, concise, step-by-step reasoning.
Track latency, token counts, estimated costs, faithfulness, relevance, context utilization, and response quality metrics for pipeline optimization.
Each RAG stage is independently testable with clear input/output contracts. Stages can be swapped or upgraded without affecting others.
Unified interfaces for embeddings (Google/OpenAI) and LLMs (OpenAI/Gemini/Groq) enable easy provider switching via configuration.
Environment-based switching between local filesystem and Supabase S3 with automatic fallback ensures development and production compatibility.
Structured logging with request IDs, stage tracking, and error traces. Frontend log viewer provides real-time pipeline visibility.