SANG CAO LABS · projects

Support Copilot

What it proves

Support Copilot turns an uploaded product or policy PDF into a temporary document session. A visitor can review the source PDF beside the conversation, ask questions, and inspect the exact passages used to produce each answer.

The project is built to demonstrate more than a basic LLM integration. Document ingestion, grounded retrieval, verifiable citations, safe fallback, quota controls, asynchronous processing, and operational visibility are all part of the product boundary.

Capabilities

  • Public, no-sign-up PDF assistant
  • Processed document preview with highlighted answer references
  • Grounded, streaming answers with validated citations
  • Honest fallback when the knowledge base lacks sufficient evidence
  • Global public demo quota and higher-quota access passes
  • Temporary document and session lifecycle with administrator cleanup
  • Feedback, usage, latency, and estimated cost reporting
  • Retrieval and answer-quality evaluation

Architecture

The browser talks to a Laravel business API. Laravel owns anonymous sessions, document authorization, quota enforcement, storage, queues, and application records. A private FastAPI service owns document processing and the AI workflow. PostgreSQL stores application data and vector embeddings, while Redis supports queues and short-lived state.

Splitting the two services keeps the AI workflow replaceable: the provider sits behind an application-level boundary, so the business API never depends on a specific model vendor.

Stack

  • React 19.2, TypeScript 6, Vite 8.2
  • PHP 8.5, Laravel 13
  • Python 3.13, FastAPI
  • PostgreSQL 18 with pgvector 0.8.2
  • Redis 8.4
  • Nginx, Docker Compose
  • OpenAI behind an application-level provider boundary

Status

The repository foundation, public product shell, core Laravel domain model, anonymous document ownership, administrator API, automated checks, and live container topology are in place. Visitors can upload a PDF into private storage, restore it within their anonymous session, preview it through an authorized source endpoint, and remove it.

A separate request hands the authorized PDF from Laravel to FastAPI, which extracts normalized text with page and line coordinates, creates deterministic token-aware chunks with traceable source ranges, and generates bounded batches of embeddings. Persistence, asynchronous processing, retrieval, and live chat are being delivered incrementally.