Skip to main content

Stop Your AI Agents Breaking on Bad Data - Data Quality Assessment Framework

Project description

ADRI – Agent Data Readiness Index

Protect AI workflows from bad data with one line of code.

ADRI is a small Python library that enforces data quality before data reaches an AI agent step. It turns data assumptions into executable data contracts, and applies them automatically at runtime.

No platform. No services. Runs locally in your project.

from adri import adri_protected

@adri_protected(contract="customer_data", data_param="data")
def process_customers(data):
    # Your agent logic here
    return results

What it is

ADRI provides:

  • A decorator to guard a function or agent step
  • A CLI for setup and inspection
  • A reusable library of contract templates

Install & set up

pip install adri
adri setup

What happens when you run it

First successful run

  • ADRI inspects the input data
  • Creates a data contract (stored as YAML)
  • Saves local artifacts for debugging/inspection

Subsequent runs

  • Incoming data is checked against the contract
  • ADRI calculates quality scores across 5 dimensions
  • Based on your settings, it either:
    • allows execution, or
    • blocks execution (raises)

How ADRI works (high level)

ADRI Flow Diagram

In plain English: ADRI sits between your code and its data, checking quality before letting data through. Good data passes, bad data gets blocked.


Use it in code

from adri import adri_protected
import pandas as pd

@adri_protected(contract="customer_data", data_param="customer_data")
def analyze_customers(customer_data):
    """Your AI agent logic."""
    print(f"Analyzing {len(customer_data)} customers")
    return {"status": "complete"}

# First run with good data
customers = pd.DataFrame({
    "id": [1, 2, 3],
    "email": ["user1@example.com", "user2@example.com", "user3@example.com"],
    "signup_date": ["2024-01-01", "2024-01-02", "2024-01-03"]
})

analyze_customers(customers)  # ✅ Runs, auto-generates contract

What happened:

  1. Function executed successfully
  2. ADRI analyzed the data structure
  3. Generated a YAML contract under your project
  4. Future runs validate against that contract

Future runs with bad data:

bad_customers = pd.DataFrame({
    "id": [1, 2, None],  # Missing ID
    "email": ["user1@example.com", "invalid-email", "user3@example.com"],  # Bad email
    # Missing signup_date column
})

analyze_customers(bad_customers)  # ❌ Raises exception with quality report

Quick links

Protection modes

# Raise mode (default) - blocks bad data by raising an exception
@adri_protected(contract="data", data_param="data", on_failure="raise")

# Warn mode - logs warning but continues execution
@adri_protected(contract="data", data_param="data", on_failure="warn")

# Continue mode - silently continues
@adri_protected(contract="data", data_param="data", on_failure="continue")

Contract templates (start fast)

ADRI includes reusable contract templates for common domains and AI workflows.

Business domains

AI frameworks

Generic templates

Contributing

Use cases

ADRI works with any data format. Sample data files are included for common scenarios:

API Data Validation

Protect your API integrations with structural validation.

Multi-Agent Workflows

Validate context passed between agents in CrewAI, AutoGen, etc.

RAG Pipelines

Ensure documents have correct structure before indexing.

License

Apache 2.0. See LICENSE.


Built with ❤️ by Thomas Russell at Verodat.

One line of code. Local enforcement. Reliable agents.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adri-7.4.0.tar.gz (863.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adri-7.4.0-py3-none-any.whl (310.2 kB view details)

Uploaded Python 3

File details

Details for the file adri-7.4.0.tar.gz.

File metadata

  • Download URL: adri-7.4.0.tar.gz
  • Upload date:
  • Size: 863.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adri-7.4.0.tar.gz
Algorithm Hash digest
SHA256 9f023d42426e88b7f1cbeea9b6e246cafc977eae77f64cb246b45786996785cc
MD5 3c96e2f0cae1f42bdfc6ef4cbf57f1b1
BLAKE2b-256 de74ce1ec454d14052cc3c5a22064fdaa8f505b87fdba101fe01884605c66c1a

See more details on using hashes here.

File details

Details for the file adri-7.4.0-py3-none-any.whl.

File metadata

  • Download URL: adri-7.4.0-py3-none-any.whl
  • Upload date:
  • Size: 310.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for adri-7.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a9d9a01fb804e82c016e024fb926602ec19b02d88ab691ca477c0bb2f5b00aff
MD5 e57276e4f4d9f1486761eeb6c82d414c
BLAKE2b-256 1839d5c66601d5cc60cc5de9ed7bd8511c8e58b83f23f17ccc28b860bdd94434

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page