Zoner Vector Store Pipeline

This repository can prepare the beta ordinance content for the ZonerSDK OpenAI vector store. The pipeline reads the ordinance Markdown in _pages/, creates smaller section-level chunk files, checks that each chunk has citation metadata, and uploads the chunks to the configured OpenAI vector store.

The City of Lebanon’s official zoning ordinance PDF remains the controlling legal source. This repository and the vector store are presentation and search aids only.

What The Pipeline Does

  • Reads ordinance source pages from _pages/.
  • Includes article pages, Appendix A, Appendix B, Appendix C, and the amendments page.
  • Skips support pages such as how-to-update.md and the appendix index page.
  • Creates one Markdown file per section, subsection, or Appendix A definition in generated/vector-chunks/.
  • Uploads those generated chunk files to the OpenAI vector store named by ZONER_VECTOR_STORE_ID.
  • Tags uploaded vector store files as managed by this GitHub Action so later replace runs remove only this pipeline’s files.

The generator preserves ordinance wording. It does not summarize, rewrite, renumber, or change the legal effect of the ordinance.

Required GitHub Settings

Add these repository secrets:

  • OPENAI_API_KEY
  • ZONER_VECTOR_STORE_ID

Add these repository variables:

  • ZONER_PUBLIC_BASE_URL, normally https://3dmcd.github.io/ZoningOrdinance
  • ZONER_DOCUMENT_ID, normally lebanon-zoning-ordinance
  • ZONER_JURISDICTION, normally Lebanon, NH

Do not commit API keys, vector store IDs, MCP URLs, local tokens, or generated upload manifests.

Running The Workflow

The workflow is manual only:

  1. Open the repository’s Actions tab on GitHub.
  2. Choose Update Zoner Vector Store.
  3. Run the workflow manually.

The workflow builds the Jekyll site first, then runs:

node scripts/vector/generate-vector-chunks.mjs
node scripts/vector/validate-vector-chunks.mjs
node scripts/vector/upload-vector-store.mjs --replace

Replace mode removes only vector store files with this pipeline’s managed attributes:

  • managed_by=zoner-github-action
  • source_repo=3DMcD/ZoningOrdinance
  • document_id matching the configured document ID
  • jurisdiction matching the configured jurisdiction

It does not remove unrelated vector store files.

Local Checks

Maintainers can generate and validate chunks locally without uploading:

bundle exec jekyll build
node scripts/vector/generate-vector-chunks.mjs
node scripts/vector/validate-vector-chunks.mjs

Generated chunk files and generated/vector-upload-manifest.json are ignored by git. The upload manifest can contain OpenAI file IDs and should stay local to the workflow or workstation that created it.

MCP

This pipeline does not connect to MCP or GIS lookup services. It only prepares and uploads ordinance source chunks for the configured OpenAI vector store.