Getting started
Project setup
Create the ai-customer-support repo with uv, add the dependencies, the settings file, and a FastAPI app with a health check.
By the end of this page you have a Python project with every dependency installed, a .env file, and a FastAPI app that answers on /health.
Create the project
uv init ai-customer-support --python 3.13
cd ai-customer-support
rm main.py
mkdir app scripts
touch app/__init__.py--python 3.13 pins the version, so the Docker image later uses the same one.
Add the dependencies
uv add "fastapi[standard]" pydantic-settings python-dotenv "psycopg[binary]" google-api-python-client google-auth "pydantic-ai-slim[anthropic]"
uv add --dev google-auth-oauthlib pydantic-evalsThe dev group holds the tools that only run on your laptop, the one-time Gmail login script and the evals. The server image skips it.
Ignore secrets
Add these lines to the .gitignore that uv created:
.env
credentials.json
node_modules/
dashboard/dist/Create the environment file
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REFRESH_TOKEN=
DATABASE_URL=
ANTHROPIC_API_KEY=
CLASSIFIER_MODEL=anthropic:claude-haiku-5-5
AGENT_MODEL=anthropic:claude-sonnet-5-5
POLL_INTERVAL_SECONDS=30
DASHBOARD_USERNAME=admin
DASHBOARD_PASSWORD=
PYDANTIC_AI_NO_BANNER=1cp .env.example .envYou fill in the values on the next pages. PYDANTIC_AI_NO_BANNER hides the welcome banner that Pydantic AI prints on the first agent run. Keep POLL_INTERVAL_SECONDS at 30 while you build and test. In real use, 600 seconds is plenty, because customers expect an email answer within hours.
Add the settings
from dotenv import load_dotenv
from pydantic_settings import BaseSettings
# Load .env into the environment, so Pydantic AI also finds ANTHROPIC_API_KEY.
load_dotenv()
class Settings(BaseSettings):
google_client_id: str
google_client_secret: str
google_refresh_token: str
database_url: str
classifier_model: str = "anthropic:claude-haiku-5-5"
agent_model: str = "anthropic:claude-sonnet-5-5"
poll_interval_seconds: int = 60
dashboard_username: str = "admin"
dashboard_password: str = ""
settings = Settings()The models are plain settings. Swapping a model is a change in .env, not in code.
Add the FastAPI app
from fastapi import FastAPI
app = FastAPI(title="AI customer support")
@app.get("/health")
def health() -> dict:
return {"status": "ok"}Dictate your prompts
Prompting a coding agent goes faster when you speak instead of type. The video uses Glaido for that. It handles technical terms well, and its custom dictionary keeps names like Pydantic, Supabase, and FastAPI spelled right.
Glaido is the dictation tool used in the video. Dictate prompts with technical terms, and add your own words to the custom dictionary.
Get one free monthCheck
uv run fastapi dev app/main.pyOpen http://localhost:8000/health in your browser.
{"status": "ok"}