Skip to content
← All work

Multi-tenant enterprise RAG chatbot

DocuChat

A multi-tenant RAG chatbot platform with WhatsApp, Telegram, live human handoff and an 18 KB embeddable widget.

My role: Design and full-stack development: Laravel backend, Vue frontend, RAG pipeline and channels

Visit docuchat-murex.vercel.app ↗
  • RAG
  • Laravel 11
  • Vue 3
  • pgvector
  • Multi-LLM
Screenshot of DocuChat, multi-tenant enterprise rag chatbot, built by Anshuman Verma

Overview

DocuChat is a live multi-tenant RAG platform with Gemini / OpenAI / Claude failover and 768-dimension embeddings on Neon Postgres. Each tenant's knowledge base, conversations and channels are strictly isolated.

The challenge

Businesses want a chatbot that answers from their own documents and website, on the channels their customers already use, without one customer's data ever appearing in another's answers.

DocuChat needed to be a platform rather than a single bot: many tenants, each with an isolated knowledge base, measurable answer quality, a way to hand difficult conversations to a person, and costs each tenant can see.

How it works

  1. 1PDF / crawler
  2. 2Chunk + embed (768-d)
  3. 3Tenant-scoped pgvector
  4. 4Vector cache
  5. 5Gemini / OpenAI / Claude
  6. 6Web · WhatsApp · Telegram

Architecture

The application is Laravel 11 with a Vue 3 frontend through Inertia, on Neon PostgreSQL with pgvector. Tenants upload PDFs or point a crawler at their website; content is chunked and embedded into 768-dimension vectors, and every query is scoped to the tenant so retrieval cannot cross a boundary.

Answers are generated by Gemini, OpenAI or Claude with automatic fallback between providers. A semantic vector cache returns answers to repeat questions in under 15 ms. Automated evaluations measure answer quality and benchmark hallucinations, so prompt or model changes can be compared objectively.

The same knowledge base serves an embeddable web widget under 18 KB, Telegram and WhatsApp channels, and a REST API for developers with HMAC-signed webhooks. When the bot should not handle a conversation, it moves to a live human-handoff inbox with the full history. Token costs are tracked in rupees per tenant.

What I built

Hybrid ingestion

PDFs and a web crawler feed each tenant's knowledge base.

Semantic vector cache

Repeat questions are answered from a pgvector cache in under 15 ms.

Quality evals

Automated answer-quality evaluations and hallucination benchmarks.

Omnichannel

Telegram and WhatsApp channels, plus a live human-handoff inbox for conversations the bot shouldn't own.

Developer platform

REST APIs, HMAC-signed webhooks and an embeddable web widget under 18 KB.

Cost and reliability

Token cost and ROI tracked in rupees; multi-provider LLM fallback; 34/34 Pest test suites passing.

Engineering decisions

  • Isolate tenants at the query layer so no retrieval can cross a tenant boundary.
  • Fail over between three LLM providers so one provider's outage doesn't take customers' bots down.
  • Measure hallucination with automated evals instead of trusting spot checks.

Results

  • Live at docuchat-murex.vercel.app with a demo account.
  • Sub-15 ms responses for cached questions.
  • Strict tenant isolation and multi-provider LLM fallback.
  • 34/34 Pest test suites passing.

Stack

Backend
Laravel 11, Pest
Frontend
Vue 3 (Inertia)
Data
Neon PostgreSQL + pgvector (768-d embeddings)
AI
Gemini, OpenAI, Claude with failover
Channels
Web widget, Telegram, WhatsApp, REST API, HMAC webhooks

Related services

Need something like this?

I can build a version of this for your product, your data and your stack.

Start a project