-
-
Auth0 authentcation
-
Role: Admin - Page Chat
-
Role: Member - Page Library
-
Role: Super Admin - Page Audit trail
-
Role: Member - Page Audit trail
-
Role: Member - Page chat
-
Role: Super Admin - Page Manage admins
-
kiro Workspace
-
Role: Admin - Page Audit Trail
-
Role: Admin - Page Manage members
-
First login Onboarding
-
Landing page
Inspiration
Legal and medical information is often buried in complex documents, making accurate information retrieval challenging. Although LLMs simplify question answering, hallucinations and unsupported claims remain serious concerns in high-stakes domains.
We wanted to build an AI platform where reliability comes before fluency, answers are backed by verifiable evidence, and insufficient information results in an explicit refusal rather than fabricated responses.
What it does
MLQA-RAG is a multi-tenant Retrieval-Augmented Generation platform for legal and medical question answering.
The completed MVP includes:
- Advanced RAG: Semantic retrieval across document collections.
- Evidence-Grounded Answers: Contextual responses based on retrieved documents.
- Citation Verification: Traceable references to supporting source material.
- Hallucination Mitigation: Validation of generated answers against retrieved evidence.
- Intelligent Refusal: Handles queries when sufficient evidence is unavailable.
- Multi-Tenant Architecture: Isolated organizational and user-level resources.
- Security and Auditing: Role-based authorization, PostgreSQL Row-Level Security, and tamper-evident audit mechanisms.
How we built it
We developed the MVP using a modular architecture separating document ingestion, retrieval, generation, verification, authentication, and auditing.
Technology stack:
- Backend: Python and FastAPI
- Frontend: Next.js 16 and TypeScript
- Database: PostgreSQL 18 with pgvector
- AI: Google Gemini
- Authentication: Auth0
- Infrastructure: Docker and Docker Compose
- Security: PostgreSQL RLS and cryptographically chained audit records
The implemented pipeline processes documents, retrieves relevant passages, generates contextual responses, and validates supporting evidence before delivering answers.
Challenges we ran into
Our biggest challenge was ensuring that generated answers remained grounded in documentary evidence. Retrieval alone cannot guarantee correctness, requiring additional attention to claim validation, citation accuracy, and refusal mechanisms.
Implementing strict tenant isolation was another challenge. We needed consistent authorization across the frontend, backend, and database layers while maintaining audit integrity and reliable verification workflows.
Accomplishments that we're proud of
- Successfully built an end-to-end working MVP.
- Implemented a legal and medical RAG pipeline.
- Integrated evidence-grounded generation and citation verification.
- Developed hallucination mitigation and refusal mechanisms.
- Established multi-tenant access isolation.
- Implemented tamper-evident audit mechanisms.
- Created automated verification gates for critical system behavior.
We are particularly proud of building a functional foundation that prioritizes reliability, security, and traceability.
What we learned
We learned that production-oriented AI requires much more than connecting an LLM to a vector database. Retrieval quality, generation accuracy, citation verification, and security must work together.
The project strengthened our understanding of advanced RAG architectures, semantic search, vector databases, database security, and systematic AI evaluation.
Most importantly, we learned that an AI system should recognize when its evidence is insufficient rather than pretend to know the answer.
What's next for MLQA-RAG
With the MVP established, our next phase focuses on improving retrieval accuracy through hybrid search and advanced reranking, enhancing document extraction through OCR and multimodal processing, expanding evaluation datasets, and strengthening production monitoring.
Our long-term vision is to evolve MLQA-RAG into dependable AI knowledge infrastructure where every answer is evidence-backed, explainable, verifiable, and accountable.
Built With
- artificial-intelligence
- auth0
- cybersecurity
- docker
- fastapi
- google-gemini
- information
- machine-learning
- multi-tenancy
- natural-language-processing
- next.js
- oauth-2.0
- pgvector
- postgresql
- python
- rest-api
- retrieval-augmented-generation-(rag)
- semantic-search
- typescript
- vector-database