Work / Case study 4 of 4 · short form · streaming & state

WayFinder

A multi-agent trip planner. It's here for its plumbing more than its AI: resumable streaming, Postgres checkpointing, follow-up threads, rate limits and graceful degradation.

  • LangGraph
  • FastAPI
  • PostgreSQL
  • SSE
  • Groq
  • Pydantic

Engineering in 30 seconds

  • Parser → flights and hotels in parallel → itinerary → write-up
  • Structured output (Pydantic) so the UI renders cards from JSON, not free text
  • ~12 s per plan when Groq's free tier has room; work split across two model sizes to fit 8,000 tokens/min
  • SSE with event IDs: reconnecting with Last-Event-ID replays only what was missed
  • Tests use a fake model and fixture tools; live parser tests are opt-in

Delivery in 30 seconds

  • Intended user: budget-conscious travellers from South Asia (it parses "2 lakhs" as BDT or INR from the origin)
  • Follow-ups on the same thread ("make it cheaper"); shareable URL reopens a plan
  • /health reports Online or Degraded and says why
  • Per-IP rate limit with Retry-After, 300 s plan timeout, 2,000-character input cap
  • Falls back to in-memory state if Postgres is unreachable, and reports that it did
  1. parse_request
  2. flight_agent ∥ hotel_agent
  3. itinerary_agent
  4. write_up
  5. checkpoint (Postgres)
Calls an LLMExternal system / data

Why it’s short

Travel planners are the most common tutorial agent, so I’m not presenting this one as an AI result: it has no eval set. What it shows is the engineering around an agent that has to survive real use: requests that need clarifying, rate-limited free-tier models, dropped connections and restarts.

Decisions worth a look

  • APIs don’t do what their names suggest. The flight-data API returns schedules, not prices, and web search doesn’t return hotel inventory. Prices are labelled as estimates rather than presented as quotes.
  • Currency ambiguity handled explicitly. “2 lakhs” means BDT from Bangladesh and INR from India. The parser infers currency from the origin and records that as an assumption.
  • Parallel where there’s no dependency. Flights and hotels don’t depend on each other, so running them concurrently roughly halves wall-clock time.
  • Mock mode (MOCK_TOOLS=true) with fixtures, so development doesn’t burn API quota.

What it would need to count as an AI result

A 10–15 case golden set (budget parsing, currency inference, follow-ups, missing destination) with pass/fail scoring, and cost per plan. Add this, or keep the page short as it is.


← All case studies