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.3.0.tar.gz (862.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.3.0-py3-none-any.whl (310.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adri-7.3.0.tar.gz
  • Upload date:
  • Size: 862.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.3.0.tar.gz
Algorithm Hash digest
SHA256 dc9dd2f8fba3e49b0d96e8bbbe19a4cbefcd70fc08412cea6e92f5181dcea891
MD5 74164299b9c51cc28913b0fe46149774
BLAKE2b-256 564d8ea9476238df4cd9974469f98a3434ff23e53b389190059d38b7d246b4f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: adri-7.3.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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c60d021c8521208012b14d62f3a73368b82015ff176a464155df79211a4bf49a
MD5 9b8f2e29d9512fc70a16c37d9ae74ac8
BLAKE2b-256 6302e2e2e8c8ff228fcecc35867de1d7bb04ca5315def0074b003d3f8e1fc06d

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