← Selected Cases

Air Quality AgentAI Agent

Toulouse Air Intelligence

My roleSole builder. I chose the open dataset, built the agent, the voice loop and the dashboard, and kept every answer traceable to the pandas code the agent runs on the data.

01

Problem

Atmo Occitanie publishes Toulouse's air-quality measurements as open data: 51,143 daily readings from 10 stations and six pollutants since August 2022. The numbers are public, but a question as simple as which station had the most NO2 last year still means opening a spreadsheet or writing pandas code, so the data mostly answers people who can program.

02

Solution

A personal project in Python. A dashboard with filters and five charts sits next to an AI analyst. You ask it in English or French, by typing or by voice, and a LangChain agent answers by writing and running pandas code on the data currently on screen, then reads the answer aloud. The API key stays on the server, and the public demo is behind a password.

#FeatureWhat it does
01Ask in plain languageQuestions go in as everyday sentences. The agent decides which calculation answers them, writes it in pandas and runs it, so every number comes from the data rather than from the model's memory.
02Answers from what is on screenPollutant, station, monitoring context and date filters shape the charts and the agent's data at once, so a question always refers to the view in front of you.
03Talk to itThe microphone records in the browser, Whisper transcribes the question and the agent answers it like a typed one.
04Spoken repliesEach answer is also read aloud with Kokoro, in English or in French, following the language picked in the navbar.
05Five chartsWeekly concentrations, monthly levels by monitoring context, a station by pollutant heatmap, distributions, and a station ranking for one pollutant at a time.
06Keys stay on the serverThe project key never reaches the browser. Visitors bring their own fal.ai key for their session, or unlock the demo with a password.
03

Stack

LayerTechnologyRole
ToolingCursorAI-assisted development
LanguagePythonApp, agent and voice loop
AI agentLangChainPandas dataframe agent with tool calling
ModelGPT-4o miniThe agent's model, through fal.ai's OpenRouter
DatapandasThe analysis the agent writes and runs
04

Architecture

People

  • VisitorDemo unlocked
    • filterstoDashboard

In the browser

  • DashboardFilters and five chartsNiceGUI · Plotly
    • filterstoData on screen
  • Analyst chatTyped or spokenMediaRecorder
    • questiontoPandas agent
    • audiotoVoice

Python server

  • Data on screen_apply_filters
  • Pandas agentanswer_question
    • tool callstoGPT-4o mini
  • Voicetranscribe_audiosynthesize_speech
    • speechtoWhisper · Kokoro

Data and models

  • MongoDB51,143 readings · Chat history
    • readingstoData on screen
  • GPT-4o minifal.ai OpenRouter
  • Whisper · Kokorofal.ai
Architecture
05

Results

  • 51,143Air-quality readings to ask about
  • 2Ways to ask: typed or spoken
  • 2Languages, English and French

HighlightThe agent computes every answer from the data on screen by running pandas code, so its numbers can be checked against the dataset.

LET'S WORKTOGETHER

Get in touch

Tell me about the role and the team, and I'll get back to you.

Submitting means you agree to the Terms & Conditions.