Skip to main content

AgentProctor

Version License: MIT Python Build 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.

Since AgentProctor uses LiteLLM to handle the LLM API calls, you must set your prefered LLM API key as an environment variable.

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.

Release files for agentproctor 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agentproctor 1.0.2
File Size Uploaded
agentproctor-1.0.2.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentproctor 1.0.2
File Interpreter ABI Platform
agentproctor-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.7 kB

Release files / agentproctor-1.0.2.tar.gz

Download URL agentproctor-1.0.2.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bbe7aa447271b064614f3bfdb0e4cb75d41f67b3d4e2b699ca025f3d48619419
BLAKE2b-256 checksum
How to use checksums
b4af859e7966ee6a1dab694106640dc5d97e03e8228930a22a3c574b129ef0c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log

Release files / agentproctor-1.0.2-py3-none-any.whl

Download URL agentproctor-1.0.2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ecc67e3375e9a83f1f83d0859b5627a64e2632855348eeed5707139d62ad776
BLAKE2b-256 checksum
How to use checksums
30580d82607179fc9cad46e75334f33ce675aa2f6f5d9e7151a8d341149ba50a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page