Technical architecture

A straightforward, production-shaped path from request to response — a Next.js frontend, a FastAPI backend, and a LangGraph agent that decides when to retrieve knowledge, call a tool, or just answer.

Next.js 16

App Router · streaming UI over SSE

FastAPI

REST + Server-Sent Events

LangGraph Agent

Tool-calling loop, per-session memory

LLM

OpenAI gpt-5.4-nano

RAG

FAISS + text-embedding-3-small

Tools

Booking, pricing, hours, leads

PostgreSQL

Leads, chats, analytics, documents

Tech stack

Frontend

  • Next.js 16 (App Router)
  • TypeScript
  • Tailwind CSS v4
  • shadcn/ui
  • Framer Motion

Backend

  • FastAPI
  • Python 3.13
  • SQLAlchemy
  • Pydantic

AI / Agent

  • LangGraph
  • LangChain
  • OpenAI gpt-5.4-nano
  • text-embedding-3-small
  • FAISS

Infrastructure

  • PostgreSQL
  • Docker Compose

Engineering highlights

  • Token-level streaming over SSE, parsed manually on the client (no vendor lock-in to a specific chat SDK)
  • Tool-calling agent that decides between RAG search, structured business tools, or a direct reply
  • Hallucination guard: a similarity threshold plus an explicit system-prompt rule to refuse ungrounded answers
  • Per-session conversation memory via a LangGraph checkpointer, keyed by session id
  • Conversational multi-turn slot-filling for lead capture (no rigid form, no repeated questions)
  • PDF upload → chunk → embed → live FAISS index update, searchable without a server restart
  • Admin analytics computed live from logged queries — no precomputed/mocked metrics