Case study Datavio · AI agents

An AI analyst that plans its own analysis

Dashboards answer the questions you thought of in advance. I built an agent on the OpenAI Agents SDK for the rest — it breaks a question into steps, runs them against real data and explains what it found.

Role
Built from scratch
Context
Datavio · analytics product
Stack
OpenAI Agents SDK · FastAPI · Redis
Runs on
Azure VM
An illustrative run: the agent turns one question into a plan, pulls and compares the data it needs, then explains the result.
TL;DR An agentic system built from scratch on the OpenAI Agents SDK that autonomously analyses datasets: it plans, calls tools, checks intermediate results and writes up insights. It's served by a FastAPI backend on an Azure VM, with Redis handling caching and session state so it stays responsive under concurrent use.

01 · The problemDashboards stop where the interesting questions start

Datavio's users work with a lot of data — sales, inventory and pricing across marketplaces. Dashboards cover the questions everyone asks every week. The valuable questions are the ad-hoc ones: why did this dip, what changed, where should we look next?

Each of those is a small analysis project: pick the right data, slice it, compare it, explain it. Doing that by hand for every question doesn't scale.

02 · The intuitionAnalysis is a loop, not a prompt

A good analyst doesn't answer in one shot. They plan, pull some data, look at it, decide what to check next, and only then explain.

Plan, query, look, decide — then explain.

A single LLM call can't do that reliably. An agent running that loop with real tools can — as long as three things hold: the tools are dependable, state carries across steps, and the system stays responsive while the agent works.

03 · The solutionAn agent with tools, state and a fast backend

  1. An agent that plans. Built on the OpenAI Agents SDK, the agent turns a question into a sequence of steps instead of answering in one shot.
  2. Tools over guesses. Each step runs against real datasets through tools, so conclusions come from the data rather than the model's imagination.
  3. Multi-step reasoning. Intermediate results feed the next decision — dig deeper, compare, or stop and explain.
  4. A backend built for concurrency. FastAPI on an Azure VM serves many sessions at once; Redis caches repeated work and keeps each session's state between turns.

04 · ImplementationThe pieces that matter

A lightweight agent framework

The OpenAI Agents SDK provides the essentials without a heavy framework: agents with instructions and tools, a runner that manages the loop, and built-in tracing — useful when someone asks how the agent reached a conclusion.

Redis for caching and sessions

Analysis questions repeat: the same slices of the same data come up again and again. Redis caches that work so repeat questions come back fast, and holds session state so a follow-up question builds on the previous answer instead of starting from scratch.

Designed for long-running requests

Agent runs take longer than typical API calls, so the backend is built for concurrency end to end — async request handling in FastAPI, and session state in Redis rather than in process memory.

05 · ResultsWhat it changed

Before

An ad-hoc question means someone picks the data, writes the queries and pieces together an answer.

After

The agent plans the analysis, runs it against the data and explains the result — with its steps visible.
  • Ad-hoc questions get a structured, step-by-step analysis instead of waiting in someone's queue.
  • Every answer comes with the steps behind it — plan, queries, comparisons — so it can be checked, not just trusted.
  • Redis caching and session management kept response times low and concurrent requests smooth.

06 · TakeawaysLessons for production agents

  • Give agents tools and state before you give them bigger prompts.
  • Show the work: an analysis you can audit is worth more than a confident paragraph.
  • Agents are long-running requests — design the backend for that from the start.

Putting agents in front of real data and real users? I'm happy to talk through it.