Prerequisites
- A Snowflake connection with read access to the raw landed collections (the agent samples the
_AIRBYTE_DATAVARIANT column viarun_sql_query). - A MongoDB connection (optional but recommended: lets the agent verify the drift against the source collection, not just the landed copy).
- Slack connected if you trigger it through Bolt self-healing (the healing session threads into the configured channel).
- Familiarity with programmable agents and Bolt self-healing.
Steps
1
Create the agent
In the Agent app, open Agents, select New agent, and choose Start from scratch. Fill in the builder fields below, leave Model on Auto, then select Deploy and choose Open a pull request: self-healing selects agents from Goal:Backstory:Allowed tools (everything else is refused, see the Tools Reference):
.dinoai/agents/*.yml on the schedule’s git branch, so the definition must be merged there. See Build an agent in the UI for a tour of the builder.Name: mongo-dbt-healerRole:read_file,write_file,replace_in_file,search_files_and_directories,ripgrep_searchrun_sql_queryrun_terminal_commandlist_bolt_schedules,get_bolt_run_logslist_mongodb_collections,mongodb_collection_schema,mongodb_count,mongodb_aggregate,mongodb_find
The MongoDB tools are all read-only. They let the agent confirm the drift at the source (is the rename real in Mongo, or an ingestion artifact?) before patching the model. No Slack tool is needed when triggered by self-healing, because the healing session already threads into the configured channel.
2
Enable self-healing on the schedule
Point the Bolt schedule that runs your MongoDB staging models at this agent, from the UI or as YAML. See Set up self-healing for the walkthrough:
paradime_schedules.yml
3
Watch the first heal
The next time a MongoDB shape change breaks the schedule, open the failure thread in your self-healing channel. You’ll see the session parse the error, sample the raw VARIANT data (recent vs oldest rows), post the drift report, and link the fix PR.
On a drift failure, the agent opens one PR on a
heal/mongo-drift/<collection>-<yyyymmdd> branch containing the COALESCE-patched staging model, updated YAML, and a drift report quoting the original error, per-column change types, v1/v2 document counts, and before/after JSON samples. Both old and new documents produce non-null rows after the patch. Review the drift report, merge, and retry the Bolt run.How it works
Schema drift in a document store rarely arrives as a clean cutover: for days or weeks the landed table contains a mix of v1 and v2 documents. That is why the agent’s core rule is additive patching: every changed field becomes aCOALESCE(old_path, new_path) so the model works across the transition, and downstream column names never change even when the underlying path did. The count split in the drift report (how many rows match each shape) tells the reviewer when it will be safe to remove the v1 fallback later.
Next steps
Bolt pipeline healer
The general-purpose healer for failed dbt™ runs.
MongoDB schema drift triager
The Jira-driven variant: planned drift changes as tickets.
Set up self-healing
Enable self-healing on a Bolt schedule.
MongoDB tools reference
The read-only MongoDB tools this agent uses.