WeSearch

Introducing Citai: the RAG engine I built across 6 articles — now free to try

·7 min read · 0 reactions · 0 comments · 0 views
Introducing Citai: the RAG engine I built across 6 articles — now free to try

Over the last 6 articles I shared how I built every piece of a production RAG engine: hybrid search,...

Original article
DEV Community
Read full at DEV Community →
Full article excerpt tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 1593262) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Martin Palopoli Posted on Apr 28 Introducing Citai: the RAG engine I built across 6 articles — now free to try #ai #python #rag #showdev Over the last 6 articles I shared how I built every piece of a production RAG engine: hybrid search, cross-encoder reranking, SSE streaming, multi-tenancy, semantic cache and language detection. Today I'm introducing the finished product: Citai (cite + AI) — a knowledge engine with verifiable citations that anyone can try for free at citai.ai. The full series If you're landing on this article first, here's everything I built and documented: RAG Pipeline — hybrid search (pgvector + BM25), cross-encoder reranking, MMR diversity Production deploy — Docker multi-stage, Nginx, DigitalOcean, zero-downtime deploys Multi-tenancy — plans, atomic quotas, Redis rate limiting, data isolation SSE Streaming — from the LLM to the browser through Nginx, custom 10-event protocol Semantic cache + FAQ — 3 savings layers that cut ~40% of LLM cost Language detection — ES/EN/PT heuristics without external APIs, content rules Every article has real code from the project. Nothing made up for the tutorial. What is Citai Citai = cite + AI. A knowledge engine where every answer cites the exact source (page, document, paragraph). The idea came from a frustration: corporate chatbots that say "according to our documents..." but never show you where. You can't verify anything. You can't trust it. Citai solves that: upload your documents (PDF, DOCX, TXT, or URLs), the system processes them, and when someone asks a question, the answer comes with the exact reference. If it says "see page 15 of the manual", you can go to page 15 and verify. Who it's for Companies with internal documentation: manuals, policies, procedures nobody reads Support teams: a knowledge base that answers before the human does Education: study materials with verifiable answers Healthcare and legal: where citing the source isn't optional — it's mandatory Any use case where an answer without a source isn't enough. What's included (and what I already showed how it works) 3-stage hybrid search What I described in article #1 is exactly what runs in production: Query → Vector (pgvector) + BM25 (tsvector) → RRF merge (70/30) → Cross-encoder rerank → MMR diversity (λ=0.6) → Top 5-10 sources with exact citation Enter fullscreen mode Exit fullscreen mode It's not "cosine similarity and done". It's a full pipeline with reranking that improves relevance by 25-40% over pure vector search. Calibrated confidence Every answer has a confidence score (0-100%) based on cross-encoder scores. If confidence is low, the system says so. It doesn't make things up. "I couldn't find enough information in the available documentation to answer with certainty." Enter fullscreen mode Exit fullscreen mode That's more valuable than a fabricated answer delivered with confidence. Embeddable widget One line of code: <script src="https://citai.ai/widget.js" data-api-key="sk-..." data-base-url="https://citai.ai" ></script> Enter fullscreen mode Exit fullscreen mode Shadow DOM (won't pollute your styles), real-time SSE streaming, pre-chat forms, business hours, human escalation, quick replies,…

This excerpt is published under fair use for community discussion. Read the full article at DEV Community.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Email

Discussion

0 comments

More from DEV Community