AI agentsTransport
Citibike analytics agent
Ask where the bikes need to go tomorrow morning, in plain English
68%higher demand in November than in July
See the code on GitHub (opens in a new tab)
Proof you can check:Code on GitHub
AI agents

7 everyday questions need no AI at all
“Which stations need bikes tomorrow morning?”
Lubo Bali · lubobali.com
The problem
In NYC's bike sharing system, every morning some stations run empty and others overflow. The redistribution team needs to know which stations need bikes, how many and of which type, without writing SQL.
What I built
An agent over a star schema of the rides: common questions go to 7 tested SQL templates (no AI, instant), new questions go to an AI that writes the query, and every answer can come with a chart.
Tech & why
Templates for the questions asked every day: faster, cheaper and never wrong. The AI only for the rest, with a local model option for private data.
- Python
- FastAPI
- PostgreSQL
- AdalFlow
- Next.js
The result
Answers like "top 10 stations that need bikes, classic vs electric" in plain English, and the finding that November has about 68% higher demand than July.
How this agent is built
Every AI agent has the same five parts. Here is what each one is in Citibike analytics agent, so you can judge any agent the same way.
- ModelGPT-4o, or a local Llama model through Ollama for private data.
- HarnessA router: a question that matches a tested template skips the AI; anything else goes to the AI.
- Guardrails7 pre-tested SQL templates for everyday questions, so the most-asked answers can't be made up.
- KnowledgeNYC Citibike rides for July and November in a star schema, plus past successful questions.
- ToolsPostgreSQL queries and Plotly charts.
Similar projects
- AI agentsSentinel-AIAn AI agent that sorts your inbox, and can never send or delete a thing4 safety layers before the AI touches an email
- AI agentsLubo AI PublisherAn AI content pipeline that writes in my voice from real sources, and waits for my one tap9 posts a week, live since June 2026
- AI agentsmergeAIUpload spreadsheets, ask a question in plain English, get a checked answer~8 s from question to a checked answer
Have a problem like this? Get your free AI blueprint in about a minute.
