Back to projects

Active private build

FileGPT.dev

Engineering consultancy for private AI systems and secure on-premise RAG implementations for business customers.

The source repository for the demo architecture is private; system architecture and assessments are available on request.

FileGPT.dev app preview
Chat interface with document upload and cited answers.

FileGPT.dev is positioned as a B2B engineering agency ('The Compliance Honeypot') for the DACH region. Rather than operating as a standardized SaaS product, the platform demonstrates expertise in implementing private, physically or logically isolated RAG systems. The focus is on 'Sovereignty by Design': companies retain full control over their data, models, and infrastructure.

Verifiable build status: Private on-premise deployment, dedicated retrieval, distributed access control, and operational documentation are implemented in the reference architecture.

Architecture

Loading diagram

Features

  • Citation-first chat — streaming answers with explicit source badges like [Source: file.pdf, Page N] rendered as source chips.
  • Guarded hybrid retrieval — Gemini embeddings with vector search in Supabase (pgvector), plus keyword-style fallback when needed for exact-term recall.
  • Conversation memory — condenses recent messages into a standalone query before retrieval so follow-ups keep context.
  • Ingestion with lifecycle tracking — documents move PROCESSING → COMPLETE/FAILED with chunk counts; supports PDF/TXT/MD/DOCX/XLSX extraction.
  • Operational boundaries — authenticated API routes, user-scoped data access, distributed rate limiting, structured logs, and readiness checks.

Implemented trust boundaries

  • Data minimization: only retrieved top-k chunks are sent to the model for an answer, never entire documents.
  • Source attribution: every answer includes the originating document (and page when available).
  • Authentication and access: Supabase sessions plus RLS scope documents, chunks, chats, and usage data to the current user.
  • Operability: health/readiness endpoints, structured logging, and a production runbook support diagnosis and deployment.
  • Integration: upload and query flows run through authenticated API routes; the source repository remains private.

Security & operations

  • Access isolation: RLS and a private object-storage bucket prevent public or cross-user file access.
  • Abuse controls: distributed Upstash rate limiting is required for production endpoints; query-embedding caching reduces repeat work.
  • Deployment boundaries: production startup can fail closed when required runtime configuration or distributed rate limiting is missing.
  • Observability: structured logs, OpenTelemetry integration, health/readiness diagnostics, and documented operating procedures.

Tech stack

  • Next.js 15 (App Router), TypeScript, Tailwind CSS — UI and routes
  • Vercel AI SDK — streaming chat and AI primitives
  • Google Gemini — chat, condensation, and gemini-embedding-001 vectors (768 dimensions, aligned with pgvector)
  • Supabase — Auth, private file storage, PostgreSQL with pgvector for chunk storage and similarity search

Document ingestion pipeline

  1. Create a document record (PROCESSING), ingest from storage, then mark COMPLETE (with chunk counts) or FAILED.
  2. Extract content by type: PDF (pdf-parse + optional Vision summary for smaller PDFs), DOCX (Mammoth), XLSX (sheet → CSV text), TXT/MD (UTF-8).
  3. Chunking: fixed-size windows or semantic sentence-aware chunking depending on configuration.
  4. Embed with Gemini, store vectors in pgvector with metadata (file name, document id, user scope, snippets) for retrieval.

Repository & demos

View livePrivate repository · Architecture available on request