Back to selected work

03 · Sovereign RAG platform

FileGPT.dev

A private, multi-tenant RAG reference system for internal company knowledge, designed around scoped retrieval, citations, access isolation and operable production boundaries.

Role

AI systems and full-stack engineering

Core decision

Retrieve narrowly; cite every answer

Status

Active private reference implementation

FileGPT private document RAG interface

The problem

Internal knowledge assistants fail trust reviews when documents are public, access boundaries are implicit or complete files are sent to a model. Even a useful answer becomes risky if a team cannot prove which source supported it or whether another user could retrieve the same content.

The architectural decision

FileGPT treats retrieval and authorization as the product boundary. Files remain in a private bucket, rows are protected by Supabase RLS and the SQL retrieval function scopes matches to the authenticated user. Only top-k retrieved chunks enter generation, and the response renders document and page citations.

Private knowledge flow

01

Ingest privately

Authenticated uploads enter private storage and a lifecycle-tracked document record.

02

Extract and index

PDF, DOCX and text content is chunked, embedded with Gemini and written to pgvector with source metadata.

03

Retrieve in scope

A user question is embedded and matched only against authorized document chunks.

04

Generate with evidence

Gemini receives the narrow retrieved context and streams an answer with visible source badges.

What the repository proves

Tenant and file isolation

Supabase Auth, RLS and a non-public storage bucket protect documents, chunks, chats and usage records. Signed URLs and server routes avoid exposing raw storage.

Grounded RAG pipeline

Ingestion, indexing, retrieval and generation are separate server modules. Conversation condensation preserves follow-up meaning while citations retain the source boundary.

Fail-closed production controls

Production can reject missing distributed-rate-limit configuration. Upstash controls endpoint abuse, and authenticated readiness diagnostics avoid publishing sensitive dependency detail.

Operability

Health and readiness routes, structured Pino logs, OpenTelemetry integration, migration checks, smoke tests and production runbooks make the system diagnosable beyond the demo UI.

Reliability boundaries

The model receives retrieved chunks, not entire private documents.

RLS and user-scoped SQL retrieval constrain both storage and semantic search.

Source badges keep the answer connected to originating files and available page metadata.

Runtime configuration and distributed rate limiting can fail closed in production.

What this implementation means

The current repository is a private multi-tenant cloud reference implementation using Supabase and Gemini. It demonstrates the security and retrieval boundaries needed for sovereign deployments; it does not by itself prove that every customer deployment is physically on-premise or air-gapped.

Why it belongs in the top four

FileGPT is the clearest expression of the portfolio’s Sovereign AI positioning. It combines useful document chat with the less visible work that makes RAG credible: private storage, authorization-aware retrieval, citations, abuse controls, readiness diagnostics and operational documentation.