Project
From PDF to Public Service: Building a Zoning Agent for Local Government
Zoner is an end-to-end framework for making a zoning ordinance easier to search, understand, cite, and maintain. It combines an AI chatbot, zoning district lookup, an accessible ordinance portal, and a future automation path that keeps the chatbot aligned with the official ordinance source.
The Problem
A zoning ordinance contains the local rules people need when they want to build something, modify something, or understand what is allowed on their property. The hard part is that those rules often live in a long legal PDF that is technically available but practically difficult to use.
Residents rarely arrive on the scene with perfectly formed planning language inquiries. They ask normal questions like: Can I add an addition to my house? Can I have chickens? Can I build a garage? Can I open a small business here? Can I put up a sign?
In our city, the zoning ordinance is a 200-page PDF that is difficult to understand especially if you're not fluent in legalese. It's a barrier to public engagement and a challenge to staff who have to answer the same questions repeatedly. This project is about paving the path between those everyday questions and the adopted ordinance sections that support a careful answer.
Building the Zoning Chatbot
This project started with an idea I had to build a user-friendly chatbot that was carefully scoped to interpret the zoning ordinance. I had already been playing the concept inside ChatGPT using customGPTs but I quickly learned that we need something more structured and scoped than simply uploading a massive PDF with a single set of instructions. I was inspired when OpenAI released their Agent Builder and I began following their tutorials to create an agentic workflow attached to a vector store.
The first version excited me as it began returning more accurate responses, but it also exposed a major blocker. Accurate, useful zoning answers usually depend on knowing the zoning district of your property. For example, whether you can have chickens in your backyard entirely depends on where your backyard is located. However, most people don't know their zoning district, and without this important piece of information, the chatbot can't reliably respond. This is the first barrier to success since most people don't know What most people do know this information. What they do know is their street address.
So, I started there, trying to solve the problem by using something people know (address) to find something they don't know (zoning district). In the past, the only option we had was to tell people to go look it up in our GIS system, or call us so we could do it for you, but with Model Context Protocols (MCPs), I learned that the chatbot could handle that task for the user.
So I read documentation on how to build an MCP and wired it into the existing workflow. I call this piece Zoner-MCP. Its only task is to take whatever address the user provides and do the lookup for them by normalizing the address, to retrieve the zoning district from our GIS system, and hand it back to the agent to perform a smarter ordinance search.
Here's how it works:
- A user asks a zoning question in plain language.
- The agent checks whether the request is safe and zoning related.
- If the zoning district is missing, the agent asks for either the district or the street address.
- When an address is provided, the MCP connector sends it to the GIS lookup and retrieves the zoning district.
- The agent uses the district to improve the ordinance search and retrieve relevant sections.
- The response summarizes the answer in clearer language, cites source sections, and flags issues that may require staff review.
If you want to try it, you can ask a question like, "Can I have chickens in my backyard?" and use an address like 18 South Main Street.
Zoning Ordinance Portal
The next blocker for me was how the chatbot returned its sources. A chatbot that answers zoning questions must be able to show where the answer came from and even though it could cite where it found its answers, it didn't have a viable way to link to that source. So, even though we had a response, we still had the same problem as before where the user was expected to navigate a 200+ page innaccessible document to find the details. A user should be able to click from the chatbot response to the article, section, or table that supports the answer. But asking our staff to change the way they work to build an accessible experience is exactly the reason this process has not improved in the 15 years I've been asking for it.
The project stalled for awhile so I could think about how to move forward. Of course, there are plenty of ways to solve this but they require resources we haven't been able to commit. Then Codex and ChatGPT workplace agents came along and I realized that while we didn't have the human resources to dedicate to this problem, we now had an agent workforce we could tap into. All it required was scoping them and managing them to do the needed tasks. This is sort of like bringing in a crew of very capable interns, which is still work but once you have them rolling, can be exceptionally helpful.
I already had ideas about using Github pages to host an accessible ordinance. I just had to bring in tighly scoped agents to do the work, which is what I did using OpenAI Codex. And once I released the agents, I watched them literally rebuild our entire ordinance without changing the language but drastically improving the accessibility. It was, quite frankly, amazing to watch. And, an interesting side benefit is that it identified errors in our ordinance that no one seems to know are there. Nothing earth shattering but numbering issues and references that don't exist.
As of May 2026, the ordinance portal is still lives in my personal Github repository and remains a work in progress but it was good enough to get approval to migrate it to our city for further development which means I can now continue to work on it as a real project instead of a weekend endevour.
The goal is to preserve the adopted legal language, rebuild the structure into accessible HTML, and create stable links that both humans and the chatbot can use. GitHub Pages is a good fit because it can publish directly from a repository, keep the public site low-cost, and give each section a stable web link that the chatbot can eventually cite.
Connecting It All Together
The ultimate task here is ensuring the public ordinance portal and the chatbot get tied to the same maintained source. We want to avoid a split brain where staff update the ordinance portal but the chatbot continues to respond from the old version in the vector store.
The workflow I am building toward is simple:
- Staff update the ordinance in the GitHub repository.
- GitHub Pages publishes the accessible ordinance portal.
- An automation detects the change and refreshes the chatbot source material.
- The chatbot answers with source links back to the public ordinance portal.
From Prototype to Production
This started as an experiment with tools and platforms I could access quickly. The prototype showed that the framework can work: the chatbot can search the ordinance, the MCP can connect an address to a zoning district, the ordinance can become a more accessible web resource, and GitHub can support a versioned publishing model.
The next phase is moving from prototype to beta production and testing on the city's platform, with governance, security, accessibility review, staff testing, public-facing disclaimers, maintenance planning, and a clear process for questions that require human judgment.
How to Get Started
I'm often asked how I come up with ideas like this or how to get started. A practical starting point is to pick a public-facing problem with low data sensitivity and high public value. Local government has an endless supply of these types of problems. If you want to identify them, stand in your city hall service areas for a day. Here's a framework to get your started:
- Choose one public document that people struggle to use.
- Identify the most common questions people ask about it.
- Map the path a person has to travel before they can understand an answer.
- Create an OpenAI developer account and upload the document for file search.
- Use Agent Builder to create a simple question-and-answer workflow.
- Add guardrails so the agent knows what it should not answer.
- Test with real staff questions and identify what context is missing.
- Add a tool or MCP connector only when there is a clear reason.
- Build a better public source layer so answers can link back to official material.
- Plan for maintenance so the chatbot does not quietly drift away from the source.
If a step feels hard to understand, ask your AI tool of choice to explain it in language that makes sense to you. I use ChatGPT as my partner and coach. Map it out, chat it out, experiment, and try again. Make curiosity and a growth mindset a required part of your toolkit.
Project Toolkit
The following are a few of the tools and reference pages that helped me get from idea to prototype: building the chatbot, connecting it to outside data, publishing the ordinance, and understanding the pieces well enough to keep going.
OpenAI Tools
This is where I started so I could create a project, use Agent Builder, manage file search, and connect the pieces.
OpenAI Agent BuilderThis is where I mapped the chatbot flow: when to answer, when to ask for more context, when to call tools, and when to point people back to staff.
OpenAI file searchThis helped me think about turning one giant PDF into a searchable knowledge layer the chatbot could use in smaller, more relevant pieces.
ChatKitThis is the public-facing chat layer that can connect the chatbot experience to the workflow behind it.
MCP and ConnectorsThis is how I started connecting the chatbot to outside information instead of expecting it to answer from the ordinance alone.
OpenAI CodexThis helped me work through the coding and structure needed to rebuild the ordinance as an accessible web project.
Other Tools
This is the GIS query pattern behind the address-to-zoning-district lookup.
Replit PublishingThis gave me a fast way to stand up the prototype while I was still figuring out whether the idea worked.
GitHub PagesThis gave me a low-cost way to publish the ordinance as a public website with stable links.
Closing Thought
This started as a PDF problem, but it is really about how local governments make public information usable. This is the kind of work responsible agentic AI can move forward: an agent workflow, a searchable ordinance, a GIS lookup, an accessible web portal, version control, and an automation path to keep everything current.
Lastly, no one asked me to solve this problem. If you are waiting for someone to come to you with a perfectly formed ask and solution, you will be waiting a long time. We are living in an AI moment where we have to demostrate a little bravery and give something up to get something better. For me that was my off hours time and some personal resources. For you, it might be something else. If you need an invitation to begin the work, this is it.