Case study
Multi-Tenant RAG-as-a-Service Platform
An AI infrastructure platform with two APIs: one to ingest a business's private data, one to query it. The focus is multi-tenant architecture, strict data isolation, scalable ingestion, and vector search.
Status: under construction. This section describes the intended design. Nothing here is a claim of completed features or measured performance.
The problem
Businesses want an LLM that answers from their own documents, but each one needs its data kept strictly separate from every other business sharing the platform. Building ingestion, embedding, retrieval, and isolation from scratch for every customer does not scale.
The solution
A shared, API-first platform. Each tenant uploads data through an Ingestion API and asks questions through a Consumption API. Retrieval is scoped to the asking tenant, and the LLM answers with references to the source material.
Architecture
INGESTION PIPELINE
Ingestion APITenant uploads documents
ParsingExtract text content
ChunkingSplit into segments
EmbeddingsGenerate vectors
Vector storePostgreSQL + pgvector
CONSUMPTION PIPELINE
Consumption APITenant sends a query
RetrievalTenant-specific semantic search
LLMGemini via Spring AI
AnswerContext-aware, with source references
API workflows
- Ingest: a tenant submits data to the Ingestion API, which runs parsing, chunking, embedding generation, and vector storage.
- Query: a tenant calls the Consumption API, which retrieves only that tenant's relevant content and passes it to the LLM to produce an answer with source references.
Key design goals
- Multi-tenant architecture with strict data isolation
- Scalable ingestion pipeline
- Vector search over tenant-specific data
- AI-powered answers grounded in retrieved context, with sources
Technology stack
JavaSpring BootSpring AIReactPostgreSQLpgvectorRedisGeminiDocker