The problem
Engineers, architects and contractors who work across many cities spend their best hours flipping through 500 page PDFs to find the rule that applies to one site, and the rules change. A wrong reading becomes a rejected submission or a liability, so people ask the one senior colleague who knows, and that colleague becomes the bottleneck.
Architecture
- Channel
- Engineer asks in plain language
- Agent
- Copilot Studio code agent
- Answers with citations
- Escalates when unsure
- Tools
- Excel manifest of documents
- Weekly Power Automate flow
- SharePoint and Dataverse
- Human
- Expert verifies before use
Where the data stays: The code documents are public and sit in your SharePoint and Dataverse; questions stay inside your Microsoft tenant.
Design flow
- Weekly flow collects the manifest documents
- Uploader files them into a Dataverse table per city
- An engineer asks; the agent answers with citations
- Not covered or unsure: escalate to a subject matter expertOnly sometimes
- The engineer verifies the cited section before relying on itHuman checkpoint
Setup
Total time: 15 h our estimate
- 3 h
Done when: An Excel sheet lists every code document for your first five cities with its title, city, version date and the URL it comes from, signed off by the person who knows each city.
- 4 h
Done when: A Power Automate cloud flow on a weekly schedule reads the manifest, downloads each document and stores it in a SharePoint library with one folder per city, and the first run has every file in place.
- 3 h
Done when: A second flow writes each document into a Dataverse table with a city column, the table is added to the agent as knowledge, and a question about one city returns an answer citing only that city's documents.
- 1 h
Done when: The prompt above is the agent's instruction, a question with no city gets asked back, and a question the documents do not cover offers escalation to the named expert.
- 4 h
Done when: Fifty questions from last month's projects have been answered, a senior engineer has opened every citation, and the misses are fixed and republished before the team is invited.
Ticks are saved on this browser.
Starter prompt
Written from how the use case works and its sources. Replace the parts in square brackets.
You answer questions about building, zoning and development codes for [your firm], using only the code documents in your knowledge for the city the user names. For every answer: name the city, quote the relevant section with its number and the document title, and give the page or link so the engineer can open it. If the question names no city, ask which one before answering. If the documents for that city do not cover the question, or two documents conflict, say so plainly and offer to escalate to [name or role of the subject matter expert] instead of guessing. Never combine rules from different cities in one answer. End every answer with one line: what the engineer should verify in the cited document before relying on it.
Risks and data
Data
The code documents are public, but your questions reveal which sites and clients you work on: keep the agent inside your own tenant or workspace, and do not paste client drawings or contracts into it.
How it goes wrong
It goes wrong when a city updates a code and the manifest still points to the old file, when an answer mixes two cities, or when an engineer trusts a confident answer without opening the citation. You notice when a submission is rejected. Keep the manifest owned by a named person, separate knowledge by city, and make opening the cited section part of the firm's QA.
How the agent works
It starts
A manifest in Excel, built with the firm's subject matter experts, lists every code document the agent needs, its metadata and where it comes from.
The agent works
A Power Automate cloud flow runs weekly, uses the manifest to collect the documents from static and dynamic sources and stores them in SharePoint; a second flow organises them into a Dataverse table that Copilot Studio uses natively as knowledge, kept separate by city so answers from one jurisdiction do not bleed into another. An engineer types a question in plain language and gets an answer with direct citations to the source document. When the agent is not sure or the question goes beyond the documents, it offers escalation to a subject matter expert, and the firm's own QA and QC review stays in place.
The result
In the source, time spent asking questions against city codes fell by 90% or more across more than 50 Texas cities.
Worked example
Dunaway, a Texas design, planning and engineering firm founded in 1956 with 375 employees in eight offices, serving more than 100 Texas cities (Microsoft customer story dated 11 December 2025), spent over 10,000 hours a year searching and interpreting city, county and state codes, with manuals of 500 pages or more. With partner MicroAge, which ran a two month Power Platform and Copilot Studio crash course for the team, graduate engineer Logan Welsh built an Excel manifest from subject matter expert input listing each required document, its metadata and its source. A Power Automate cloud flow runs weekly, scrapes the documents from static and dynamic sources and stores them in SharePoint; a knowledge uploader organises them into a Dataverse table that Copilot Studio uses natively, separated by city to prevent knowledge bleeding. The City Code Analyst agent gives answers with direct citations to the source documents and offers escalation to the experts for review; beta testers' feedback was fixed and republished within the hour. The firm reports manual research time cut by 90% and time spent asking questions against city codes down by 90% or more. VP of Technology Brian Bowden: "Our most valuable people were spending their time flipping through PDFs." A second agent, DAVE, combines HR, IT and accounting questions, forms and support requests in one place. Next, Dunaway plans tools that check drawings against city codes for QA and QC.
The source relies on Copilot Studio reading a Dataverse table natively as knowledge and on Power Automate for the weekly collection, so the Microsoft stack is the one with the fewest moving parts. A Claude Project per city with the code documents as knowledge answers with references too, and a Make scenario can re-download the documents on a schedule, but you lose the single agent across all cities and the built in escalation, and you re-upload the knowledge yourself.
Join the Agent OS Club
Get hours back with a team of AI agents for every department, set up step by step for the tools you use, with a person answering your questions. Founding member price: USD 14.95 a month or USD 150 a year, locked for as long as you stay. Cancel any time.
Founding offer, ends 31 December 2026 or at member 100
Join the Agent OS ClubBuilding this for an organization? Learn more at theagentiv.com
Sources
Published: 2026-11-15