Skip to main content

The AgentProctor module is a testing and evaluation library designed for AI agents, enabling the testing of various behaviors and properties that cannot be effectively evaluated using standard regression or unit tests. This library provides a structured approach to evaluate AI responses against defined criteria, ensuring that agents behave as expected in diverse scenarios.

Project description

AgentProctor

Version License: MIT Python Build

Description

The AgentProctor module is a testing and evaluation library designed for AI agents, enabling the testing of various behaviors and properties that cannot be effectively evaluated using standard regression or unit tests. This library provides a structured approach to evaluate AI responses against defined criteria, ensuring that agents behave as expected in diverse scenarios.

Why AgentProctor?

Traditional testing breaks down when applied to LLM-based systems.

AgentProctor provides a structured way to:

  • Evaluate non-deterministic outputs
  • Define reusable evaluation criteria
  • Measure response quality with explainability
  • Build confidence in AI systems before production

Documentation

Features

  • LLM-native evaluation: Designed specifically for testing AI-generated outputs
  • Schema Validation: Utilizes Pydantic for robust validation of input data structures.
  • Custom Evaluators: Supports the creation of custom evaluators to assess agent responses based on specific criteria.
  • Detailed Reporting: Generates structured output that includes evaluation results, reasons for success or failure, and confidence levels.
  • Extensible Architecture: Easily extendable to accommodate new evaluation criteria or agent behaviors.

Tech Stack

  • Python: Version 3.10 or higher.
  • LiteLLM: For lightweight language model interactions.
  • Pydantic: For data validation and settings management.
  • UV: For dependencies management.
  • pytest: For testing framework.
  • Ruff: For linting and formatting.

Installation

To install the AgentProctor library, you can use pip. Make sure you have Python 3.10 or higher installed.

pip install agentproctor

This command installs the library along with its development dependencies.

Usage

To use the AgentProctor library, first import the necessary classes from the package. Below is a simple example of how to create an evaluation request and evaluate it using a custom evaluator.

Fixed-type evaluator

from agentproctor.schemas import EvaluationRequest
from agentproctor.base_evaluator import BaseEvaluator

# Create an evaluation request
request = EvaluationRequest(
    response="Your agent's response here",
    model="gpt-4o-mini",
    additional_context="Optional context to help the evaluator"
)

# Create a custom evaluator
class MyEvaluator(BaseEvaluator):
    @property
    def criteria(self):
        return "Your evaluation criteria here."

# Evaluate the request
evaluator = MyEvaluator()
result = evaluator.evaluate(request)

print(result)

>>> EvaluationResult(
...     passed=False,
...     reason="A rejection reason.",
...     confidence=0.75,
>>> )

Dynamic type evaluator

from agentproctor.schemas import EvaluationRequest
from agentproctor.base_evaluator import BaseEvaluator

# Create a custom evaluator
class EntityReferenceEvaluator(BaseEvaluator):
    @property
    def criteria(self):
        """
        Defines the evaluation criteria dynamically using parameters provided at initialization.

        The BaseEvaluator accepts arbitrary keyword arguments (`kwargs`) that can be used
        to customize evaluation logic at runtime. This enables reusable evaluators that
        adapt to different inputs without redefining new classes.

        For example, this evaluator checks whether a specific entity is referenced in
        the response by accessing `self.kwargs["entity"]`.
        """
        return f"The user is referencing {self.kwargs["entity"]}"

# Create an evaluation request
request = EvaluationRequest(
    response="I'm speaking about Lionel Messi.",
    model="gpt-4o-mini",
)

# Evaluate the request
evaluator = EntityReferenceEvaluator(entity="Lionel Messi")
result = evaluator.evaluate(request)

print(result)

>>> EvaluationResult(
...     passed=True,
...     reason="The user is clearly speaking about Lionel Messi",
...     confidence=1.0,
>>> )

File Structure Overview

.
├── docs
│   ├── LICENSE.md
│   ├── QUICKSTART.md
│   └── README.md
├── notebooks
│   └── use_examples.ipynb
├── src
│   └── agentproctor
│       ├── __init__.py
│       ├── base_evaluator.py
│       ├── schemas.py
│       └── evaluators
│           ├── __init__.py
│           ├── entity_reference.py
│           └── language.py
├── tests
│   ├── conftest.py
│   ├── test_base_evaluator.py
│   ├── TEST_CATALOG.md
│   ├── test_entity_evaluator.py
│   ├── test_evaluation_request.py
│   └── test_language_evaluator.py
├── .gitignore.toml
├── .pre-commit-config.toml
├── pyproject.toml
└── uv.lock
  • docs: Contains the library documentation.
  • notebooks: Notebooks with worked examples about how to use this module.
  • src/agentproctor/: Contains the main library code.
  • tests/: Contains unit tests for the library components.
  • pyproject.toml: Project metadata and dependencies.

Design Philosophy

AgentProctor is built around a few core principles:

  • Evaluation > Assertion: AI systems require qualitative validation, not just equality checks
  • Explainability matters: Every evaluation should provide reasoning, not just a result.
  • Composable abstractions: Evaluators should be reusable and easy to extend.
  • Developer experience first: Minimal boilerplate, maximum clarity.

Contributing Guidelines

We welcome contributions to improve the AgentProctor library! Here’s how you can help:

  1. Fork the repository: Click the "Fork" button on the top right of the repository page.
  2. Create a new branch: Use a descriptive name for your branch.
    git checkout -b feature/your-feature-name
    
  3. Make your changes: Implement your feature or fix.
  4. Write tests: Ensure that your changes are covered by tests.
  5. Commit your changes: Write clear and concise commit messages.
    git commit -m "Add feature: your feature description"
    
  6. Push to your branch:
    git push origin feature/your-feature-name
    
  7. Create a pull request: Go to the original repository and create a pull request.

❤️ Support the Project

If you find AgentProctor useful, consider supporting its development.

Your support helps:

  • Maintain and improve the library
  • Add new evaluators and features
  • Keep the project actively maintained

👉 Sponsor here: https://github.com/sponsors/diego-mourino

👋 About Me

Hi, I'm Diego — an AI Engineer focused on building reliable systems around LLMs and AI agents.

This project is part of my effort to:

  • Explore better ways to evaluate AI systems
  • Share practical tools with the community
  • Demonstrate production-grade engineering practices

📬 Contact

💼 LinkedIn: https://www.linkedin.com/in/diego-mourino/?locale=en-US

📧 Email: diego.mourino.rs@gmail.com

If you're interested in collaboration, consulting, or have feedback, feel free to reach out.

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

agentproctor-1.0.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

agentproctor-1.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file agentproctor-1.0.1.tar.gz.

File metadata

  • Download URL: agentproctor-1.0.1.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentproctor-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b4f74fa3822ce6b2aceaf4ccf426457ddd865268dfae3fa995d47916f79fe4d0
MD5 42101d8a4e89e94f28da468c89697ba3
BLAKE2b-256 da7bdd1d19f8cb98f6be0e90a87804377f73f89176fee8e7327d172d7c56690a

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentproctor-1.0.1.tar.gz:

Publisher: cd.yml on diego-mourino/agentproctor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentproctor-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: agentproctor-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentproctor-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 93da6a33f245a7dbb1308a9901409d349b8b9d01904b31cf4e41100e6fbe2008
MD5 af0de860574a0c4240bb9a98c3fc7f1d
BLAKE2b-256 1d018d2e7c20674eb89446566dfd65641513e0e5b031812094ae81ef37d7fbcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentproctor-1.0.1-py3-none-any.whl:

Publisher: cd.yml on diego-mourino/agentproctor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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