Building AskMGM: A Civic AI Platform for Montgomery, Alabama
How we built AskMGM, a free civic AI platform that lets Montgomery residents query 45 city datasets in plain English. Architecture, datasets, and lessons from building AI for a city.

We built a free AI tool for our city because we thought Montgomery deserved one. Here's how we did it, what we learned, and what's next.
Montgomery has an open data portal. Most cities do. The problem is that nobody uses them.
The data is there. Construction permits, crime reports, business licenses, zoning maps, park locations, traffic signals. Thousands of records across dozens of datasets, all publicly available through the city's ArcGIS Hub. But to get anything useful out of it, you need to know what datasets exist, understand how they're structured, and write queries or click through map layers until you find what you're looking for.
We thought there had to be a better way. What if a Montgomery resident could just ask a question in plain English and get a real answer backed by real city data?
That's AskMGM.
What AskMGM Does
AskMGM (askmgm.com) is a free AI-powered tool that lets anyone in Montgomery explore the city's public data through conversation. You type a question like "what construction permits were filed near Cloverdale" or "how many parks are in District 4" and the AI translates that into a database query, runs it against real city data, and gives you an answer with sources.
It's not a chatbot that makes things up. Every answer is grounded in actual data from Montgomery's open data portal. If the data doesn't exist to answer your question, it tells you that instead of guessing.
The tool is completely free. No login required. No data collected. We built it because we believe civic data should be accessible to everyone, not just people who know how to navigate GIS portals.
The Architecture
The stack is straightforward, but getting each piece right took real iteration.
Data pipeline: We pulled 45 datasets from Montgomery's ArcGIS Hub open data portal and loaded them into a PostGIS database on Supabase. The data gets synced nightly so answers reflect the latest published information. Each dataset had its own quirks. Some had inconsistent column names. Some had geometry data that needed transformation. Some had columns that looked useful but were actually empty across every record. We cleaned all of it manually and documented the schemas.
AI layer: The core is a LangGraph agent that takes a natural language question, understands the intent, selects the right dataset(s), generates a SQL query, executes it against PostGIS, and formats the result into a human-readable answer. The LLM is Claude, which handles the reasoning and natural language generation. The key insight was treating RAG as a tool call rather than a retrieval pipeline. The agent decides when it needs to query the database and what to query for, rather than always retrieving context regardless of the question. We wrote about this approach in detail in our post on RAG as a tool.
Frontend: Next.js app deployed on Vercel. Clean interface, no clutter. You type a question, you get an answer. We intentionally kept it minimal because the audience is Montgomery residents, not developers.
Open datasets: We published all 45 cleaned datasets on HuggingFace under the mmintelligence organization. Researchers, students, and other builders can use them freely. We wanted the data work to be useful beyond just our platform.
What We Learned
Text-to-SQL is harder than it looks. The demos you see online usually work against clean, well-structured databases with obvious column names. Real municipal data isn't like that. Columns are named things like "FACTYPE" and "SUBTYPE2" and "GISACRES." The AI needs schema documentation and examples to generate accurate queries, and even then it sometimes needs multiple attempts. We built a feedback loop where we review every query through our analytics and improve the prompts when results are wrong.
Civic technology has a distribution problem. You can build the best tool in the world, but if the people it's meant to serve don't know it exists, it doesn't matter. Getting civic AI into the hands of residents requires more than launching a website. It requires partnerships with local government, schools, and community organizations. We're actively working on that because we believe Montgomery deserves tools that make public data genuinely accessible.
The people who find it actually use it. When residents discover AskMGM, they ask real questions. Practical things about their neighborhoods, permits, zoning, and city services. That tells us the need is real. People want to interact with their city's data. They just need a way to do it that doesn't require technical expertise.
Start with the data, not the AI. We spent more time cleaning and documenting datasets than we spent on any other part of the project. The AI is only as good as the data it can access. If we had skipped the data work and jumped straight to building the chat interface, the answers would have been useless.
What's Next
AskMGM is live and actively maintained. We're continuing to improve accuracy, add datasets as the city publishes new ones, and explore adding support for languages common in Montgomery beyond English.
The bigger vision is that every mid-size city in the South should have something like this. The playbook is replicable. Open data portals exist in Birmingham, Huntsville, Mobile, Jackson, Memphis. The architecture is the same. The data pipeline is the same. What changes is the datasets and the community context.
We built AskMGM because Montgomery is our home and we believe the people who live here should be able to access their own city's data without needing a GIS degree. If you're a city official, a researcher, or just someone curious about Montgomery's public data, try it at askmgm.com.
And if you're building civic AI for your own city, we'd love to hear about it.