The blog for engineers building AI agents in production.

Long reads with running code, each written from a lab or a client build. Pick a topic, read the post, then build it live on Thursday.

Save a free seat

Every post links the lab that builds it.

    Every post, by topic

    Production

    1. Retry LLM API Calls with BackoffLLM API retry logic for production agents.9 min
    2. Monitor LLMs with Langfuse and GrafanaPut Langfuse LLM metrics in Grafana with the Metrics API and dashboard JSON, next to Prometheus panels, alerts and trace links.9 min
    3. Build a Chatbot API with LangGraphWire LangGraph into FastAPI with token streaming over SSE, a Postgres checkpointer, per-user thread IDs and human in the loop with interrupt.8 min
    4. Monitor AI Agents with PrometheusAdd Prometheus metrics to a FastAPI agent with prometheus-fastapi-instrumentator, LLM token and latency histograms, multiprocess mode, panels and alerts.9 min
    5. Pool Connections in Python AI ServicesManage database connections in a Python AI agent service: pool sizing, pre-ping, lifespan, PgBouncer, and why no connection is held while the LLM streams.10 min
    6. Persist LangGraph State in PostgresHow LangGraph threads and the Postgres checkpointer keep agent state across restarts and replicas, plus a thread table, per-thread locks and pruning.10 min
    7. Separate Dev and Prod Agent ConfigHow .env, .env.development and .env.production differ, how Pydantic Settings loads them in order, and how to keep agent secrets out of git and laptops.8 min
    8. Run FastAPI Agents with UvicornWhat Uvicorn is, why FastAPI needs it, and the production command, workers, lifespan and SSE streaming setup that keeps AI agents up under real traffic.10 min
    9. Design a Production AI ChatbotAI chatbot system design for production, end to end.14 min
    10. Choose the Right LLM for Each TaskRoute each step of an AI app to the smallest model that passes your evals.8 min
    11. Stream AI Responses with SSEWhen to stream LLM tokens with server-sent events or WebSockets, with FastAPI code for both, plus reconnects, cancellation, backpressure and metrics.8 min

    Read it, then build it live

    Save a free seat