The pathUnit 4 · Deploy and governLesson 12 of 12

Keeping agents reliable

You keep an analytics agent reliable by treating it as something you maintain, not something you ship once. Data changes. Schemas change. Metric definitions change. An agent that was correct last quarter can be wrong this quarter if its context did not keep up. Reliability is ongoing work, not a launch milestone.

The good news is the work is mostly mechanical. You watch the answers, you update the context when the data moves, and you re-run your tests to catch what broke.

What causes drift

Drift is when the agent’s answers slowly stop matching reality. A few things cause it.

  • Schema changes. A column is renamed or a table is split, and the agent’s old query no longer fits.
  • Metric changes. Finance redefines revenue, but the semantic layer still holds the old version.
  • Stale docs. A rule changed and the documentation did not, so the agent answers from old logic.
  • New data. A new product line shows up in the tables with no context to explain it.

None of these are SQL bugs. They are context falling out of date.

How to stay ahead of it

The fix for each cause is the same loop, run on a cadence.

  • Re-sync the schema. When tables change, run the sync again so the agent sees the new structure.
  • Update the context. When a metric or rule changes, edit the definition once, in the place the team controls.
  • Re-run the tests. Your test suite tells you what broke. Failing tests are drift you caught early.

Monitoring in production

Tests catch known problems. Monitoring catches the rest. Watch the questions users ask and the answers they get. When a user flags a number, treat it like a bug. Trace it to the query, find the missing or stale context, fix it, and add a test so it cannot come back.

This is the same discipline as the rest of the path. The model does not drift. The context does. Keep the context current and the agent stays reliable. That maintenance loop is what makes an agent something a team relies on for years, not weeks.