> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Binary Agent-as-Judge Evaluation

> Judge a customer-service agent reply as pass or fail against a professional-tone criterion using AgentAsJudgeEval backed by SqliteDb.

Demonstrates pass/fail response quality evaluation.

```python agent_as_judge_binary.py theme={null}
"""
Binary Agent-as-Judge Evaluation
================================

Demonstrates pass/fail response quality evaluation.
"""

from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.eval.agent_as_judge import AgentAsJudgeEval
from agno.models.openai import OpenAIChat

# ---------------------------------------------------------------------------
# Create Database
# ---------------------------------------------------------------------------
db = SqliteDb(db_file="tmp/agent_as_judge_binary.db")

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
    model=OpenAIChat(id="gpt-5.6-luna"),
    instructions="You are a customer service agent. Respond professionally.",
    db=db,
)

# ---------------------------------------------------------------------------
# Create Evaluation
# ---------------------------------------------------------------------------
evaluation = AgentAsJudgeEval(
    name="Professional Tone Check",
    criteria="Response must maintain professional tone without informal language or slang",
    db=db,
)

# ---------------------------------------------------------------------------
# Run Evaluation
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    response = agent.run("I need help with my account")
    result = evaluation.run(
        input="I need help with my account",
        output=str(response.content),
        print_results=True,
        print_summary=True,
    )
    print(f"Result: {'PASSED' if result.results[0].passed else 'FAILED'}")
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai sqlalchemy
```

**2. Export your OpenAI API key**

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
```

```bash Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
```

**3. Run the example**

Save the code above as `agent_as_judge_binary.py`, then run:

```bash theme={null}
python agent_as_judge_binary.py
```

Full source: [cookbook/09\_evals/agent\_as\_judge/agent\_as\_judge\_binary.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/09_evals/agent_as_judge/agent_as_judge_binary.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.