Skip to content

melbamorph/zoner

 
 

Repository files navigation

Zoning Ordinance Navigator

Disclaimer: This is an experimental personal project. It is not an official tool of the City of Lebanon, NH, nor is it endorsed by any city agency. The assistant’s responses may contain errors or omissions. Always refer to the actual zoning ordinance or city officials for authoritative information.

Project Purpose and Background

Intended to be an experimental chat-based AI assistant designed to answer questions about the City of Lebanon’s zoning ordinance in plain English. The goal is to help residents, developers, or anyone interested to get quick, easy-to-understand answers about zoning rules (e.g. “Can I build an accessory dwelling in a residential zone?”). This project was inspired by the complexity of zoning regulations and the idea of leveraging AI to make them more accessible.

What This Is:  An experimental project to learn how to use OpenAI Agent Builder by building a web-based chatbot that knows about Lebanon’s zoning codes and can assist with common questions. It’s built for learning and demonstration purposes using OpenAI’s ChatKit framework.

This is NOT an official city service. 

This project is a personal experiment exploring how AI can serve civic tech. The answers it gives are not legally binding or guaranteed correct. It is meant to be a helpful guide rather than a final authority.

Setup and Installation

To set up this project, follow the installation instructions from the OpenAI ChatKit Starter Template and the official OpenAI documentation for Agents and ChatKit. Once you’ve completed the starter setup, update your .env.local file with your OpenAI API key and workflow ID as follows:

  • OPENAI_API_KEY – Your OpenAI API key (enables access to AI services)
  • NEXT_PUBLIC_CHATKIT_WORKFLOW_ID – The ID of your custom Agent Builder workflow configured with Lebanon zoning information

Then run the development server:

npm run dev

The app will launch at http://localhost:3000. You can type zoning questions into the chat interface to test functionality.

Usage Tips

Asking Questions: Try to ask clear, specific questions about zoning rules or definitions. The assistant can handle questions like “What uses are allowed in the Industrial zone?” or “How tall can a fence be in a residential area?”

The agent will determine if your question is zoning related and then ask clarifying questions if needed before searching the zoning ordinance and returning a response.

Please note: This is a work in progress so you should expect to see malformed answers, inconsistencies, and unexpected behavior. 

Understanding Answers: The AI will answer in everyday language and may reference sections of the ordinance. These answers are generated by a model and may occasionally be inaccurate or imprecise. Always double-check with the official ordinance if the question is important.

Resetting or Refreshing: If the conversation goes off track or you want to start over, refresh the page or start a new chat. The assistant doesn’t retain memory between sessions, so each reload starts fresh.

Attribution and Credits

This project was bootstrapped with the OpenAI ChatKit Starter Template. The ChatKit framework provides the chat UI and connects to an AI agent built with OpenAI’s Agent Builder. All original template code and assets are used under the MIT License (see the LICENSE file). 

The original template can be found on GitHub at openai/openai-chatkit-starter-app.

Zoning Data: The assistant’s knowledge is based on publicly available zoning ordinance documents from the City of Lebanon, NH. No confidential or proprietary information was used. You can view the official zoning ordinance on the City of Lebanon website

Limitations and Future Plans

Known Limitations:

  • Formatting Issues: Occasionally, the assistant may produce malformed outputs such as partial JSON code or other unexpected formatting artifacts, especially when explaining structured data.

  • Accuracy: The assistant may occasionally give outdated or misunderstood information. Verify important answers with official sources.

  • Scope: It’s limited to Lebanon’s zoning code. Questions outside this scope may get generic or incorrect responses.

  • Technical Quirks: Since it’s built on a new OpenAI platform (ChatKit + Agent workflows), expect occasional bugs or glitches.

  • Not Official: This is a personal demo, not an official city service.

Future Improvements:

  • Enhanced Data Updates: Automate ordinance updates as changes occur and explore integration of GIS data layers (e.g., zoning maps and parcel information) to provide spatial context within answers.
  • Guided Next Steps: Offer clear, non-legal recommendations after an answer, such as where to apply for a zoning permit, how to request a Zoning Board of Adjustment variance or special exception, and who to contact in Planning and Development. When possible, include checklists, required documents, and links to forms.
  • Better Error Handling: Improve responses for unclear or unsupported questions.
  • User Interface Tweaks: Add branding and a short introduction that reminds users the tool is unofficial, while refining the overall design for better usability and visual appeal.  
  • Improved Citation Handling: Add more complete citations that link to specific ordinance sections and GIS map layers for greater transparency and usability.

License

This project includes code from the OpenAI ChatKit Starter Template and retains its original MIT License. You may use, modify, and distribute this project in accordance with that license. See the LICENSE file for details.

Disclaimer

The Zoning Ordinance Navigator is shared in the spirit of learning, collaboration, and civic innovation. As an experimental project, it may change, go offline, or break from time to time.

This is an experimental personal project. It is not an official tool of the City of Lebanon, NH, nor is it endorsed by any city agency. The assistant’s responses may contain errors or omissions. Always refer to the actual zoning ordinance or city officials for authoritative information.

About

Experimental zoning assistant built with OpenAI ChatKit and Agent Builder.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.0%
  • CSS 2.1%
  • JavaScript 1.9%