Knowledge Assistant: Multi-Tenant RAG SaaS
★ Featured
Next.js 15 | MongoDB Atlas Vector Search | LangChain | Auth.js | TypeScript
- Multi-tenant SaaS that turns an organization's PDFs into an embeddable question-answering assistant whose answers cite the exact document and page.
- Two-LLM pipeline (Decomposer → Synthesizer) around a deterministic "System 1" rules engine in plain TypeScript, so eligibility and policy-routing decisions are made by tested code, never by the LLM.
- Grounding check verifies every citation against retrieved chunks and strips fabricated ones; tenant isolation is enforced by scoped repositories, a Mongoose guard plugin and Atlas Vector Search pre-filters.
- Embeddable iframe widget secured by hashed, revocable assistant tokens, per-token CSP frame-ancestors and CORS origin checks; covered by a Vitest suite on an in-memory MongoDB replica set.