Skip to content

About

AI customer support app using LangGraph and Gemini to route requests, check orders, create tickets, and respond through a fast Dockerized web UI.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Smart Support Agent

A Dockerized customer-support application built with FastAPI, LangGraph, Gemini or Ollama, and PostgreSQL.

Features

  • Browser-based support chat UI
  • Local low-latency request routing
  • Order-status specialist agent
  • Support-ticket specialist agent
  • PostgreSQL conversation checkpoints
  • Gemini and Ollama provider options
  • Docker Compose deployment

Architecture

Browser or API client
        |
     FastAPI
        |
  Local router
   /       \
Order agent  Support agent
   |              |
Order tool    Ticket tool
        \      /
       PostgreSQL

The router classifies requests locally. The selected specialist calls the LLM only when needed. Tool calls are executed by LangGraph and the result is returned to the user.

Requirements

  • Docker Desktop
  • A Gemini API key, or a local Ollama installation

Configuration

Create .env from .env.example:

Copy-Item .env.example .env

For Gemini, set:

LLM_PROVIDER=gemini
GOOGLE_API_KEY=your_api_key_here

For Ollama, set:

LLM_PROVIDER=ollama
OLLAMA_MODEL=llama3.1
OLLAMA_BASE_URL=http://host.docker.internal:11434

Do not commit .env. It is excluded by .gitignore.

Run with Docker

Start the API and PostgreSQL:

docker compose up -d --build

Check service status:

docker compose ps

Open the web UI:

http://127.0.0.1:8080/

Check the health endpoint:

http://127.0.0.1:8080/health

Open the interactive API documentation:

http://127.0.0.1:8080/docs

View application logs:

docker compose logs -f app

Stop the services:

docker compose down

API Example

PowerShell request:

$body = @{
    thread_id = "test-001"
    message = "What is the status of order ORD-1001?"
} | ConvertTo-Json

Invoke-RestMethod `
    -Uri "http://127.0.0.1:8080/api/v1/chat" `
    -Method Post `
    -ContentType "application/json" `
    -Body $body

Example response:

{
  "thread_id": "test-001",
  "response": "The order was handed to the post office and the tracking code is 98765."
}

Project Structure

.
├── app/
│   ├── agent/
│   │   ├── graph.py          # LangGraph workflow and routing
│   │   ├── llm_factory.py     # Gemini and Ollama providers
│   │   └── tools.py           # Order and support tools
│   ├── static/index.html      # Browser chat UI
│   └── main.py                # FastAPI application
├── docker-compose.yml         # API and PostgreSQL services
├── Dockerfile                 # API image definition
├── requirements.txt           # Python dependencies
└── .env.example               # Safe configuration template

Notes

Order data and ticket creation currently use mock functions. PostgreSQL is used for LangGraph conversation checkpoints. Production deployments should use a secret manager and real order and ticket persistence.

About

AI customer support app using LangGraph and Gemini to route requests, check orders, create tickets, and respond through a fast Dockerized web UI.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages