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.2.9.tar.gz (850.8 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.2.9-py3-none-any.whl (305.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for adri-7.2.9.tar.gz
Algorithm Hash digest
SHA256 aec8034ae2fc116588badea76f73d69e24f358b8f8f46d8025f0ba547a82d4f5
MD5 a62cad552ae7a85db22c09458232ba7b
BLAKE2b-256 2566fbc170c2adc8a2a88420c95e817f9a7a25ff16d76e860c2c58db2987efac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: adri-7.2.9-py3-none-any.whl
  • Upload date:
  • Size: 305.9 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.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 bf8b3af00bd274e7260e2ac267c4880a81421b0c84611f2a03faebdafe9d0d37
MD5 5fb43914e1b23f8aaa4dc786764b5cbb
BLAKE2b-256 c02432de91a15498d34560591ed19eaddc1aa7247dd72293e4d9278838915370

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