Skip to content

AI / SaaS proof of concept

Enterprise RAG

A knowledge assistant: an organization connects files, websites and Google Docs, and employees get answers with citations from that knowledge only.

My role
Architecture and full-stack engineering
Stack
Next.jspgvectorRedisBullMQOpenAIDocker

The problem

Company knowledge lives in scattered documents that change hourly to yearly. Employees need trustworthy answers, and every claim must point back to a source.

What I built

  • Pluggable connectors for files, websites and Google Docs, with sync that is incremental (content hashes and cursors) instead of a full rebuild unless the embedding model changes.
  • Postgres with pgvector for hybrid search, and a BullMQ worker that parses, chunks and embeds in the background.
  • A provider adapter over the Vercel AI SDK so OpenAI or Azure OpenAI can be swapped without touching feature code.
  • A multi-tenant-ready schema, plus documentation written first: PRD, architecture, data model, sync rules, ADRs and a security doc covering SSRF and crawl caps.

How it fits together

  1. Connectors
  2. Worker: parse, chunk, embed
  3. Postgres + pgvector
  4. Hybrid retrieval
  5. Cited answer

Highlights

  • Answers cite their sources
  • Incremental sync keeps embedding cost down
  • Runs fully local with Docker Compose