◆ SaaS · Custom RAG development services
Custom RAG development for SaaS
A search box that understands questions is now an expectation. The difficulty is not the model, it is the isolation: the index holds many customers’ data and each query must see only its own.
We build tenant-scoped hybrid retrieval over customer content, help docs and tickets, with permission checks at query time and an audit log of what was retrieved.
What is custom RAG development for SaaS?
It is building retrieval that lets a product answer questions from each customer’s own data and from your documentation, with permissions enforced at query time so tenants never see each other’s content. Citations and an evaluation set keep answers trustworthy as the product changes.
What we build
- Tenant-scoped retrieval over customer content and documentation
- Permission filters applied at query time, not in the prompt
- Citations linking each answer to the source record
- Incremental indexing so new data is searchable quickly
- Evaluation sets built from real support and search queries
Isolation by design
Putting permissions in the prompt is not isolation. Filters belong in the retrieval layer, applied before any text reaches the model, with tenant identifiers on every record. We log retrievals per answer so you can show a customer exactly what was used. The design builds on our custom RAG development work.
Keeping the index fresh and accurate
Customer data changes constantly, so indexing is incremental and deletions propagate. Quality is tracked on a fixed evaluation set that re-runs when anything changes. Our delivered hybrid retrieval, described in the graph and vector retrieval case study, improved query accuracy by 40% with latency under 200ms.
RAG for SaaS: the build, step by step
A RAG SaaS platform starts with a data inventory. List every source: customer records, uploaded files, help docs, tickets. For each, note who may see it and how it changes. That inventory becomes the tenant and role model for the index.
Then we ingest, chunk and index with tenant identifiers on every record, build the permission filter, and add citations. Last comes the evaluation set from real queries. Each stage has a check you can see. Context on AI for SaaS companies is on the industry page.
Tenant isolation tests and the evaluation set
Tenant isolation needs its own tests, separate from answer quality. We write queries that try to cross boundaries: a user in tenant A asking about tenant B’s content, a removed user, a changed role. Each must return nothing. These tests run on every release.
The quality evaluation set covers accuracy, citation correctness and refusals. Keep both sets in version control. When a customer asks how you protect their data, you can show the tests and the retrieval logs rather than a promise.
LLM cost control and when not to build
Retrieval cost scales with index size and query volume. LLM cost control means retrieving less text per answer, caching frequent queries, and routing easy questions to smaller models. What you pay depends on workload, so we trace it per feature from day one.
Do not build custom retrieval if your docs are few and public. A hosted docs search may be enough. Build when you need per-tenant data, live permissions or tight latency. Pair it with AI agents for SaaS when an in-product assistant must take actions, not only answer. Options are on the engagement models page.
Integrations and data preparation
Sources vary in shape. Relational records, rich text, attachments and chat logs each need their own ingestion path. We build connectors that carry the tenant identifier and permission metadata through to the index, so filters have something to work with at query time.
Attachments are the usual surprise. PDFs, spreadsheets and images need extraction before they can be searched, and some are best left out. We agree an inclusion list with you and report what was skipped. Cost and speed of ingestion depend on data volume and change rate.
A worked example: answering from one tenant’s data
Picture an in-product assistant inside an invoicing product. A user asks, “Why was the March invoice for Acme higher than February?” The retrieval layer starts with the user’s tenant and role, and only then searches. It pulls the two invoices, the line items that changed and any plan-change note in the account history. The model compares them and writes a short explanation with a link to each record. Nothing from another tenant can appear, because the filter ran before the model saw any text. If the history holds no plan change, the answer lists the line differences and says it found no recorded reason. That honest gap is useful. It tells the user where to look next, and it tells your team what the product fails to record.
Now consider the same question from a user with limited rights, such as a viewer role without billing access. The filter removes the invoice records, and the assistant replies that it has no permitted sources for that question. It does not hint at what exists. We test this case explicitly, along with removed users and changed roles, because a RAG SaaS platform fails in the edges, not the middle. The worked example also shows why a data inventory comes first. Without knowing which record types exist and who may read each one, no filter can be written correctly. We usually build the example for two or three real question types before indexing everything, so design flaws appear early.
Piloting retrieval and what to measure
Run a pilot on one content type and a handful of friendly tenants. Start with documentation and tickets, which carry lower risk than customer records. Ship the assistant behind a flag so you can disable it per tenant. Collect real questions for a few weeks before tuning anything. Then score a sample by hand: was the right source retrieved, was the answer faithful to it, and did the citation point to the right place. Track the decline rate and the share of answers users rate unhelpful. A high decline rate with good precision means gaps in your content, which is a content problem, not a model problem. Keep a separate tally of any isolation test that fails. That tally should stay at zero, and a single failure blocks release.
Compare the assistant with what users do today. If they use a keyword search box, run the same questions through both and compare the first result. If they open support tickets, count how many of those tickets the assistant could have answered from your docs. Those comparisons give you a baseline that a stakeholder can read without a machine-learning background. Be careful with deflection claims. A user who gives up has not been helped. Prefer measures such as task completion and repeat contact. If a measure cannot be collected in the product today, say so early, and we will add the instrumentation as part of the pilot rather than discovering the gap at the end.
Operating the index after launch
Once live, the index is a production data system. Customers add, edit and delete content all day, and the index must follow. We monitor ingestion lag per source, failed documents and deletions that have not propagated. Alerts go to a named owner on your platform team. Weekly, someone samples answers and checks them against sources. Monthly, the full evaluation set and the isolation tests run again, even if nothing changed, to catch silent drift. When you add a new feature or content type, it enters the pipeline through a checklist: owner, permission model, chunking rules and test queries. Skipping that checklist is how quiet leaks begin. We document it so a new engineer can follow it without asking us.
Model and prompt changes follow the same discipline. Pin versions, test upgrades on the evaluation set and keep a rollback path. Watch cost per query and per tenant, because a few heavy tenants can dominate spend. LLM cost control gets easier when retrieval returns fewer, better passages and when frequent questions are cached. Decide in advance what happens when a tenant hits its limit, whether that means slower answers, a smaller model or a polite message. The right policy depends on your pricing and on workload, so we agree it with product and finance together. Log retrievals for audit, and let your counsel set how long you keep them.
Build versus buy, and handing it over
Hosted assistants and search add-ons cover many SaaS products well. Buy one when your content is mostly public documentation, when the vendor’s connectors reach your sources and when you do not need per-tenant answers. It is faster to launch and cheaper to run. Build when answers depend on each customer’s own records, when your permission model is specific to your product or when you must show customers exactly which data was used. Ask any vendor how it enforces tenant isolation, whether you can inspect retrievals and how you export your index if you leave. Vague answers are a warning. Also ask how it handles deletions, since stale content is a common complaint after launch.
If you build, plan the handover from the start. You receive the code, the ingestion connectors, the permission filters, the evaluation and isolation test suites, the dashboards and a runbook. We pair with your engineers so they can add a source or a tenant rule without us. For wider context on AI for SaaS companies, see the industry page, and for how retrieval pairs with actions in the product, see our AI agent development services. If you want help after launch, the engagement models page explains how ongoing support is structured. Running it yourselves is a fair outcome, and we design for that.
Proof, from delivered work
Related
This page sits between a service and a sector. Read the full custom rag development services page, or the saas ai development company page. Also in this sector: ai agent development for saas.
Frequently asked
How do you test tenant isolation?
With adversarial queries that try to cross tenant and role boundaries. Each must return nothing, and the tests run on every release.
What does retrieval cost at scale?
It depends on workload, index size and query volume. We trace cost per feature during a pilot and use routing and caching to control it.
When is a hosted docs search enough?
When your content is small and public. Build custom when you need per-tenant data, live permissions or tight latency.
How do you stop cross-tenant leaks?
Tenant and role filters run in the retrieval layer before the model sees any text, and every retrieval is logged.
How fast does new data become searchable?
Indexing is incremental. Latency to searchable depends on your data pipeline and is agreed in scoping.
Can answers cite the source record?
Yes. Each answer links to the record or passage behind it.
What about deleted data?
Deletions propagate to the index so removed content stops appearing in answers.
Do you claim SOC 2?
No. We build isolation and audit logging you can show customers who ask.
Custom RAG development for SaaS?
Production-grade, owned end to end. Usually a reply within a day.