Refund timing changed to 5–7 business days
AI agents · GitHub APIs · Documentation automation
The product changed. The help docs should know.
KB DocBot analyses merged product pull requests, checks the customer help documentation and prepares an update when the product and the docs no longer agree.
It does the repetitive investigation and drafting work. A person still owns what gets published.
Connected repositories: product, help documentation and orchestration app
Coherent documentation PR created from multiple product changes
AI-generated changes published without a person reviewing them
The problem
Documentation drift usually starts quietly.
A product changes, the code ships and the help content continues describing yesterday’s behaviour.
The information needed to catch that gap is scattered. Engineers understand the code change. Writers understand the documentation. Support teams know where customers are getting confused. Connecting all three is often a manual process.
I wanted to explore whether an AI agent could make that connection without giving it unchecked control over customer-facing content.
The workflow
From merged code to a reviewable documentation change.
Each product PR is analysed separately, but the final output is one coherent documentation update.
Fetch
Retrieve merged, unprocessed product pull requests from GitHub.
Titles · bodies · changed files · patchesInspect
Process each PR separately so the agent can reason about one product change at a time.
Oldest merge firstCompare
Read the current Markdown documentation and locate content describing the changed behaviour.
Product behaviour ↔ help contentDecide
Return either a no-change decision or a structured proposal supported by evidence.
Typed agent outputCombine
Carry earlier documentation updates forward while later product behaviour takes precedence.
Working documentation snapshotReview
Create the branch, commit and documentation pull request for a person to inspect.
No automatic publishingThe interesting engineering problem
What happens when several PRs change the same thing?
My first approach generated a complete documentation file for every product PR and tried to combine the results afterwards.
That was unreliable. Two proposed files could look conflicting even when the underlying product changes were unrelated.
The solution was to process the PRs in chronological merge order and maintain a working copy of the help documentation.
- Different behaviour changed? Preserve both updates.
- Same behaviour changed again? The latest merged PR wins.
- Unrelated content on the same page? Leave it intact.
Refunds change from immediate to 3–5 days.
Payouts change from once daily to twice daily.
Refunds change again, this time to 5–7 days.
Human-in-the-loop by design
The agent can draft. It cannot quietly decide what customers are told.
Every change is reviewable
DocBot creates a normal GitHub pull request containing the proposed edits, the evidence behind them and links to the source product PRs.
A reviewer can inspect the diff, edit the wording, approve it, request changes or reject it.
Good robot / Bad robot
Each documentation PR asks the reviewer to react to the description:
Written comments and human edits provide richer evidence than a rating alone.
Deliberately lightweight
GitHub is the prototype’s memory and audit trail.
Labels mark successfully processed product PRs so future runs do not repeat the work.
The generated PR already stores the proposal, evidence, reviewer reactions, comments, human edits and final outcome.
That gives the prototype meaningful persistence without adding a database before it actually needs one.
Thinking beyond the prototype
GitHub should remain the evidence. It should not remain the entire production data layer.
At company scale, I would keep GitHub as the source of truth and add webhooks plus a structured database for efficient retrieval, analytics and organisation-specific learning.
Reactions, comments, edits and PR outcome
Send structured activity to the application
Searchable decisions, outcomes and examples
Human-reviewed improvements for future runs
I would not allow the agent to rewrite its own instructions automatically. An evaluation agent could propose guidance changes, but a person would review them before they affected future decisions.
Technology
More than a prompt attached to GitHub.
The project required application architecture, authentication, API integration, structured agent outputs, repository state and failure handling.
What this project demonstrates
The kind of work I enjoy sits between systems and people.
Building DocBot meant thinking about code, APIs and agents, but also about customer impact, trust, auditability and where human judgement belongs.
It brings together the parts of technical work I enjoy most: investigating how a system behaves, designing a practical workflow and turning complicated changes into information people can actually use.
Explore the repositoryNext project