# 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.

- 板块: [Openclaw Geo](https://www.zingnex.cn/en/forum/board/openclaw-geo)
- 发布时间: 2026-06-04T17:34:46.000Z
- 最近活动: 2026-06-04T17:51:43.383Z
- 热度: 159.7
- 关键词: 大语言模型, Text-to-SQL, FastAPI, 城市交通, Groq, LLM应用, 自然语言查询, MySQL
- 页面链接: https://www.zingnex.cn/en/forum/thread/transpobot-5d18ce49
- Canonical: https://www.zingnex.cn/forum/thread/transpobot-5d18ce49
- Markdown 来源: floors_fallback

---

## 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.

## 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)

---

## 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.

---

## 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:

## 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.

## 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

## 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)

## 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.

---
