How Publishing and the Chatbot’s Index Stay in Sync
Last updated: November 20, 2026
What it is
When we publish or edit an article, two things have to happen before the chatbot can answer from the new text. The page has to go live on the website. The text also has to be turned into entries in the chatbot’s search index. These are separate steps, run by separate jobs, and the second one is not instant.
This article describes the jobs that keep the two in step and the checks that watch them. None of these jobs writes or edits articles. They move, index and check what editors have already published.
When it runs
| Job | When it runs |
|---|---|
| Indexing of new and edited text | Repeatedly, in small batches. Our operations notes put it at roughly every five minutes, about ten entries per run. |
| Knowledge-base integrity check | Daily |
| Index leak check | Daily |
Post-publish read-back (make verify-live) |
On demand, after a publish. It is not scheduled. |
| Derived-data rebuild (entity and community graphs) | Weekly |
The indexing cadence comes from our operations notes. We did not re-measure it for this article.
What it does
- Publishing enqueues. It does not index. When
scripts/ca_publish.pypushes a document to the site, the site’s AI plugin notices the save. It adds a new entry markedpending, or marks an existing entrystaleif the text changed. It does not turn the text into searchable form at that moment. - A scheduled task drains the queue. A task inside the website’s scheduling system picks up outdated entries and turns them into search entries, a few at a time. The website’s own scheduler is replaced by a regular timer on the server, so that timer is what keeps the drain running.
- A daily integrity check looks for drift. It runs a set of drift tests, the same ones behind
make check-drift. They catch counts that disagree between documents, references that point to nothing, skills that are missing from the index and wording that has drifted out of date. The same daily run adds two live-site facts: how many index entries are fresh, stale or pending, and whether the website’s scheduler is alive. - A daily leak check protects the index. Removing or unpublishing a page does not automatically remove its entry from the chatbot’s index. The leak check counts entries whose source page is no longer published. The chatbot would keep answering from those. The expected count is zero. Its purpose is to make sure nothing retired, private or internal stays searchable after it leaves the site.
- An alert goes to a person when a check fails. The daily run raises an alert for a person to investigate only when something fails, and stays quiet when everything is clean. It is alert-only: it changes nothing. If the check itself cannot run, that is reported as a failure and is not treated as “all clear”.
- After a publish,
make verify-livereads the page back. It fetches the live page and compares it with what we sent. The Compose console offers the same check as a “Debug mode” box beside Publish. It only reads. It never blocks a publish, because it runs after the fact. See Post-Publish Verification and Corrections. - A weekly rebuild refreshes the derived data.
scripts/ca_derive.py --weeklyrebuilds only the derived stores that are out of date: the entity graph, the community graph and its summaries, graph metrics and the relationship files built on them. Some steps use an AI model, and a spending cap stops the run if the estimate goes over it. It commits changed outputs locally but does not push them itself, and it does not send the graphs to the live service. Sending them is a separate step an editor runs (make deploy-graphs).
Why an edit can take minutes to reach the chatbot
An edit goes live on the website at once, but the chatbot searches the index, and the index only catches up when the drain runs. Three things set the delay:
- The drain is periodic. It wakes about every five minutes, so a single edit typically waits a few minutes.
- The drain is small. If it handles about ten entries a run, a batch of 120 edited documents takes about an hour. That figure is simple arithmetic from the two numbers above.
- While an entry is
stale, the old text is still being served. The index still holds the pre-edit version until the drain replaces it. A corrected claim can therefore keep appearing in a chat answer for a short time after the page is fixed. Editors can force a specific document through by hand with the sync script.
There is a second path. The Rights Advisor service in The Rights Advisor AI keeps its own copy of the knowledge base and its own index. That copy updates when an editor deploys the backend, not when the drain runs, so it can lag by more than a few minutes.
A failure we learned from
From July 20 to August 23, 2026, a misconfigured timer silently stopped every scheduled event on the website, including the indexing drain. Over those 33 days about 61 percent of the chatbot’s index went stale, so it answered from text editors had already corrected. Nothing alerted us, because our dashboards checked only whether documents were ready to index, not whether the index was current. The daily live-site check exists because of that incident.
Skills and models it uses
None of these jobs uses a language model for its checks. The weekly derived-data rebuild is the exception: some of its steps call Claude, within its spending cap. See AI and Research Runtime Guardrails.
Rules and gates it obeys
- Published-only. What reaches the chatbot’s index is what has gone through the gates in Publish-Time Gates and was published. Password-protected posts are excluded from indexing.
- Zero is the target for leaks. Any count above zero is a defect to investigate.
- No silent success. A check that cannot run, or whose data is truncated, is reported as unknown or failed, never as clean.
- Alert-only. The monitoring jobs report. They do not repair, delete or republish anything.
What it may never do
- Publish or unpublish an article.
- Delete an entry from the index. Removing entries is a deliberate, separate step done by a person.
- Push graphs or content to the live service on its own (the weekly rebuild stops at a local commit).
- Report a clean result when it could not measure.
Where a human decides
- Whether and when to publish. Editors do, and they run
make verify-liveafterward. - What to do about an alert. A person investigates every failed check.
- When to force a re-index. An editor can push a document through immediately instead of waiting for the drain.
- When to deploy. Deploying the backend, the skill index and the derived graphs to the live service are all deliberate steps.
For what readers can expect from the chat itself, see The Rights Advisor AI and How Citizen Analyst Uses AI.
Factual correction requests: If you believe information in this page is incorrect, please contact factcheck@citizenanalyst.ai with your name (optional), the specific claim, and any supporting documentation. We review all submissions and correct verified errors promptly.
