Open SourceOpen Source Personal projectProyecto personal Pragmara — RAG-as-a-ServicePragmara — RAG-as-a-Service
Upload technical documentation — PDFs, Markdown, or URLs — and get a streaming REST API that answers natural-language questions with precise source citations. Built end-to-end: hybrid vector search, cross-encoder reranking, SSE streaming, and a built-in evaluation framework that scores faithfulness and relevance on every query.Sube documentación técnica — PDFs, Markdown o URLs — y obtén una API REST con streaming que responde preguntas en lenguaje natural con citas de fuente precisas. Construido de punta a punta: búsqueda vectorial híbrida, reranking con cross-encoder, streaming por SSE y un framework de evaluación que mide fidelidad y relevancia en cada query.
Pragmara is a multi-tenant RAG platform built for the real constraints of a solo project: zero infrastructure cost, observable failure modes, and a clean API contract. Documents go through a 6-stage ingestion pipeline — parse, clean, chunk, embed, index — then queries run hybrid dense+sparse retrieval with RRF fusion, cross-encoder reranking, and a faithfulness evaluation on every response. The entire stack runs on permanent free tiers: Groq for LLM inference, Voyage AI for embeddings, Qdrant Cloud for vectors, Supabase for PostgreSQL, and Upstash for Redis.Pragmara es una plataforma RAG multi-tenant construida con los constraints reales de un proyecto personal: costo cero, modos de falla observables y un contrato de API limpio. Los documentos pasan por un pipeline de ingesta de 6 etapas — parse, clean, chunk, embed, index — y las queries ejecutan recuperación híbrida densa+sparse con fusión RRF, reranking con cross-encoder y evaluación de fidelidad en cada respuesta. Todo el stack corre en free tiers permanentes: Groq, Voyage AI, Qdrant Cloud, Supabase y Upstash.
HighlightHighlight
Zero infrastructure cost: Groq (LLM), Voyage AI (embeddings), Qdrant Cloud, Supabase, Upstash, and Render — all on permanent free tiers. The only engineering constraint was building reliably within those limits.Costo de infraestructura cero: Groq (LLM), Voyage AI (embeddings), Qdrant Cloud, Supabase, Upstash y Render — todos en free tiers permanentes. El único constraint de ingeniería fue construir de forma confiable dentro de esos límites.
Key outcomesResultados clave
- 6-stage ingestion pipeline: parse (PyMuPDF + BeautifulSoup), clean, chunk at 800 tokens with 80-token overlap, embed with Voyage AI, index into Qdrant with full source metadata. Pipeline de ingesta de 6 etapas: parse (PyMuPDF + BeautifulSoup), clean, chunk a 800 tokens con 80 de overlap, embed con Voyage AI, index en Qdrant con metadata de fuente completa.
- Hybrid retrieval: dense vector search + BM25 sparse with Reciprocal Rank Fusion, then cross-encoder reranking on top-20 candidates down to top-5. Recuperación híbrida: búsqueda vectorial densa + BM25 sparse con Reciprocal Rank Fusion, seguido de reranking con cross-encoder de los 20 mejores a los 5 finales.
- Streaming SSE responses with inline citations — source file, page number, and section — injected as structured JSON at stream end. Respuestas en streaming por SSE con citas en línea — archivo fuente, número de página y sección — inyectadas como JSON estructurado al final del stream.
- Evaluation framework on every query: faithfulness scored by an LLM judge (Groq llama-3.1-8b-instant), answer relevance by cosine similarity — both stored and surfaced in the analytics dashboard. Framework de evaluación en cada query: fidelidad puntuada por un LLM juez (Groq llama-3.1-8b-instant), relevancia por similitud coseno — ambas almacenadas y visibles en el dashboard.
- Multi-tenant isolation: all knowledge bases stored in one Qdrant collection, partitioned by kb_id payload filter — no collection-per-tenant overhead. Aislamiento multi-tenant: todas las bases de conocimiento en una sola colección de Qdrant, particionadas por filtro de payload kb_id — sin overhead de una colección por tenant.
- Magic link auth (Resend), API key management scoped per KB with SHA-256 hashing, rate limiting via Redis sliding window at 100 req/min. Auth por magic link (Resend), API keys con scope por KB y hash SHA-256, rate limiting por ventana deslizante en Redis a 100 req/min.
Tech stackStack
PythonFastAPISQLAlchemyCeleryNext.jsTypeScriptQdrantGroqVoyage AILangChainSupabaseUpstashRenderVercel