WorkPRJCT /02
Type ↴

Scope ↴
  • Full-stack
  • LLM
  • Caching
Status ↴

About ↴

A full-stack AI customer support chat agent that answers questions about store policies using Google Gemini.

Spur — AI Live Chat Agent

Overview

A full-stack AI customer support chat agent built for the Spur take-home assignment. Users can chat with an AI agent that answers questions about store policies using Google Gemini as the LLM backend.

(Preview)

Screens

Features

  • (001)
    Channel-agnostic LLM servicegenerateReply(history, message) takes plain arrays, so a WhatsApp or Instagram handler can reuse it
  • (002)
    Policies in the database, cached in RedisLoaded on first request and cached for 1 hour — update policies without redeploying
  • (003)
    Escalation handled in code“Talk to a human” is caught by a keyword check and answered without calling Gemini
  • (004)
    GuardrailsOut-of-scope questions get a polite refusal; unknown questions are directed to support email
  • (005)
    Separation of concernsRoutes handle HTTP, services handle business logic

Tech stack

  • React
  • TypeScript
  • Express
  • Gemini
  • FrontendReact, TypeScript, Tailwind CSS, Vite
  • BackendNode.js, Express, TypeScript
  • DatabasePostgreSQL
  • CacheRedis (Upstash)
  • LLMGoogle Gemini (gemini-2.5-flash)

Architecture

  1. POST /chat/message
  2. Input validation (empty, too long)
  3. Escalation check in code
  4. Policies — Redis, then DB on miss
  5. Gemini reply with last 10 messages
  6. Stored in PostgreSQL conversations

LLM notes

  • ProviderGoogle Gemini (gemini-2.5-flash)
  • HistoryLast 10 messages sent for context
  • InputCapped at 2000 characters server-side
  • Policy cacheKey spur:policies, 1-hour TTL

Links

Next projectJobFit →