# nishu2000-hub/consultiq-agent architecture

> Architecture diagram of the GitHub repository nishu2000-hub/consultiq-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nishu2000-hub/consultiq-agent
- Repository: https://github.com/nishu2000-hub/consultiq-agent

## Overview

ConsultIQ accepts a business question in a Streamlit interface, runs an autonomous research agent that can search the web and retrieve public-company financials, and presents a structured consulting memo. A separate Claude-based judge evaluates the memo across five dimensions, and the interface displays scores and a PASS/REVIEW/FAIL decision. The agent loop and evaluator are supported by sampled source; some UI invocation details are omitted, so those links rely on the README’s workflow description.

Main entry points: [`agent.py`](https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py) (Agent Reasoning), [`evaluator.py`](https://github.com/nishu2000-hub/consultiq-agent/blob/main/evaluator.py) (Memo Judge), [`app.py`](https://github.com/nishu2000-hub/consultiq-agent/blob/main/app.py) (Streamlit Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_interface["Streamlit Interface<br/>[app.py]"]
  node_memo["Strategy Memo<br/>[agent.py]"]
end

subgraph group_research["Research Agent"]
  node_agent["Agent Reasoning<br/>[agent.py]"]
  node_router["Tool Router<br/>[agent.py]"]
  node_tool_runner["Tool Runner<br/>[agent.py]"]
  node_claude_agent["Claude Agent Model"]
end

subgraph group_sources["Research Sources"]
  node_web_tool["Web Search Tool<br/>[agent.py]"]
  node_financial_tool["Financial Data Tool<br/>[agent.py]"]
  node_tavily["Tavily Search"]
  node_yfinance["yfinance"]
end

subgraph group_quality["Memo Evaluation"]
  node_evaluator["Memo Judge<br/>[evaluator.py]"]
  node_claude_judge["Claude Judge Model"]
  node_quality_gate["Quality Gate<br/>[app.py]"]
end

node_user(("Business User"))

node_user -->|"enters question"| node_interface
node_interface -->|"submits question"| node_agent
node_agent -->|"reasons with"| node_claude_agent
node_agent -->|"checks tool calls"| node_router
node_router -->|"dispatches tools"| node_tool_runner
node_tool_runner -->|"runs"| node_web_tool
node_tool_runner -->|"runs"| node_financial_tool
node_web_tool -->|"searches with"| node_tavily
node_financial_tool -->|"retrieves data with"| node_yfinance
node_tool_runner -->|"returns tool results"| node_agent
node_agent -->|"synthesizes"| node_memo
node_memo -->|"evaluated by"| node_evaluator
node_evaluator -->|"scores with"| node_claude_judge
node_evaluator -->|"returns evaluation"| node_quality_gate
node_quality_gate -->|"displays verdict"| node_interface

click node_interface "https://github.com/nishu2000-hub/consultiq-agent/blob/main/app.py"
click node_agent "https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py"
click node_router "https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py"
click node_tool_runner "https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py"
click node_web_tool "https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py"
click node_financial_tool "https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py"
click node_memo "https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py"
click node_evaluator "https://github.com/nishu2000-hub/consultiq-agent/blob/main/evaluator.py"
click node_quality_gate "https://github.com/nishu2000-hub/consultiq-agent/blob/main/app.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_interface,node_memo,node_user toneBlue
class node_agent,node_router,node_tool_runner,node_claude_agent toneAmber
class node_web_tool,node_financial_tool,node_tavily,node_yfinance toneMint
class node_evaluator,node_claude_judge,node_quality_gate toneRose
```

## Components

### User Experience

- [Streamlit Interface](https://github.com/nishu2000-hub/consultiq-agent/blob/main/app.py): `app.py`
- [Strategy Memo](https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py): `agent.py`

### Research Agent

- [Agent Reasoning](https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py): `agent.py`
- [Tool Router](https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py): `agent.py`
- [Tool Runner](https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py): `agent.py`
- **Claude Agent Model**

### Research Sources

- [Web Search Tool](https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py): `agent.py`
- [Financial Data Tool](https://github.com/nishu2000-hub/consultiq-agent/blob/main/agent.py): `agent.py`
- **Tavily Search**
- **yfinance**

### Memo Evaluation

- [Memo Judge](https://github.com/nishu2000-hub/consultiq-agent/blob/main/evaluator.py): `evaluator.py`
- **Claude Judge Model**
- [Quality Gate](https://github.com/nishu2000-hub/consultiq-agent/blob/main/app.py): `app.py`

### Other components

- **Business User**

## Connections

- Business User → Streamlit Interface: enters question (evidence: `README.md`)
- Streamlit Interface → Agent Reasoning: submits question (evidence: `README.md`)
- Agent Reasoning → Claude Agent Model: reasons with (evidence: `agent.py`)
- Agent Reasoning → Tool Router: checks tool calls (evidence: `agent.py`)
- Tool Router → Tool Runner: dispatches tools (evidence: `agent.py`)
- Tool Runner → Web Search Tool: runs (evidence: `agent.py`)
- Tool Runner → Financial Data Tool: runs (evidence: `agent.py`)
- Web Search Tool → Tavily Search: searches with (evidence: `agent.py`)
- Financial Data Tool → yfinance: retrieves data with (evidence: `agent.py`)
- Tool Runner → Agent Reasoning: returns tool results (evidence: `agent.py`)
- Agent Reasoning → Strategy Memo: synthesizes (evidence: `README.md`)
- Strategy Memo → Memo Judge: evaluated by (evidence: `README.md`)
- Memo Judge → Claude Judge Model: scores with (evidence: `evaluator.py`)
- Memo Judge → Quality Gate: returns evaluation (evidence: `README.md`)
- Quality Gate → Streamlit Interface: displays verdict (evidence: `README.md`)
