> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.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-4o"),
    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

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai sqlalchemy
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```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"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `agent_as_judge_binary.py`, then run:

    ```bash theme={null}
    python agent_as_judge_binary.py
    ```
  </Step>
</Steps>

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