# florentaden/agent-climate-disclosure architecture

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

- Interactive diagram: https://gitdiagram.com/florentaden/agent-climate-disclosure
- Repository: https://github.com/florentaden/agent-climate-disclosure

## Overview

This repository analyzes climate-disclosure PDFs through three user-facing modes: automated batch analysis, Claude Code via MCP, and interactive chat. The shared RAG layer extracts PDF text and image OCR, indexes parent/child chunks in Qdrant, and supplies search and page retrieval to agents. Batch analysis produces structured answers and JSON output; MCP supports interactive evidence gathering and saving; chat supports ad-hoc exploration. The README documents the three modes; the UI and some integrations are unsampled, so their internal wiring is not expanded.

Main entry points: [`pipeline/pipeline.py`](https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py) (Batch runner), [`climate_agent/rag.py`](https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/rag.py) (PDF RAG), [`mcp/mcp_server.py`](https://github.com/florentaden/agent-climate-disclosure/blob/main/mcp/mcp_server.py) (MCP server), [`climate_agent/graph.py`](https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/graph.py) (Chat agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared RAG"]
  node_rag_toolkit["RAG tools<br/>[toolkit.py]"]
  node_rag["PDF RAG<br/>[rag.py]"]
  node_vector_store[("Qdrant")]
end

subgraph group_batch["Batch Analysis"]
  node_batch_runner["Batch runner<br/>[pipeline.py]"]
  node_analysis_agent["Analyst agent<br/>[pipeline.py]"]
  node_analysis_tools["Analysis tools<br/>[toolkit.py]"]
  node_verifier["Answer verifier<br/>[pipeline.py]"]
  node_batch_results["Answer JSON<br/>[pipeline.py]"]
end

subgraph group_mcp["MCP Analysis"]
  node_mcp_server["MCP server<br/>[mcp_server.py]"]
  node_mcp_ingest["MCP ingest<br/>[ingest.py]"]
  node_mcp_results["Saved answers<br/>[mcp_server.py]"]
end

subgraph group_chat["Interactive Chat"]
  node_chat_ui["Chat interface"]
  node_chat_entry["Chat agent<br/>[graph.py]"]
end

node_documents["Disclosure PDFs"]
node_mcp_client(("Claude Code"))
node_chat_user(("Chat user"))
node_language_model["Chat model"]

node_documents -->|"reads PDFs"| node_batch_runner
node_batch_runner -->|"uploads collection"| node_rag
node_batch_runner -->|"starts analysis"| node_analysis_agent
node_analysis_agent -->|"prompts model"| node_language_model
node_analysis_agent -->|"dispatches tools"| node_analysis_tools
node_analysis_tools -->|"searches pages"| node_rag
node_analysis_agent -->|"returns answers"| node_batch_runner
node_batch_runner -.->|"can run verifier"| node_verifier
node_batch_runner -->|"writes JSON"| node_batch_results
node_mcp_client -->|"calls MCP tools"| node_mcp_server
node_documents -->|"reads PDFs"| node_mcp_ingest
node_mcp_ingest -->|"uploads collection"| node_rag
node_mcp_server -->|"searches pages"| node_rag
node_mcp_server -->|"writes answers"| node_mcp_results
node_chat_user -->|"asks questions"| node_chat_ui
node_chat_ui -->|"sends messages"| node_chat_entry
node_chat_entry -->|"prompts model"| node_language_model
node_chat_entry -->|"dispatches tools"| node_rag_toolkit
node_rag_toolkit -->|"searches pages"| node_rag
node_rag -->|"reads writes"| node_vector_store

click node_batch_runner "https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py"
click node_analysis_agent "https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py"
click node_analysis_tools "https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/toolkit.py"
click node_verifier "https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py"
click node_batch_results "https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py"
click node_mcp_server "https://github.com/florentaden/agent-climate-disclosure/blob/main/mcp/mcp_server.py"
click node_mcp_ingest "https://github.com/florentaden/agent-climate-disclosure/blob/main/mcp/ingest.py"
click node_mcp_results "https://github.com/florentaden/agent-climate-disclosure/blob/main/mcp/mcp_server.py"
click node_chat_ui "https://github.com/florentaden/agent-climate-disclosure/tree/main/agent-chat-ui"
click node_chat_entry "https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/graph.py"
click node_rag_toolkit "https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/toolkit.py"
click node_rag "https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/rag.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_rag_toolkit,node_rag,node_vector_store,node_chat_user toneBlue
class node_batch_runner,node_analysis_agent,node_analysis_tools,node_verifier,node_batch_results toneAmber
class node_mcp_server,node_mcp_ingest,node_mcp_results toneMint
class node_chat_ui,node_chat_entry toneRose
class node_documents,node_mcp_client,node_language_model toneIndigo
```

## Components

### Shared RAG

- [RAG tools](https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/toolkit.py): `climate_agent/toolkit.py`
- [PDF RAG](https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/rag.py): `climate_agent/rag.py`
- **Qdrant**

### Batch Analysis

- [Batch runner](https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py): `pipeline/pipeline.py`
- [Analyst agent](https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py): `pipeline/pipeline.py`
- [Analysis tools](https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/toolkit.py): `pipeline/toolkit.py`
- [Answer verifier](https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py): `pipeline/pipeline.py`
- [Answer JSON](https://github.com/florentaden/agent-climate-disclosure/blob/main/pipeline/pipeline.py): `pipeline/pipeline.py`

### MCP Analysis

- [MCP server](https://github.com/florentaden/agent-climate-disclosure/blob/main/mcp/mcp_server.py): `mcp/mcp_server.py`
- [MCP ingest](https://github.com/florentaden/agent-climate-disclosure/blob/main/mcp/ingest.py): `mcp/ingest.py`
- [Saved answers](https://github.com/florentaden/agent-climate-disclosure/blob/main/mcp/mcp_server.py): `mcp/mcp_server.py`

### Interactive Chat

- [Chat interface](https://github.com/florentaden/agent-climate-disclosure/tree/main/agent-chat-ui): `agent-chat-ui`
- [Chat agent](https://github.com/florentaden/agent-climate-disclosure/blob/main/climate_agent/graph.py): `climate_agent/graph.py`

### Other components

- **Disclosure PDFs**
- **Claude Code**
- **Chat user**
- **Chat model**

## Connections

- Disclosure PDFs → Batch runner: reads PDFs
- Batch runner → PDF RAG: uploads collection
- Batch runner → Analyst agent: starts analysis
- Analyst agent → Chat model: prompts model
- Analyst agent → Analysis tools: dispatches tools
- Analysis tools → PDF RAG: searches pages
- Analyst agent → Batch runner: returns answers
- Batch runner → Answer verifier: can run verifier
- Batch runner → Answer JSON: writes JSON
- Claude Code → MCP server: calls MCP tools
- Disclosure PDFs → MCP ingest: reads PDFs
- MCP ingest → PDF RAG: uploads collection
- MCP server → PDF RAG: searches pages
- MCP server → Saved answers: writes answers
- Chat user → Chat interface: asks questions
- Chat interface → Chat agent: sends messages
- Chat agent → Chat model: prompts model
- Chat agent → RAG tools: dispatches tools
- RAG tools → PDF RAG: searches pages
- PDF RAG → Qdrant: reads writes
