What a Knowledge Base Tool actually does
Answers customer support questions by searching indexed documentation with embeddings and generating cited, grounded responses using RAG — under your brand, not Intercom's.
A white-label AI knowledge base tool indexes your client's documentation (articles, PDFs, support tickets, Notion exports) into a pgvector database using text-embedding-3-small, then responds to incoming questions by retrieving the most relevant chunks, reranking them with Voyage rerank-2.5, and generating a grounded answer with citations using Claude Sonnet 4.6 or Claude Haiku 4.5 (depending on the tier). The system includes a source-attribution UI ('Based on article: Refund Policy'), an honest fallback when the answer is not in the knowledge base, and a thumbs-up/down feedback loop that feeds retrieval quality improvement over time. The entire pipeline runs as Supabase Edge Functions, with pgvector handling vector similarity search at no additional cost within the Supabase Pro plan.
The market opportunity is stark. Intercom Fin AI charges $0.99/resolution with no white-label option. Decagon and Ada are enterprise-quote-only. Forethought is enterprise-only. Zendesk AI and Freshdesk Freddy are bundled add-ons to large helpdesk platforms, not white-label products. A self-hosted Claude Haiku 4.5 + pgvector setup answers the same question for ~$0.002 — a 500× cost advantage. At 20 daily support resolutions, Intercom Fin costs $594/month; the custom build costs $1.20/month in AI inference. The custom build pays back in under 1 month at that volume.
AI capabilities involved
RAG-grounded Q&A with citations to source articles
Semantic search across documentation via embeddings
Retrieval reranking for answer quality improvement
Auto-summarization of newly added documents
Conversation history with relevance feedback loop
Who uses this
- SaaS founders and agencies whose customers need a branded AI helpdesk grounded in the customer's own documentation — not a generic LLM
- B2B SaaS companies that want to offer AI support as a feature within their product without paying Intercom Fin's per-resolution pricing at scale
- Customer-success teams at agencies that manage support for 5–20 clients, each with their own knowledge base, who need per-tenant isolation
- Internal knowledge-management teams at professional-services firms building a branded Q&A system over their own SOPs and methodology documents
- Martech platforms that want to add AI search over their documentation as a differentiated feature versus competitors using off-the-shelf helpdesk tools
SaaS alternatives on the market
Real products you can sign up for today — with current 2026 pricing, honest pros and cons.
Intercom Fin
Intercom-native SaaS teams with moderate support volume (under 500 resolutions/month) that don't need to white-label the support surface
No
$0.99/resolution (on top of Intercom plan, from $39/seat/mo)
Pros
- +Best-in-class handoff from AI to human agent — seamlessly escalates unresolved conversations to your support team.
- +Integrates directly with Intercom's helpdesk, ticketing, and CRM — no separate integration required.
- +Multi-language support across 43 languages with automatic detection.
- +Source citations in answers link to the specific help article the answer came from.
Cons
- −No white-label tier — Intercom branding appears on all support widgets and bot personas.
- −Per-resolution pricing is unpredictable and compounds with volume: 1,000/mo = $990, 5,000/mo = $4,950.
- −Requires Intercom as the base platform — if you use Zendesk, Freshdesk, or HubSpot Support, Fin is not an option.
- −Cannot customize the underlying AI model or retrieval strategy — locked into Intercom's proprietary RAG implementation.
Decagon
Enterprise SaaS companies with complex support workflows that need AI agents to take actions, not just answer questions
No
Enterprise quote only
Pros
- +Deeply agentic — can take actions (process refunds, update accounts) not just answer questions.
- +Strong reasoning on complex multi-step support queries.
- +Native integrations with Salesforce, Zendesk, HubSpot, and major CRMs.
- +SOC 2 Type II certified — suitable for enterprise security reviews.
Cons
- −No white-label tier — Decagon brand on all support surfaces.
- −Enterprise-only pricing with high minimum contract thresholds.
- −Onboarding requires a professional services engagement — not self-serve.
- −Overkill for a product whose support volume doesn't justify an enterprise contract.
Forethought
Large enterprise support teams that need AI-assisted triage and routing for human agents, not an end-user-facing RAG chatbot
No
Enterprise quote only
Pros
- +Strongest intent-detection model for support ticket routing and triaging.
- +Native integrations with Zendesk, Salesforce, ServiceNow, and Freshdesk.
- +Workflow automation for ticket summarization, suggested responses, and auto-tagging.
- +Enterprise-grade analytics on support volume, resolution rates, and AI deflection.
Cons
- −No white-label tier — Forethought brand on all agent-facing surfaces.
- −Enterprise-only pricing — not accessible for teams under 50 agents.
- −Primarily agent-assist focused (showing suggested replies to human agents) rather than end-user-facing RAG chatbot.
- −Requires existing helpdesk platform (Zendesk/Salesforce) to be useful — not standalone.
The AI stack
A production RAG knowledge base pipeline has five distinct components: document ingestion, chunking, embedding, vector retrieval, and answer generation. The retrieval quality is determined by the combination of embedding model, chunk size, and reranker — not by the generation model, which is comparatively cheap.
Document embeddings (retrieval layer)
Converts document chunks into vectors for semantic similarity search
text-embedding-3-small (OpenAI)
$0.02/M tokensDefault embedding layer for all knowledge bases with English-primary documentation
voyage-3.5-lite (Voyage AI)
$0.02/M tokensTechnical SaaS documentation where domain-specific retrieval quality matters
Gemini 3.1 Pro (2M context, 'single-shot RAG')
$2/$12 per M tokensMVPs with small knowledge bases where retrieval infrastructure setup time is a bottleneck
Our pick: text-embedding-3-small as the default. For knowledge bases with highly technical content (API docs, engineering runbooks), upgrade to voyage-3.5-lite for better domain-specific retrieval precision.
Vector database
Stores embedding vectors and enables fast approximate nearest-neighbor retrieval
pgvector on Supabase
Included in Supabase Pro ($25/mo); no additional cost up to ~5M vectorsAll builds with fewer than 5M document chunks — covers virtually every knowledge base use case
Qdrant Cloud
Free up to 1GB; $9/mo for 4GB; scales to enterpriseLarge enterprise knowledge bases with millions of document chunks per tenant
Our pick: pgvector on Supabase for all builds. Only migrate to Qdrant when a single tenant's knowledge base exceeds 2M chunks — which requires hundreds of thousands of documents.
Retrieval reranker
Re-scores the top-20 embedding retrieval results to surface the most relevant chunks before passing them to the LLM
Voyage rerank-2.5 (Voyage AI)
Per-query pricing (contact for current rates)Production knowledge bases where answer quality is the primary selling point
Cohere Rerank 3
Per-query pricing (contact for current rates)Multi-language knowledge bases where documentation spans multiple languages
GPT-5.4 nano LLM reranker
$0.20/$1.25 per M tokensMVP builds that want reranking without adding another API vendor
Our pick: Voyage rerank-2.5 for production builds where quality matters. GPT-5.4 nano LLM reranker for MVPs. Skip reranking entirely only on knowledge bases under 100 documents where all chunks are highly relevant.
Answer generation LLM
Generates a grounded, cited answer from the top-k retrieved chunks
Claude Haiku 4.5 (with prompt caching)
$1/$5 per M tokens (cold); $0.10/M cache hitDefault answer generation layer for all tiers — cost is ~$0.002/answer at typical RAG context sizes
Claude Sonnet 4.6 (with prompt caching)
$3/$15 per M tokens (cold); $0.30/M cache hitPremium tier for complex knowledge bases (legal, engineering, clinical) where multi-source synthesis is frequent
Gemini 3.1 Flash-Lite
$0.25/$1.50 per M tokensHigh-volume free tiers where cost is paramount and answer complexity is low
Our pick: Claude Haiku 4.5 with prompt caching for the default tier (~$0.002/answer). Claude Sonnet 4.6 for premium plans where complex multi-document synthesis justifies the 5× cost. Cache the RAG system prompt (chunking instructions, citation format, hallucination guardrails) as a single persistent cache block.
Reference architecture
The pipeline has two phases: ingestion (one-time document processing) and inference (per-query retrieval and generation). The ingestion phase is cheap and runs in the background. The inference phase runs on every user query and must return in under 2 seconds — which requires pre-computed embeddings and fast pgvector retrieval. The hardest engineering challenge is preventing hallucination when the knowledge base doesn't contain the answer.
Document is uploaded to the knowledge base
React frontend + Supabase StorageAdmin uploads PDF, markdown, HTML, or TXT files to Supabase Storage. File metadata (filename, type, tenant_id, source_url) is inserted into the `documents` table with status='pending'.
Document is parsed and chunked
Supabase Edge Function (ingest-document)The Edge Function downloads the file, extracts text (PDF via pdf-parse, HTML via unfluff, markdown as-is), and splits it into 500-token chunks with 50-token overlap using the tiktoken library. Each chunk is inserted into `document_chunks` (tenant_id, document_id, chunk_index, text, token_count) with status='pending'.
Chunks are embedded into vectors
Supabase Edge Function (embed-chunks) — runs in batchA scheduled job processes pending chunks in batches of 100. Each batch is sent to text-embedding-3-small. The returned 1536-dim vector is written to `document_chunks.embedding` (pgvector column). Status updated to 'indexed'. Supabase auto-generates the HNSW index on the embedding column.
Document auto-summary is generated
Supabase Edge Function (summarize-document)After all chunks are indexed, Claude Haiku 4.5 receives the full document text (up to 100K chars) and generates a 2–3 sentence summary stored in `documents.ai_summary`. This summary is displayed in the admin UI and optionally exposed in the chat widget header.
User submits a question in the chat widget
React chat widget → Supabase Edge Function (query-kb)The user types a question in the embedded chat widget (hosted on your product's domain). The question is posted to the `query-kb` Edge Function along with the tenant_id, session_id, and conversation history (last 3 turns).
Query is embedded and retrieval runs
Supabase Edge Function → OpenAI → pgvectorThe Edge Function embeds the user question with text-embedding-3-small. It runs a pgvector cosine_distance query against `document_chunks` filtered by tenant_id, returning the top 20 most similar chunks. The top 20 are passed to Voyage rerank-2.5, which returns a re-scored list; the top 5 are selected as context.
Claude generates a grounded answer with citations
Supabase Edge Function → Anthropic APIThe top 5 chunks, the user question, and the conversation history are sent to Claude Haiku 4.5 with a prompt-cached system prompt containing: 'Answer using only the provided context. If the answer is not in the context, say I don't have information about that in our knowledge base. Always cite the source article title.' The response includes inline citations (Article: [title]) and a hallucination-safe fallback.
Answer is returned with source attribution
React chat widgetThe chat widget displays the answer with clickable source-article badges below the response text. The conversation is stored in `chat_sessions` for the feedback loop. If the user clicks thumbs-down, the query and retrieved chunks are flagged in `feedback_events` for retrieval quality analysis.
Estimated cost per request
~$0.002 per RAG answer on Claude Haiku 4.5 with cached system prompt (query embed $0.0001 + retrieval free + rerank ~$0.0005 + Haiku answer $0.0014); ~$0.008 on Sonnet 4.6 with cold cache
Cost calculator
Drag the sliders to model your actual usage. The numbers update in real time so you can stress-test economics before writing a single line of code.
Assumes a white-label knowledge base product with per-tenant monthly subscriptions. Defaults model 20 active client tenants with 200 daily queries each. AI cost per query is ~$0.002 — the dominant costs are Supabase hosting and document storage.
Estimated monthly cost
$71.40
≈ $857 per year
Calculator notes
- At 20 tenants × 200 queries/day × 30 days = 120,000 queries/mo at $0.002 each = $240/mo in AI costs against $71 fixed infra.
- Intercom Fin comparison: 120,000 queries at $0.99/resolution = $118,800/mo vs. $240/mo — the economics only work this dramatically because Fin charges per resolution, not per query attempt.
- Document ingestion cost is one-time per document: ~$0.0001 per 500-token chunk (embedding). A 100-page knowledge base = ~200 chunks = $0.02 total ingestion cost.
- Prompt caching on the RAG system prompt (assuming 90% cache hit rate at active tenants) reduces answer generation cost from $0.005/query cold to ~$0.0014/query — budget the cold-cache cost for the first query of each session.
Build it yourself with vibe-coding tools
By Sunday evening you'll have a working Lovable app where admins upload documents, AI indexes them into pgvector, and end users ask questions and get cited answers — all under your brand, on your domain.
Time to MVP
12–16 hours (1 weekend)
Total cost to MVP
$25 Lovable Pro + $30 Anthropic + $0 OpenAI (embedding free tier)
You'll need
Starter prompt
Build a white-label AI knowledge base (RAG-powered support wiki) using Vite + React + Supabase + Tailwind CSS with these pages: 1. AUTH: Supabase email/password login. Users belong to a `tenant_id` in their profile. Two roles: 'admin' (can manage documents) and 'viewer' (can only chat). 2. ADMIN DOCUMENT MANAGER (/admin/documents): Admins can upload PDF, TXT, and Markdown files (drag-and-drop or file picker). Each uploaded file appears in a list with columns: filename, status (pending/indexing/indexed/failed), document_count (chunk count), ai_summary (auto-generated), and uploaded_at. A 'Delete' button removes the document and all its chunks. Clicking a document shows a preview panel with the ai_summary and a list of its chunks. 3. EDGE FUNCTION (ingest-document): Accepts a document_id. Downloads the file from Supabase Storage. Extracts text (for PDF, use the pdf-parse npm package; for MD/TXT, read as string). Splits text into 500-character chunks with 50-character overlap. Inserts each chunk into the `document_chunks` table (tenant_id, document_id, chunk_index, text). Calls OpenAI text-embedding-3-small API with each chunk (batch up to 100 at a time). Stores the returned embedding vector in `document_chunks.embedding` (vector(1536) pgvector column). After all chunks are embedded, calls Claude Haiku 4.5 with the first 5,000 chars of the document to generate a 2-sentence summary. Stores the summary in `documents.ai_summary`. 4. CHAT WIDGET PAGE (/chat or embeddable as a web component): A clean chat interface with a message input, send button, and message thread. User messages appear on the right; AI responses on the left with source attribution badges below each response (showing the document title the answer came from). An 'I don't have information about that in our knowledge base' fallback message when no relevant chunks are found. 5. EDGE FUNCTION (query-kb): Accepts: question (string), tenant_id, session_id, conversation_history (last 3 turns array). Steps: (a) embed the question with text-embedding-3-small, (b) run pgvector cosine_distance query: SELECT text, document_id FROM document_chunks WHERE tenant_id = $tenant_id ORDER BY embedding <=> $query_embedding LIMIT 5, (c) fetch document titles for the returned document_ids, (d) call Claude Haiku 4.5 with system prompt: 'You are a support assistant. Answer using ONLY the context below. If the answer is not in the context, say exactly: I don\'t have information about that in our knowledge base. Always cite the source at the end as Source: [document title].' Include the retrieved chunks and conversation history. Return the answer text and an array of source document titles. 6. FEEDBACK: Each AI response has thumbs-up/thumbs-down buttons. On thumbs-down, insert a row in `feedback_events` (session_id, question, chunks_used, response, tenant_id). Show a simple feedback count on the admin page. All tables need RLS: document_chunks and documents filtered by tenant_id. Admins can insert/delete; viewers can only SELECT their tenant's chunks via the Edge Function (not directly).
Paste this into Lovable
Follow-up prompts (run in order)
- 1
Add multi-tenant support so each client gets their own isolated knowledge base. Add a `tenants` table (name, slug, plan, created_at). The admin document manager shows only this tenant's documents. The chat widget URL includes the tenant slug (e.g., /chat/acme-corp). The query-kb Edge Function uses the tenant_id from the URL param — validate it against the `tenants` table before running any queries. Tenant admins can only see and manage their own documents.
- 2
Add a reranking step to the query-kb Edge Function. After retrieving the top 20 chunks via pgvector, implement a simple LLM reranker: call GPT-5.4 nano with a prompt asking 'Rate the relevance of each of these 20 text chunks to the question on a scale of 1-10. Return a JSON array of {chunk_index, score}.' Sort by score descending and pass only the top 5 chunks to Claude Haiku for answer generation. Log whether the reranker changed the top-5 selection in the `query_logs` table for analysis.
- 3
Add a 'Related Questions' feature at the bottom of each chat response. After Claude generates an answer, make a second call to Claude Haiku 4.5 asking: 'Based on this question and context, suggest 3 related follow-up questions the user might ask. Return as a JSON array of strings.' Display these as clickable chips below the AI response. Clicking a chip sends it as the next user message.
- 4
Add an analytics dashboard for admins at /admin/analytics. Show: (1) total queries this month per day as a line chart, (2) top 10 most-asked questions (from query_logs), (3) thumbs-down rate this month as a percentage, (4) most-cited documents (which document titles appear most in source attributions from query_logs). Use a simple Recharts bar/line chart library for visualizations.
- 5
Add Stripe billing for white-label resellers. Create a Billing page showing the current plan (Free: 1 tenant, 100 queries/day; Pro: $49/mo, 5 tenants, 2,000 queries/day; Agency: $149/mo, unlimited tenants). Implement plan-based rate limiting in the query-kb Edge Function: check the tenant's plan and query count for today against the limit. Return a 429 with message 'Daily query limit reached — upgrade your plan' when exceeded. A Stripe Checkout integration allows upgrading directly from the Billing page.
Expected output
A working branded AI support wiki where admins upload documents, AI indexes them in under 60 seconds per document, and end users receive cited answers to their questions — with a 'not found' fallback that prevents hallucination.
Known gotchas
- !Lovable's first attempt at the pgvector query will use the wrong SQL syntax for cosine distance — the correct operator is `<=>` for cosine_distance in pgvector, not `<->` (which is L2 distance). Verify the generated SQL before testing.
- !The pgvector HNSW index must be created after the extension is enabled: `CREATE INDEX ON document_chunks USING hnsw (embedding vector_cosine_ops)` — without this, cosine_distance queries run as full table scans and will timeout above 10,000 chunks.
- !Claude Haiku 4.5 will hallucinate if the context chunks are sparse relative to the question — the hallucination guardrail prompt (`Answer using ONLY the context below`) must be in the system prompt, not the user message, to reliably prevent this behavior.
- !Supabase Edge Functions have a 150MB memory limit and a 60-second execution timeout — large PDF ingestion (50+ pages) can exceed the timeout. Break the ingest into two separate calls: one for text extraction and chunking, one for embedding.
- !The tenant_id scoping in the pgvector query is critical for multi-tenant isolation — Lovable frequently generates a query that embeds the tenant filter as a WHERE clause on the document_chunks table but misses adding the same filter when joining to `documents` for the source title lookup.
- !OpenAI's text-embedding-3-small has a maximum input length of 8,191 tokens — chunks exceeding this will fail silently (OpenAI truncates them). Add a pre-check to ensure no chunk exceeds 500 tokens before embedding.
Compliance & risk reality check
A knowledge base tool indexes and serves customer-facing content. The main compliance risks are hallucination liability for incorrect support answers, GDPR on indexed customer data, and HIPAA if the tool is used in healthcare support contexts.
Hallucination liability for support answers
When an AI knowledge base gives a confidently wrong answer (e.g., 'Your refund will arrive in 3 days' when the actual policy says 14 days), the customer may rely on that answer and suffer financial harm. This is a product liability risk even if your ToS disclaims accuracy. The hallucination rate on Claude Haiku 4.5 with strong RAG guardrails is ~2–5% on well-indexed knowledge bases.
Mitigation: Implement two mandatory safeguards: (1) 'Answer using ONLY the provided context' in the system prompt with explicit instructions to return 'I don't have information about that' when context is insufficient; (2) always surface source citations so users can verify answers against original articles. Add an 'Escalate to human' button visible on every response for queries the AI answers with low confidence.
GDPR Article 17 right-to-erasure on indexed customer data
If your knowledge base indexes support tickets, chat transcripts, or other customer-generated content containing personal data (names, emails, order IDs), those records are subject to GDPR erasure requests. When a customer requests deletion of their data, you must delete not only the source ticket but also all document chunks derived from it, plus the embedding vectors for those chunks.
Mitigation: Implement a document deletion cascade: when a document is deleted from `documents`, a database trigger must also delete all rows in `document_chunks` with the matching document_id. Test this cascade with a real deletion before indexing any personal data. For indexed support tickets, store the original ticket ID in the `documents` table so deletion requests can be matched to indexed documents.
SOC 2 for enterprise buyers
Enterprise SaaS buyers (5,000+ employee companies) routinely require SOC 2 Type II certification before approving a new knowledge base or support tool. SOC 2 requires documented access controls, change management, incident response, and availability monitoring. Without it, you will fail most enterprise security reviews.
Mitigation: Supabase Pro is SOC 2 Type II compliant (covering the database layer). Vercel is SOC 2 Type II compliant (covering the frontend). Anthropic's API has enterprise security documentation. For the full SOC 2 audit, use a tool like Vanta ($12,000–$20,000/yr) to automate evidence collection and prepare for the Type II audit, which takes 6–12 months.
HIPAA if used in healthcare support contexts
A knowledge base tool used by healthcare organizations to answer patient questions about appointments, medications, or clinical procedures processes PHI (Protected Health Information). This requires a HIPAA BAA with every vendor in the stack — Anthropic (via AWS Bedrock), Supabase (BAA on Team plan), and Cloudflare.
Mitigation: Do not market this tool for healthcare support without first routing Claude through AWS Bedrock (which has a cloud-level HIPAA BAA) and executing a BAA with Supabase on their Team plan. Disable the conversation history logging feature (which stores PHI) unless you implement HIPAA-compliant data retention and access controls.
Build vs buy: the real math
4–6 weeks
Custom build time
$13,000–$20,000
One-time investment
1–3 months
Breakeven vs buying
At 600 support resolutions/month, Intercom Fin costs $594/month with no white-label option. A Claude Haiku 4.5 + pgvector custom build at the same volume costs ~$24/month in AI inference ($0.002 × 600 × 20 clients). A $15K RapidDev build pays back in 26 months from subscription revenue alone — but the comparison is wrong: the real question is whether you're replacing an existing Intercom Fin spend. If you're currently paying $594/mo for Fin, the custom build pays back in 3 months from savings, plus you gain a product asset worth far more than the build cost. As model prices fall (Claude Haiku already dropped 67% from Haiku 3.5 to 4.5), the per-query cost will continue to decrease, making the margin advantage wider every quarter.
Skip the DIY — RapidDev builds the production version
A Lovable MVP gets you a demo. Production needs auth that doesn't leak data, AI calls that don't bankrupt you, observability when models drift, and code you can audit. That's what we ship.
Discovery call (free)
30 minWe map your exact Knowledge Base Tool use case: who uses it, target volume, AI model choice, integrations, compliance scope. You get a detailed scope document and fixed-price quote within 48 hours.
AI-accelerated build
4–6 weeksOur engineers use Claude Code, Lovable, and custom tooling to ship 3–5x faster than agencies. You see weekly progress in a staging environment — not a black box.
Launch + handoff
1 weekWe deploy to your infrastructure, transfer the GitHub repo, set up CI/CD and monitoring, and train your team. You own 100% of the source code, prompts, and model configurations.
What you get
Timeline
4–6 weeks
Investment
$13,000–$20,000
vs SaaS
ROI in 1–3 months
30-min call. Fixed-price quote within 48 hours. No commitment.
Frequently asked questions
How much does it cost to build a white-label AI knowledge base tool?
A RapidDev custom build runs $13,000–$20,000 for a 4–6 week project covering multi-tenant document ingestion, pgvector chunking and embedding, Voyage reranking, Claude Haiku 4.5 answer generation with hallucination guardrails, source attribution UI, feedback loop, and Stripe billing. A Lovable DIY build costs $25 Lovable Pro plus ~$30 in Anthropic API credits for the first month, with no reranking layer.
How long does it take to ship a RAG-powered knowledge base product?
A Lovable MVP with document upload, pgvector indexing, and AI Q&A with citations takes one weekend — roughly 12–16 hours including setup. A RapidDev production build with multi-tenant isolation, reranking, feedback analytics, and Stripe billing takes 4–6 weeks. The reranker integration (Voyage rerank-2.5) adds 3–4 days but improves answer relevance by 20–40% — it is worth the time.
How does RAG prevent the AI from making up answers?
RAG (Retrieval-Augmented Generation) constrains the AI to answer only from the documents you've indexed. The system prompt contains an explicit instruction: 'Answer using ONLY the provided context below. If the answer is not in the context, say I don't have information about that in our knowledge base.' Claude Haiku 4.5 follows this instruction reliably when the guardrail is in the system prompt. Without this constraint, the LLM will answer from its training data and produce confident but wrong answers.
What is the difference between a knowledge base and a document management system?
A knowledge base (this page) is answer-oriented: users ask natural-language questions and get cited AI answers. A document management system (DMS) is storage-and-workflow oriented: it organizes documents with version control, access permissions, e-signatures, and retention policies. A knowledge base is a great first product; a DMS is what you build when clients need structured document workflows on top of the search layer.
Can RapidDev build this for my SaaS product or agency?
Yes. RapidDev has shipped 600+ production applications including RAG-based AI products with multi-tenant document isolation. The standard knowledge base build at $13K–$20K includes document ingestion, pgvector semantic search, Voyage reranking, Claude Haiku 4.5 generation with hallucination guardrails, source attribution UI, conversation history, thumbs-down feedback loop, and Stripe subscription billing. Book a free 30-minute consultation at rapidevelopers.com.
How do I keep client knowledge bases isolated from each other in a multi-tenant product?
Every Supabase table (`documents`, `document_chunks`, `chat_sessions`) has a `tenant_id` column with an RLS policy that restricts SELECT, INSERT, UPDATE, and DELETE to rows where `tenant_id` matches the authenticated user's workspace ID. The pgvector cosine_distance query includes `WHERE tenant_id = $tenant_id` as a mandatory filter before the embedding similarity sort. Without both of these safeguards, one client's knowledge base content can appear in another client's AI answers.
How should I handle questions the AI can't answer from the knowledge base?
The AI should return the exact message 'I don't have information about that in our knowledge base' rather than attempting to answer from training data. Below this message, display three options: 'Search our help articles' (keyword search fallback), 'Contact support' (links to your support email or ticket form), and optionally 'Ask the team' (creates a support ticket with the unanswered question pre-filled). Log all unanswered queries in `feedback_events` so you can identify documentation gaps and add new articles.
Want the production version?
- Delivered in 4–6 weeks
- You own 100% of the code
- AI cost monitoring built in
30-min call. No commitment.