Zing Forum

Reading

TranspoBot: A Large Language Model-Driven Intelligent Query System for Urban Traffic Data

This article introduces the TranspoBot project, an urban traffic management system based on FastAPI and Groq LLM that supports automatic SQL generation from natural language queries, helping transport company managers gain operational data insights without writing code.

大语言模型Text-to-SQLFastAPI城市交通GroqLLM应用自然语言查询MySQL
Published 2026-06-05 01:34Recent activity 2026-06-05 01:51Estimated read 6 min
TranspoBot: A Large Language Model-Driven Intelligent Query System for Urban Traffic Data
1

Section 01

Introduction / Main Post: TranspoBot: A Large Language Model-Driven Intelligent Query System for Urban Traffic Data

This article introduces the TranspoBot project, an urban traffic management system based on FastAPI and Groq LLM that supports automatic SQL generation from natural language queries, helping transport company managers gain operational data insights without writing code.

2

Section 02

Original Author and Source

  • Original Author/Maintainer: Sudo-Riaking (Team Saida, Coumba, Mariama, Natou)
  • Source Platform: GitHub
  • Original Project Title: TranspoBot
  • Original Link: https://github.com/Sudo-Riaking/TranspoBot
  • Publication Time: June 2026
  • Affiliated Institution: ESP/UCAD (École Supérieure Polytechnique, Université Cheikh Anta Diop de Dakar, Senegal)

3

Section 03

Project Overview and Core Innovations

TranspoBot is an intelligent data query system for urban transport companies. Its core innovation lies in combining large language models (LLM) with traditional database queries, enabling non-technical managers to obtain complex operational data analysis results through natural language conversations.

Traditional business data analysis usually requires professional SQL skills or reliance on IT department support, a process that is inefficient and hard to meet real-time decision-making needs. TranspoBot breaks this barrier—managers only need to ask questions in everyday language, and the system automatically generates optimized SQL queries and returns structured answers.

The project draws inspiration from local urban transport services in Senegal (such as Dakar Dem Dikk, Ndiaga Ndiaye, etc.), and has strong practical application background and localization features.


4

Section 04

System Architecture and Technology Stack

TranspoBot adopts a clear layered architecture, decoupling the user interface, business logic, and data storage, while introducing LLM services to handle natural language understanding tasks:

5

Section 05

Frontend Layer

Built using native HTML5, CSS3, and JavaScript, without relying on heavyweight frontend frameworks, ensuring a lightweight and fast user experience. Communicates with the backend via the Fetch API to achieve refresh-free data interaction.

6

Section 06

Backend Layer (FastAPI)

The core service is built based on the Python FastAPI framework, a modern, high-performance web framework designed specifically for building APIs:

  • High Performance: Based on Starlette and Pydantic, supports asynchronous processing
  • Automatic Documentation: Automatically generates OpenAPI/Swagger documentation
  • Type Safety: Uses Python type hints for data validation
  • Dependency Injection: Elegantly handles cross-cutting concerns such as database connections and authentication
7

Section 07

Database Layer (MySQL)

The system uses MySQL 8.0+ to store operational data, with a complete relational data model covering the following core entities:

  • Vehicles (Véhicules): Buses, minibuses, taxis, etc., recording status, mileage, and maintenance information
  • Drivers (Chauffeurs): Driver profiles, driver's licenses, availability, and assignment records
  • Trips (Trajets): Real-time trip records, including status, number of passengers, and revenue
  • Incidents (Incidents): Tracking of abnormal events such as breakdowns, accidents, and delays
  • Routes (Lignes): Bus route definitions and scheduling
  • Pricing (Tarification): Pricing strategies for different customer types (regular, student, elderly)
8

Section 08

LLM Layer (Groq API)

The system calls the Groq API to use the llama-3.3-70b model for natural language to SQL conversion. Groq is known for its extremely high inference speed, capable of returning results in milliseconds to meet real-time query needs.