Inspiration

Data teams can trace what a query does, but they often cannot recover why a strange filter exists. The same SQL predicate may encode a deliberate business rule, an expired workaround, or documentation drift. Lineage shows the blast radius; it does not preserve the human decision behind the code.

RationaleOps was built to close that gap. It treats rationale as operational data: evidence-linked, owner-confirmed, testable, and retrievable where data teams already work.

What it does

RationaleOps is a DataHub-grounded decision-intelligence agent. It:

  1. Reads dataset, ownership, glossary, usage, and lineage context from DataHub.
  2. Mines stable decision points from production SQL using deterministic parsing.
  3. Ranks findings by knowledge risk and downstream impact.
  4. Runs an adaptive Cognitive Task Analysis interview with the responsible owner.
  5. Converts confirmed intent into a typed Decision Contract with boundaries, authority, lifecycle, and evidence.
  6. Generates an executable SQL acceptance test, a documentation update, or a safe repair proposal.
  7. Requires explicit human approval before any action and verifies the final DataHub write-back.

The demo follows one investigation across 47 downstream assets. Three similar filters resolve into three different truths: a confirmed settlement rule, an expired Germany workaround, and documentation drift around status exclusions.

How we built it

The backend is built with Python, FastAPI, Pydantic, SQLGlot, DuckDB, and SQLite. SQLGlot extracts normalized predicates and stable fingerprints. DataHub's official MCP and Agent Context Kit ground the investigation in real metadata, while the DataHub SDK supports verified write-back.

The dashboard is built with React, TypeScript, and Vite. It provides a three-pane view of impact context, ranked decision points, and the owner interview/action workflow. A recorded mode keeps judging reproducible; a local live-agent mode supports an OpenAI-compatible LLM provider when credentials are available.

Deterministic checks form the correctness boundary. The LLM may ask questions and propose structured rationale, but it cannot authorize intent, approve an action, or bypass validation.

Challenges we ran into

The hardest design problem was keeping evidence separate from rationale. Graph facts can identify owners and impact, but only an authorized human can confirm intent. We solved this with typed truth states, evidence references, explicit confirmation gates, and an append-only audit trail.

A second challenge was making the demo both realistic and reproducible. The same workflow now runs from deterministic fixtures on GitHub Pages and from the full local stack with live integrations. We also had to keep a dense three-pane dashboard readable without overlap or hidden content across common viewport sizes.

Accomplishments that we're proud of

  • A complete mining-to-write-back loop instead of a chatbot-only prototype.
  • Adaptive boundary questions that uncover exceptions the first owner answer misses.
  • Deterministic SQL tests and regression checks before approval.
  • A reusable open rationale-audit DataHub skill and Decision Contract format.
  • A public interactive dashboard, open-source repository, and under-three-minute end-to-end demo.

What we learned

Lineage is necessary but not sufficient: impact does not explain intent. Cognitive Task Analysis is especially effective for data systems because boundary and counterfactual questions expose the conditions hidden behind terse SQL. We also learned that trustworthy agents need a narrow role: propose and organize, while humans authorize and deterministic systems verify.

What's next for RationaleOps

Next we would connect owner routing to production notification systems, add policy-aware approval chains, open automated pull requests for approved repairs, expand evaluation sets across more SQL dialects, and make Decision Contracts portable across DataHub deployments.

Try it

Built With

Share this project:

Updates