# metauto-ai/agent-as-a-judge architecture

> Architecture diagram of the GitHub repository metauto-ai/agent-as-a-judge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/metauto-ai/agent-as-a-judge
- Repository: https://github.com/metauto-ai/agent-as-a-judge

## Overview

Agent-as-a-Judge evaluates workspace requirements by gathering code and trajectory evidence, then asking an LLM to judge satisfaction and record confidence and usage statistics. The repository also supports workspace Q&A, planning, statistics, and OpenWiki. The agent excerpt and SOURCE INDEX establish its main module dependencies; README statements establish the user-facing capabilities. Some subsidiary calls and the OpenWiki runtime internals are not shown, so uncertain links are omitted.

Main entry points: [`agent_as_a_judge/agent.py`](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/agent.py) (Evaluation agent), [`agent_as_a_judge/llm/provider.py`](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/llm/provider.py) (LLM provider), [`agent_as_a_judge/module/ask.py`](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/ask.py) (Ask and judge), [`agent_as_a_judge/module/planning.py`](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/planning.py) (Requirement planning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Evaluation orchestration"]
  node_agent["Evaluation agent<br/>[agent.py]"]
  node_config["Agent configuration<br/>[config.py]"]
  node_ask["Ask and judge<br/>[ask.py]"]
  node_planning["Requirement planning<br/>[planning.py]"]
end

subgraph group_evidence["Workspace evidence"]
  node_graph["Workspace graph<br/>[graph.py]"]
  node_code_search["Code search<br/>[code_search.py]"]
  node_read["Workspace reader<br/>[read.py]"]
  node_locate["Code locator<br/>[locate.py]"]
  node_text_retrieve["Trajectory retrieval<br/>[text_retrieve.py]"]
  node_memory["Evidence memory<br/>[memory.py]"]
end

subgraph group_language["LLM and prompts"]
  node_prompts["Prompt templates"]
  node_llm["LLM provider<br/>[provider.py]"]
  node_cost["Cost tracking<br/>[cost.py]"]
end

subgraph group_insights["Analysis and extensions"]
  node_statistics["Evaluation statistics<br/>[statistics.py]"]
  node_openwiki["OpenWiki<br/>[run_wiki.py]"]
end

node_user(("User"))

node_user -->|"submits requirements"| node_agent
node_agent -->|"uses settings"| node_config
node_agent -->|"constructs graph"| node_graph
node_agent -->|"searches code"| node_code_search
node_agent -->|"reads workspace"| node_read
node_agent -->|"locates code"| node_locate
node_agent -->|"retrieves trajectory"| node_text_retrieve
node_agent -->|"uses memory"| node_memory
node_agent -->|"plans criteria"| node_planning
node_agent -->|"checks evidence"| node_ask
node_ask -->|"formats requests"| node_prompts
node_ask -->|"requests inference"| node_llm
node_planning -->|"formats plans"| node_prompts
node_planning -->|"requests inference"| node_llm
node_locate -->|"requests inference"| node_llm
node_text_retrieve -->|"summarizes evidence"| node_llm
node_llm -->|"tracks usage cost"| node_cost
node_statistics -->|"analyzes graph"| node_graph
node_user -->|"requests repository wiki"| node_openwiki

click node_agent "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/agent.py"
click node_config "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/config.py"
click node_ask "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/ask.py"
click node_graph "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/graph.py"
click node_code_search "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/code_search.py"
click node_read "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/read.py"
click node_locate "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/locate.py"
click node_text_retrieve "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/text_retrieve.py"
click node_memory "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/memory.py"
click node_planning "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/planning.py"
click node_prompts "https://github.com/metauto-ai/agent-as-a-judge/tree/main/agent_as_a_judge/module/prompt"
click node_llm "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/llm/provider.py"
click node_cost "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/llm/cost.py"
click node_statistics "https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/statistics.py"
click node_openwiki "https://github.com/metauto-ai/agent-as-a-judge/blob/main/scripts/run_wiki.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent,node_config,node_ask,node_planning,node_user toneBlue
class node_graph,node_code_search,node_read,node_locate,node_text_retrieve,node_memory toneAmber
class node_prompts,node_llm,node_cost toneMint
class node_statistics,node_openwiki toneRose
```

## Components

### Evaluation orchestration

- [Evaluation agent](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/agent.py): `agent_as_a_judge/agent.py`
- [Agent configuration](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/config.py): `agent_as_a_judge/config.py`
- [Ask and judge](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/ask.py): `agent_as_a_judge/module/ask.py`
- [Requirement planning](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/planning.py): `agent_as_a_judge/module/planning.py`

### Workspace evidence

- [Workspace graph](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/graph.py): `agent_as_a_judge/module/graph.py`
- [Code search](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/code_search.py): `agent_as_a_judge/module/code_search.py`
- [Workspace reader](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/read.py): `agent_as_a_judge/module/read.py`
- [Code locator](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/locate.py): `agent_as_a_judge/module/locate.py`
- [Trajectory retrieval](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/text_retrieve.py): `agent_as_a_judge/module/text_retrieve.py`
- [Evidence memory](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/memory.py): `agent_as_a_judge/module/memory.py`

### LLM and prompts

- [Prompt templates](https://github.com/metauto-ai/agent-as-a-judge/tree/main/agent_as_a_judge/module/prompt): `agent_as_a_judge/module/prompt`
- [LLM provider](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/llm/provider.py): `agent_as_a_judge/llm/provider.py`
- [Cost tracking](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/llm/cost.py): `agent_as_a_judge/llm/cost.py`

### Analysis and extensions

- [Evaluation statistics](https://github.com/metauto-ai/agent-as-a-judge/blob/main/agent_as_a_judge/module/statistics.py): `agent_as_a_judge/module/statistics.py`
- [OpenWiki](https://github.com/metauto-ai/agent-as-a-judge/blob/main/scripts/run_wiki.py): `scripts/run_wiki.py`

### Other components

- **User**

## Connections

- User → Evaluation agent: submits requirements (evidence: `README.md`)
- Evaluation agent → Agent configuration: uses settings (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Workspace graph: constructs graph (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Code search: searches code (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Workspace reader: reads workspace (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Code locator: locates code (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Trajectory retrieval: retrieves trajectory (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Evidence memory: uses memory (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Requirement planning: plans criteria (evidence: `agent_as_a_judge/agent.py`)
- Evaluation agent → Ask and judge: checks evidence (evidence: `agent_as_a_judge/agent.py`)
- Ask and judge → Prompt templates: formats requests (evidence: `agent_as_a_judge/module/ask.py`)
- Ask and judge → LLM provider: requests inference (evidence: `agent_as_a_judge/module/ask.py`)
- Requirement planning → Prompt templates: formats plans (evidence: `agent_as_a_judge/module/planning.py`)
- Requirement planning → LLM provider: requests inference (evidence: `agent_as_a_judge/module/planning.py`)
- Code locator → LLM provider: requests inference (evidence: `agent_as_a_judge/module/locate.py`)
- Trajectory retrieval → LLM provider: summarizes evidence (evidence: `agent_as_a_judge/module/text_retrieve.py`)
- LLM provider → Cost tracking: tracks usage cost (evidence: `agent_as_a_judge/llm/provider.py`)
- Evaluation statistics → Workspace graph: analyzes graph (evidence: `agent_as_a_judge/module/statistics.py`)
- User → OpenWiki: requests repository wiki (evidence: `README.md`)
