RAYAXIS

Blog

Practical RAG Chat on Client Documents with Laravel and Postgres

March 20, 2026ai · rag · laravel · postgres · practical ai

How we approach retrieval-augmented chat over client PDFs and docs using Laravel, Postgres, and sober evaluation — not demo magic.

All posts

The product is answers with receipts

Staff do not need a chatbot personality. They need answers grounded in policy PDFs, with citations they can open.

Architecture we like for client work

  1. Ingest documents into object storage
  2. Extract text, chunk with overlap, store embeddings
  3. Postgres + pgvector (or a managed vector store) filtered by tenant permissions
  4. Laravel API orchestrates retrieval + model call
  5. UI shows answer + source snippets

Permissions are the hard part

If user A cannot download a file, they must not retrieve its chunks. Metadata filters on every query are non-negotiable.

Evaluation before launch

Maintain a question set with expected doc references. Measure retrieval hit rate and answer usefulness with a human spot-check — not only vibe tests.

Cost and latency knobs

Cache repeated questions, cap top-k, and refuse when retrieval confidence is low. “I don’t know” beats a confident hallucination.

Rayaxis builds this class of practical AI into systems clients already trust — usually beside Laravel, not as a separate science project. (Note: an earlier draft on a similar theme may exist; this batch post focuses on the delivery checklist.)

← Back to blog