SuperAPIAI Directory

scherlok

github.com · AI coding

Read-only data quality monitoring for Postgres, BigQuery, Snowflake, MySQL and DuckDB: warehouse profiling, anomaly detection and optional dbt lineage.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Scherlok is a zero-configuration data quality monitoring tool for data teams, positioned as "the detective for data." It adopts a "learn first, detect later" approach, automatically learning the normal patterns of database tables and issuing alerts when anomalous changes occur. The entire process requires no writing of YAML files, rules, or thresholds.

I. Purpose and Core Philosophy Scherlok is designed to solve common pain points for data teams: sudden changes in source API units (such as from dollars to cents), columns starting to return NULL, tables stopping updates, row counts suddenly dropping 40% on a given day, and other issues, while existing tools (such as Great Expectations, Soda, dbt tests) all require users to predefine "correct" standards, require hundreds of rules and dozens of YAML files, and cannot discover problems that have not yet been imagined. Scherlok takes the opposite approach: learn normal patterns first, then detect anomalies.

II. Main Capabilities

  1. Automatic anomaly detection: Each anomaly is automatically scored and classified as INFO, WARNING, or CRITICAL, with no need to configure thresholds.
  2. Multi-data source support: Can be used with PostgreSQL, BigQuery, Snowflake, MySQL, DuckDB, and dbt. Supported adapters include postgres, bigquery, snowflake, mysql, duckdb; other adapters require explicitly passing --connection-string.
  3. Data profiling: Scherlok profiles each table, including row counts, column types, NULL rates, value distributions, freshness cadence, cardinality, etc., and stores everything locally in SQLite.
  4. Anomaly alerts: Alerts can be sent to Slack, Discord, Teams, email, or reflected through CI exit codes. Automatically detects Slack, Discord, and Teams from URLs and formats payloads; other URLs receive a generic JSON payload.
  5. Learning mechanism: After five valid profiles, Scherlok uses the latest 30 profile results to learn the variability of each metric from historical baselines for volume, numeric mean shifts, NULL rates, and distinct counts. During cold start or when history is unavailable, it maintains conservative fixed defaults.
  6. CI/CD integration: Scherlok can be used as a data quality gate. The ci command completes all three steps in one line; if critical anomalies are detected, the pipeline will fail,Prevent bad data from entering production.
  7. dbt integration: Scherlok complements dbt test with automated anomaly detection. It reads target/manifest.json, discovers each materialized model (table, incremental, view), automatically resolves connections from profiles.yml, and profiles each model. It can serve as a CI gate after dbt run, or a wrapper can combine the two steps. The wrapper runs dbt run by default and uses the successful model nodes recorded in target/run_results.json; use --build to run dbt build. Both dbt and dbt-run-and-watch accept --output json for CI parsers.
  8. dbt package: Can be installed as a dbt package for native data quality tests without the Python CLI. Includes Tier 1 instant tests (not_null_proportion, row_count_between, recency, unique_proportion) and Tier 2 auto-learning tests (volume_anomaly, null_anomaly, which require scherlok_metrics models to build baseline history).
  9. HTML dashboard: A self-contained HTML file (about 28 KB) containing KPIs, incidents grouped by table (with first-seen timestamps), + / − / ~ schema drift diffs, sparklines, and full anomaly history. Automatically switches between dark/light themes via prefers-color-scheme.
  10. MCP integration: Can be used from AI agents (such as Claude Code / Claude Desktop) to run data quality checks. Tools available to agents include list_tables, investigate, watch, status, history, and check. Credentials are resolved server-side, all operations are read-only against the warehouse, and there is no arbitrary SQL tool.
  11. AI-explained alerts (--explain): When an anomaly triggers, Scherlok makes one Claude call for the entire batch and injects root-cause hypotheses into the same alert. Works for watch, ci, check, dbt, and dbt-run-and-watch. In dbt projects, hypotheses are lineage-aware. It uses Claude Haiku 4.5 by default, costing well under one cent per run (about $0.003), and the model can be overridden via SCHERLOK_EXPLAIN_MODEL. Runs with zero anomalies make no API calls. Only aggregate information is sent (anomaly type/severity/message string, dbt model name, detection timestamp), never warehouse rows, cell values, or credentials. This feature is optional and can be disabled by not passing --explain; if the API call fails, the original alert is sent as-is with a one-line note, and alerts are never blocked by the LLM.

III. How to Use Three commands, five minutes to complete:

  • investigate: learning mode. Profiles every table and stores the data in local SQLite.
  • watch: detects anomalies.
  • ci <url>: runs all three steps in one line, for pipelines.

Alert targets are auto-detected. dbt integration steps: first run dbt run, then run Scherlok as a CI gate; the dbt-run-and-watch wrapper can also combine them. After installing the dbt package, native tests can be used. MCP usage: Claude Desktop downloads scherlok-<version>.mcpb and opens it, or configure other clients as documented. Docker image: published to GitHub Container Registry on each release tag, includes all warehouse add-ons (dbt, bigquery, snowflake), is built on python:3.12-slim, and runs as the non-privileged user scherlok.

IV. Use Cases

  • Quality gates in data pipelines to prevent bad data from entering production.
  • Teams using dbt that need automated anomaly detection to complement dbt test.
  • Scenarios that need to share profiling results across CI runs and team members.
  • Running data quality checks directly through AI agents.

V. Limitations and Notes

  • Requires Python 3.10+.
  • Some features (such as the dbt package) will change installation to package: rbmuller/scherlok, version [">=1.0.0", "<2.0.0"], once listed on the dbt Package Hub.
  • Supported database adapters are limited, others require an explicit connection string.
  • The AI explanation feature requires an API key, defaulting to Claude Haiku 4.5.
  • All operations are read-only on the repository.
  • The license is MIT, developed by Robson Bayer Müller.

Project address:https://github.com/rbmuller/scherlok

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools