PrismBot RAG Implementation
A production-grade, multi-tenant AI chatbot platform enabling organizations to deploy custom, context-aware assistants across web and WhatsApp channels.
<300ms
Vector search latency
4x
Retrieval relevance improvement
10
Parallel embedding lookups
WhatsApp messaging gets complicated at scale.
Retrieval is where most chatbot deployments break, not generation. A model with a well-tuned prompt still answers wrong when the passages it receives are incomplete, off-topic, or stripped of the context that made them meaningful in the source document. Teams spend weeks tuning prompts and never touch the layer actually producing the errors. PrismBot had to work for organizations deploying assistants over their own material: support handbooks, product manuals, policy documents, internal wikis. In that setting a confidently wrong answer is worse than no answer at all. Naive top-K similarity search kept surfacing fragments severed from their headings, so the model would see a paragraph about renewal windows with no indication of which product it governed. And people phrase questions nothing like the source text: someone asks "how long do I have to send this back" against a document that says "returns must be initiated within 30 days of delivery." Single-vector lookups miss that match on vocabulary alone. Two constraints shaped everything downstream. The platform is multi-tenant, so one organization's embeddings can never surface in another organization's results. A leak here isn't a bug, it's a breach. And it ships to a web widget and a WhatsApp Business number at the same time, which rules out any design where conversation state lives in the browser session.
Challenge 1
Context loss due to naive top-K retrieval
Challenge 2
Fragmented document chunking causing incomplete responses
Challenge 3
No human fallback for failed AI interactions
Challenge 4
Disconnected systems across web and WhatsApp channels
Challenge 5
Risk of cross-tenant data leakage in shared environments
Retrieval quality moves output accuracy further than prompt tuning does
Cleaning and structuring documents before embedding beats tuning the retrieval that reads them
Agents with single responsibilities are debuggable; monolithic prompt chains are not
Human escalation has to be designed into the pipeline, not attached to its failure path
Keeping vectors in the primary database made tenant isolation one problem instead of two
Built with technologies we trust.
Project Goals
The Outcome
We built PrismBot as a multi-tenant SaaS platform that lets an organization upload its documents, get a trained assistant, and deploy that assistant to a website widget and a WhatsApp Business number from one admin console. Three months from kickoff to production. The build treats retrieval as the primary engineering problem rather than a solved prerequisite. Documents go through an LLM preprocessing pass before anything is embedded, so chunks carry their structural context instead of arriving as orphaned text. Incoming queries are expanded into several phrasings, searched in parallel, and reranked for diversity before a single token reaches the generation model. Vectors live in PostgreSQL with pgvector behind an HNSW index, filtered by tenant namespace at query time. Above that sits a multi-agent layer built on LangGraph. Separate agents own retrieval, context enrichment, response generation, and a grounding check that decides whether the assistant actually has the evidence to answer. When that check fails, or when someone asks for a person, the conversation moves to a human with the full transcript and the retrieved passages attached.
Conclusion & Impact
"Retrieval quality moved output accuracy further than any prompt change we made. Structured ingestion, multi-query retrieval, and MMR reranking each produced gains that held up as the corpus grew, where prompt tuning tended to fix one class of question and quietly break another. The second lesson was architectural. Splitting the pipeline into agents with single responsibilities made the system debuggable, and it made human escalation a designed path rather than something bolted onto the failure case. A retrieval system that can't recognize when it lacks the evidence to answer is a liability no matter how good its retrieval is the rest of the time."
Have a project in mind?
Let's discuss how we can help you build your next big thing.
Reach out and our team will be in touch.
Building systems that
hold up in production.
Bring up the problem others won't attempt.