All case studies
Case study 03Full-StackAI Systems

Streaming AI Workspace

React and FastAPI interfaces that stream answers and tool steps live, with agent runs on async workers.

Role
Senior engineer · full-stack and infrastructure
Core stack
ReactTypeScriptFastAPIRedisDocker
Live
Tokens, tool steps, and citations stream live
Async
Agent runs execute on Redis workers, not web servers
p95
Latency and tool failures monitored per release

Overview

The product surface of the agent platform: a workspace where people watch answers, tool calls, and sources stream in as they happen, while long-running agent jobs execute asynchronously on Redis-backed workers.

Agent runs take anywhere from seconds to minutes and call several tools along the way. Users needed immediate, honest feedback instead of a spinner, long jobs could not tie up web servers, and every environment had to be reproducible.

Product walkthrough

The flow, screen by screen

Streaming workspace
01 / 03

Streaming workspace. Answers stream token by token while the side panel shows each tool step, its timing, and the sources it used.

ArchitectureCorePlatformAsync / control
streamenqueuejobscheckpointsmetricsprovisionsMonitoringp95 latency · tool failuresReact workspaceTypeScript · streamingFastAPIauth · SSERedisqueue · pub/subAgent workersLangGraph · MCP tools · retriesAWSTerraform · DockerPostgreSQLrun state · checkpoints
The React workspace streams from FastAPI; runs are queued in Redis and executed by agent workers that checkpoint to PostgreSQL, on AWS environments provisioned with Terraform.

Approach

  1. 01Built streaming React and TypeScript interfaces that render tokens, tool steps, and citations as they arrive from FastAPI over server-sent events.
  2. 02Moved agent execution to asynchronous workers on Redis, so the API responds immediately and runs survive restarts and deploys.
  3. 03Exposed run status, retries, and cancellation so users and support staff can see exactly where a job stands.
  4. 04Containerized every service with Docker and provisioned AWS environments with Terraform for repeatable development, staging, and production.
  5. 05Monitored p95 latency and tool failures for each release to catch regressions early.

Key decisions

Server-sent events for streaming

One-way streaming fit the product, passed cleanly through standard load balancers, and kept reconnection simple.

Separate the web tier from execution

The API only enqueues runs and relays their events; workers do the heavy lifting, so slow runs never block requests.

Environments as code

Terraform modules make every environment reproducible, and each change shows its plan for review before it is applied.

Outcomes

  • People see progress immediately instead of waiting on a spinner.
  • Development, staging, and production are built from the same Terraform modules.
  • React
  • TypeScript
  • FastAPI
  • Redis
  • Docker
  • AWS
  • Terraform
  • PostgreSQL

Working on something similar?

I work with clients worldwide, across any time zone. Tell me what you're building.