$ python sentinel.py
[Agent] 9 DataHub tools loaded.
→ search({"query": "*"}) ← 7 datasets
→ list_schema_fields(raw_patients) ← 15 cols
→ run_sql("COUNT(*) WHERE age < 0") ← 832
→ get_lineage(raw_patients) ← 3 downstream
→ add_tags(severity-CRITICAL) ← auto
BATCH APPROVAL — 2 operation(s)
1. [correct] raw_patients (832 rows)
2. [quarantine] raw_patients (555 rows)
Approve? all
✓ 832 corrected. CDC: 832 before-images. Undo: --undo 1
✓ 555 quarantined.
✓ Report opened. 6 findings, 2 remediated.
Discover
Finds datasets you didn't point it at.
No hardcoded tables. The agent searches your DataHub catalog, reads schemas, and decides what to check — autonomously.
$ python sentinel.py
[Agent] 9 DataHub tools loaded.
→ search({"query": "*"})
Found 7 datasets
→ list_schema_fields(raw_patients)
15 columns discovered
→ run_sql("SELECT COUNT(*) WHERE age > 120 OR age < 0")
832 rows flagged
Reason
Not row counts. Patient harm.
The agent explains why age=-88 means a fatal drug dose — not just "832 rows out of range." Every finding is ranked CRITICAL, HIGH, MEDIUM, or LOW by clinical impact.
832
Impossible Ages
Ages like -88 cause fatal drug dosing errors
555
Missing Names
Patients unidentifiable in emergency triage
277
Date Violations
Discharged before admitted
1,215
Billing Errors
Negative amounts corrupt revenue reporting
Trace
Bad data doesn't stay in one table.
The agent follows DataHub lineage to find every downstream table contaminated by upstream issues. Tags propagate to all affected datasets.
→ get_lineage(raw_patients)
raw_patients
├── patient_encounters
├── billing_summary
└── readmission_mart
3 downstream tables contaminated
Tagging all with severity-CRITICAL
Govern
Reads alone. Writes with permission.
Metadata writes (tags, descriptions) are auto-approved. Data fixes require human approval via batch prompt. Built for healthcare governance.
BATCH APPROVAL — 4 operation(s)
1. [correct] raw_patients (832 rows)
Nullify impossible ages
2. [quarantine] raw_patients (555 rows)
Quarantine missing names
3. [correct] raw_patients (277 rows)
Fix swapped dates
4. [correct] raw_patients (1,215 rows)
Nullify negative billing
Approve which? [all / 1,3 / none] all
→ 4 APPROVED, 0 DENIED
Remediate
Finds issues. Then fixes them.
The agent proposes data fixes — correct, quarantine, flag, standardize, deduplicate, enrich. Row-level CDC captures before-images for full reversibility.
→ apply_fix(correct, raw_patients)
UPDATE raw_patients SET age=NULL WHERE age<0
Will correct 832 rows — Approve? [y/N] y
OK: 832 rows corrected. CDC: 832 before-images
Undo: python sentinel.py --undo 1
→ apply_fix(quarantine, raw_patients)
Move 555 missing-name rows to quarantine
Approve? [y/N] y
OK: 555 rows quarantined. CDC: 555 before-images
Reversibility
Every change undoable.
Full database snapshot before every run. Row-level CDC before-images before every fix. Audit trail of who approved what, and why.
$ python sentinel.py --history
ID Type Table Rows Status
—— ———— ————— ———— ——————
1 correct raw_patients 832 ACTIVE
2 quarantine raw_patients 555 ACTIVE
$ python sentinel.py --undo 1
UNDONE: 832 rows restored from snapshot.
Watch
Drop a file. Agent handles the rest.
Background mode watches a folder for new or changed CSVs. Classifies each change and runs the right pipeline mode automatically.
SCHEMA
Flag breaking change + full triage
APPEND
Incremental checks on new rows
UPDATE
Re-run + diff: 3 new, 2 resolved, 5 recurring
Pipeline
9 phases. Full triage lifecycle.
From recalling past learnings to saving new ones — the agent runs the full triage lifecycle using DataHub's own tools.
0RecallRead past learningssearch_documents
1DiscoverFind datasetssearch
2UnderstandRead schemaslist_schema_fields
3InvestigateRun SQL checksrun_sql
4TraceFollow lineageget_lineage
5AssessRank severityLLM
6RecordWrite to DataHubadd_tags
7RemediateFix data with HITLapply_fix
8LearnSave for next runsave_document
Stack
1,900+ lines. 83 tests. Multi-model.
Agent Context Kit for discovery and writeback. LangGraph for the ReAct loop and human-in-the-loop. Pick one LLM backend — only one API key needed.
DataHub Agent Context Kit (9 tools)
LangGraph (ReAct + HITL + checkpoints)
Gemini Flash via Vertex AI (recommended) — or AI Studio (free) / Claude Haiku
SQLite (data + CDC audit trail)
83 tests (test_sentinel.py)
Try it in 60 seconds.
Clone the repo. Point it at DataHub. Get a clinical triage report.