# neelghoshal/eval_agent_system_nrtf architecture

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

- Interactive diagram: https://gitdiagram.com/neelghoshal/eval_agent_system_nrtf
- Repository: https://github.com/neelghoshal/eval_agent_system_nrtf

## Overview

Eval Agent System accepts a document through a Streamlit UI or CLI, runs four independent analyses in parallel, joins their results and errors into a report, and displays the findings. The analyses cover document quality, claim verification, authority checks, and internal/external contradictions. Shared layers provide typed graph state, Snowflake Cortex inference, and web search. The README documents the CLI entry point and sample-bill capability, but the supplied excerpts do not show sample loading or CLI result handling, so those links are omitted. The graph wiring and agent-to-service edges are supported by excerpts; external service edges are shown where their integrations are explicit.

Main entry points: [`src/eval_system/graph.py`](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/graph.py) (LangGraph workflow), [`src/eval_system/tools.py`](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/tools.py) (Web search tools), [`src/eval_system/llm.py`](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/llm.py) (Cortex LLM client), [`src/eval_system/agents/claim_verification/agent.py`](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/claim_verification/agent.py) (Claim verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_streamlit["Streamlit app<br/>[app.py]"]
end

subgraph group_orchestration["Graph orchestration"]
  node_graph["LangGraph workflow<br/>[graph.py]"]
  node_state["Shared state contracts<br/>[state.py]"]
end

subgraph group_analysis["Analysis agents"]
  node_evaluation["Quality evaluation<br/>[agent.py]"]
  node_evaluation_prompts["Evaluation prompts<br/>[prompts.py]"]
  node_claims["Claim verification<br/>[agent.py]"]
  node_claims_prompts["Claim prompts<br/>[prompts.py]"]
  node_authority["Authority check<br/>[agent.py]"]
  node_authority_prompts["Authority prompts<br/>[prompts.py]"]
  node_contradictions["Contradiction check<br/>[agent.py]"]
  node_contradiction_prompts["Contradiction prompts<br/>[prompts.py]"]
end

subgraph group_shared["Shared services"]
  node_llm["Cortex LLM client<br/>[llm.py]"]
  node_search["Web search tools<br/>[tools.py]"]
end

node_user(("Document author"))
node_ddgs["DuckDuckGo search"]
node_wikipedia["Wikipedia search"]
node_cortex["Snowflake Cortex"]

node_user -->|"provides document"| node_streamlit
node_streamlit -->|"invokes workflow"| node_graph
node_graph -->|"dispatches"| node_evaluation
node_graph -->|"dispatches"| node_claims
node_graph -->|"dispatches"| node_authority
node_graph -->|"dispatches"| node_contradictions
node_graph -->|"uses contracts"| node_state
node_evaluation -->|"uses prompts"| node_evaluation_prompts
node_claims -->|"uses prompts"| node_claims_prompts
node_authority -->|"uses prompts"| node_authority_prompts
node_contradictions -->|"uses prompts"| node_contradiction_prompts
node_evaluation -->|"requests inference"| node_llm
node_claims -->|"requests inference"| node_llm
node_authority -->|"requests inference"| node_llm
node_contradictions -->|"requests inference"| node_llm
node_llm -->|"posts inference"| node_cortex
node_claims -->|"searches claims"| node_search
node_authority -->|"searches people"| node_search
node_contradictions -->|"searches statements"| node_search
node_search -->|"queries first"| node_ddgs
node_search -->|"falls back"| node_wikipedia
node_streamlit -->|"displays report"| node_user

click node_streamlit "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/app.py"
click node_graph "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/graph.py"
click node_state "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/state.py"
click node_evaluation "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/evaluation/agent.py"
click node_evaluation_prompts "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/evaluation/prompts.py"
click node_claims "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/claim_verification/agent.py"
click node_claims_prompts "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/claim_verification/prompts.py"
click node_authority "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/authority_check/agent.py"
click node_authority_prompts "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/authority_check/prompts.py"
click node_contradictions "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/contradiction/agent.py"
click node_contradiction_prompts "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/contradiction/prompts.py"
click node_llm "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/llm.py"
click node_search "https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/tools.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_streamlit toneBlue
class node_graph,node_state toneAmber
class node_evaluation,node_evaluation_prompts,node_claims,node_claims_prompts,node_authority,node_authority_prompts,node_contradictions,node_contradiction_prompts toneMint
class node_llm,node_search toneRose
class node_user,node_ddgs,node_wikipedia,node_cortex toneIndigo
```

## Components

### User interface

- [Streamlit app](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/app.py): `src/app.py`

### Graph orchestration

- [LangGraph workflow](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/graph.py): `src/eval_system/graph.py`
- [Shared state contracts](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/state.py): `src/eval_system/state.py`

### Analysis agents

- [Quality evaluation](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/evaluation/agent.py): `src/eval_system/agents/evaluation/agent.py`
- [Evaluation prompts](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/evaluation/prompts.py): `src/eval_system/agents/evaluation/prompts.py`
- [Claim verification](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/claim_verification/agent.py): `src/eval_system/agents/claim_verification/agent.py`
- [Claim prompts](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/claim_verification/prompts.py): `src/eval_system/agents/claim_verification/prompts.py`
- [Authority check](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/authority_check/agent.py): `src/eval_system/agents/authority_check/agent.py`
- [Authority prompts](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/authority_check/prompts.py): `src/eval_system/agents/authority_check/prompts.py`
- [Contradiction check](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/contradiction/agent.py): `src/eval_system/agents/contradiction/agent.py`
- [Contradiction prompts](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/agents/contradiction/prompts.py): `src/eval_system/agents/contradiction/prompts.py`

### Shared services

- [Cortex LLM client](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/llm.py): `src/eval_system/llm.py`
- [Web search tools](https://github.com/neelghoshal/eval_agent_system_nrtf/blob/main/src/eval_system/tools.py): `src/eval_system/tools.py`

### Other components

- **Document author**
- **DuckDuckGo search**
- **Wikipedia search**
- **Snowflake Cortex**

## Connections

- Document author → Streamlit app: provides document (evidence: `src/app.py`)
- Streamlit app → LangGraph workflow: invokes workflow (evidence: `src/app.py`)
- LangGraph workflow → Quality evaluation: dispatches (evidence: `src/eval_system/graph.py`)
- LangGraph workflow → Claim verification: dispatches (evidence: `src/eval_system/graph.py`)
- LangGraph workflow → Authority check: dispatches (evidence: `src/eval_system/graph.py`)
- LangGraph workflow → Contradiction check: dispatches (evidence: `src/eval_system/graph.py`)
- LangGraph workflow → Shared state contracts: uses contracts (evidence: `src/eval_system/graph.py`)
- Quality evaluation → Evaluation prompts: uses prompts (evidence: `src/eval_system/agents/evaluation/agent.py`)
- Claim verification → Claim prompts: uses prompts (evidence: `src/eval_system/agents/claim_verification/agent.py`)
- Authority check → Authority prompts: uses prompts (evidence: `src/eval_system/agents/authority_check/agent.py`)
- Contradiction check → Contradiction prompts: uses prompts (evidence: `src/eval_system/agents/contradiction/agent.py`)
- Quality evaluation → Cortex LLM client: requests inference (evidence: `src/eval_system/agents/evaluation/agent.py`)
- Claim verification → Cortex LLM client: requests inference (evidence: `src/eval_system/agents/claim_verification/agent.py`)
- Authority check → Cortex LLM client: requests inference (evidence: `src/eval_system/agents/authority_check/agent.py`)
- Contradiction check → Cortex LLM client: requests inference (evidence: `src/eval_system/agents/contradiction/agent.py`)
- Cortex LLM client → Snowflake Cortex: posts inference (evidence: `src/eval_system/llm.py`)
- Claim verification → Web search tools: searches claims (evidence: `src/eval_system/agents/claim_verification/agent.py`)
- Authority check → Web search tools: searches people (evidence: `src/eval_system/agents/authority_check/agent.py`)
- Contradiction check → Web search tools: searches statements (evidence: `src/eval_system/agents/contradiction/agent.py`)
- Web search tools → DuckDuckGo search: queries first (evidence: `src/eval_system/tools.py`)
- Web search tools → Wikipedia search: falls back (evidence: `src/eval_system/tools.py`)
- Streamlit app → Document author: displays report (evidence: `src/app.py`)
