# sherlinzenith/agentic-dd architecture

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

- Interactive diagram: https://gitdiagram.com/sherlinzenith/agentic-dd
- Repository: https://github.com/sherlinzenith/agentic-dd

## Overview

This is an agentic due-diligence platform that turns workspace documents into traceable findings for human review and reporting, with a separate evidence-grounded Q&A path. The documented workflow spans extraction, classification, planning, specialist analysis, verification, review, and reporting. The graph reflects the README and the supplied excerpts/index; several workflow internals and UI/API wiring are only partially shown, so uncertain links are omitted.

Main entry points: [`workflow/orchestrator.py`](https://github.com/sherlinzenith/agentic-dd/blob/main/workflow/orchestrator.py) (DD orchestrator), [`processing/document_processor.py`](https://github.com/sherlinzenith/agentic-dd/blob/main/processing/document_processor.py) (Document extraction), [`findings/finding_store.py`](https://github.com/sherlinzenith/agentic-dd/blob/main/findings/finding_store.py) (Findings and review store), [`app/main.py`](https://github.com/sherlinzenith/agentic-dd/blob/main/app/main.py) (FastAPI endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_streamlit["Streamlit UI<br/>[streamlit_app.py]"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_ui_service["UI engine service<br/>[service.py]"]
end

subgraph group_documents["Document intelligence"]
  node_extract["Document extraction"]
  node_classifier["Workstream classification"]
  node_inventory["Document inventory<br/>[inventory.py]"]
  node_readiness["Readiness checks<br/>[readiness.py]"]
end

subgraph group_investigation["Investigation workflow"]
  node_lead["Investigation planning<br/>[lead_agent.py]"]
  node_graph_entry["Job lifecycle<br/>[dd_graph.py]"]
  node_orchestrator["DD orchestrator<br/>[orchestrator.py]"]
  node_financial["Financial agent<br/>[financial_agent.py]"]
  node_legal["Legal agent<br/>[legal_agent.py]"]
  node_cross_domain["Cross-domain analysis<br/>[cross_domain.py]"]
  node_evidence["Evidence verification<br/>[evidence_verify.py]"]
end

subgraph group_review["Findings and review"]
  node_finding_store[("Findings and review store<br/>[finding_store.py]")]
  node_report["DD report generation"]
end

subgraph group_qa["Workspace Q&amp;A"]
  node_qa_service["Evidence-grounded Q&amp;A<br/>[qa_service.py]"]
  node_retriever["Workspace retrieval<br/>[retriever.py]"]
  node_qa_models["Q&amp;A data models<br/>[models.py]"]
end

node_reviewer(("Reviewer"))
node_vdr[("VDR workspace")]

node_vdr -->|"supplies documents"| node_extract
node_extract -->|"provides text"| node_classifier
node_api -->|"loads documents"| node_extract
node_api -->|"classifies documents"| node_classifier
node_streamlit -->|"uses service"| node_ui_service
node_ui_service -->|"loads documents"| node_extract
node_ui_service -->|"organizes documents"| node_inventory
node_ui_service -->|"checks readiness"| node_readiness
node_api -->|"starts and resumes jobs"| node_graph_entry
node_graph_entry -->|"loads documents"| node_extract
node_graph_entry -->|"validates plan types"| node_lead
node_graph_entry -->|"builds workflow"| node_orchestrator
node_lead -->|"plans workstreams"| node_orchestrator
node_orchestrator -->|"dispatches financial work"| node_financial
node_orchestrator -->|"dispatches legal work"| node_legal
node_orchestrator -->|"runs cross-domain analysis"| node_cross_domain
node_orchestrator -->|"verifies findings"| node_evidence
node_financial -->|"saves findings"| node_finding_store
node_evidence -->|"supports findings"| node_finding_store
node_reviewer -->|"approves or rejects"| node_finding_store
node_api -->|"records review"| node_finding_store
node_graph_entry -->|"resets job findings"| node_finding_store
node_api -->|"generates report"| node_report
node_finding_store -->|"provides findings"| node_report
node_streamlit -->|"asks workspace questions"| node_qa_service
node_qa_service -->|"retrieves evidence"| node_retriever
node_qa_service -->|"returns answer models"| node_qa_models
node_retriever -->|"returns retrieved chunks"| node_qa_models
node_extract -.->|"supplies workspace documents"| node_qa_service

click node_streamlit "https://github.com/sherlinzenith/agentic-dd/blob/main/streamlit_app.py"
click node_api "https://github.com/sherlinzenith/agentic-dd/blob/main/app/main.py"
click node_ui_service "https://github.com/sherlinzenith/agentic-dd/blob/main/ui/service.py"
click node_extract "https://github.com/sherlinzenith/agentic-dd/blob/main/processing/document_processor.py"
click node_classifier "https://github.com/sherlinzenith/agentic-dd/blob/main/processing/document_classifier.py"
click node_inventory "https://github.com/sherlinzenith/agentic-dd/blob/main/agents/inventory.py"
click node_readiness "https://github.com/sherlinzenith/agentic-dd/blob/main/agents/readiness.py"
click node_lead "https://github.com/sherlinzenith/agentic-dd/blob/main/agents/lead_agent.py"
click node_graph_entry "https://github.com/sherlinzenith/agentic-dd/blob/main/workflow/dd_graph.py"
click node_orchestrator "https://github.com/sherlinzenith/agentic-dd/blob/main/workflow/orchestrator.py"
click node_financial "https://github.com/sherlinzenith/agentic-dd/blob/main/agents/financial_agent.py"
click node_legal "https://github.com/sherlinzenith/agentic-dd/blob/main/agents/legal_agent.py"
click node_cross_domain "https://github.com/sherlinzenith/agentic-dd/blob/main/agents/cross_domain.py"
click node_evidence "https://github.com/sherlinzenith/agentic-dd/blob/main/agents/evidence_verify.py"
click node_finding_store "https://github.com/sherlinzenith/agentic-dd/blob/main/findings/finding_store.py"
click node_report "https://github.com/sherlinzenith/agentic-dd/blob/main/reports/report_generator.py"
click node_qa_service "https://github.com/sherlinzenith/agentic-dd/blob/main/qa/qa_service.py"
click node_retriever "https://github.com/sherlinzenith/agentic-dd/blob/main/qa/retriever.py"
click node_qa_models "https://github.com/sherlinzenith/agentic-dd/blob/main/qa/models.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,node_api,node_ui_service,node_reviewer toneBlue
class node_extract,node_classifier,node_inventory,node_readiness,node_vdr toneAmber
class node_lead,node_graph_entry,node_orchestrator,node_financial,node_legal,node_cross_domain,node_evidence toneMint
class node_finding_store,node_report toneRose
class node_qa_service,node_retriever,node_qa_models toneIndigo
```

## Components

### Application entry

- [Streamlit UI](https://github.com/sherlinzenith/agentic-dd/blob/main/streamlit_app.py): `streamlit_app.py`
- [FastAPI endpoints](https://github.com/sherlinzenith/agentic-dd/blob/main/app/main.py): `app/main.py`
- [UI engine service](https://github.com/sherlinzenith/agentic-dd/blob/main/ui/service.py): `ui/service.py`

### Document intelligence

- [Document extraction](https://github.com/sherlinzenith/agentic-dd/blob/main/processing/document_processor.py): `processing/document_processor.py`
- [Workstream classification](https://github.com/sherlinzenith/agentic-dd/blob/main/processing/document_classifier.py): `processing/document_classifier.py`
- [Document inventory](https://github.com/sherlinzenith/agentic-dd/blob/main/agents/inventory.py): `agents/inventory.py`
- [Readiness checks](https://github.com/sherlinzenith/agentic-dd/blob/main/agents/readiness.py): `agents/readiness.py`

### Investigation workflow

- [Investigation planning](https://github.com/sherlinzenith/agentic-dd/blob/main/agents/lead_agent.py): `agents/lead_agent.py`
- [Job lifecycle](https://github.com/sherlinzenith/agentic-dd/blob/main/workflow/dd_graph.py): `workflow/dd_graph.py`
- [DD orchestrator](https://github.com/sherlinzenith/agentic-dd/blob/main/workflow/orchestrator.py): `workflow/orchestrator.py`
- [Financial agent](https://github.com/sherlinzenith/agentic-dd/blob/main/agents/financial_agent.py): `agents/financial_agent.py`
- [Legal agent](https://github.com/sherlinzenith/agentic-dd/blob/main/agents/legal_agent.py): `agents/legal_agent.py`
- [Cross-domain analysis](https://github.com/sherlinzenith/agentic-dd/blob/main/agents/cross_domain.py): `agents/cross_domain.py`
- [Evidence verification](https://github.com/sherlinzenith/agentic-dd/blob/main/agents/evidence_verify.py): `agents/evidence_verify.py`

### Findings and review

- [Findings and review store](https://github.com/sherlinzenith/agentic-dd/blob/main/findings/finding_store.py): `findings/finding_store.py`
- [DD report generation](https://github.com/sherlinzenith/agentic-dd/blob/main/reports/report_generator.py): `reports/report_generator.py`

### Workspace Q&A

- [Evidence-grounded Q&A](https://github.com/sherlinzenith/agentic-dd/blob/main/qa/qa_service.py): `qa/qa_service.py`
- [Workspace retrieval](https://github.com/sherlinzenith/agentic-dd/blob/main/qa/retriever.py): `qa/retriever.py`
- [Q&A data models](https://github.com/sherlinzenith/agentic-dd/blob/main/qa/models.py): `qa/models.py`

### Other components

- **Reviewer**
- **VDR workspace**

## Connections

- VDR workspace → Document extraction: supplies documents (evidence: `README.md`)
- Document extraction → Workstream classification: provides text (evidence: `app/main.py`)
- FastAPI endpoints → Document extraction: loads documents (evidence: `app/main.py`)
- FastAPI endpoints → Workstream classification: classifies documents (evidence: `app/main.py`)
- Streamlit UI → UI engine service: uses service (evidence: `streamlit_app.py`)
- UI engine service → Document extraction: loads documents (evidence: `ui/service.py`)
- UI engine service → Document inventory: organizes documents (evidence: `ui/service.py`)
- UI engine service → Readiness checks: checks readiness (evidence: `ui/service.py`)
- FastAPI endpoints → Job lifecycle: starts and resumes jobs (evidence: `app/main.py`)
- Job lifecycle → Document extraction: loads documents (evidence: `workflow/dd_graph.py`)
- Job lifecycle → Investigation planning: validates plan types (evidence: `workflow/dd_graph.py`)
- Job lifecycle → DD orchestrator: builds workflow (evidence: `workflow/dd_graph.py`)
- Investigation planning → DD orchestrator: plans workstreams (evidence: `README.md`)
- DD orchestrator → Financial agent: dispatches financial work (evidence: `workflow/orchestrator.py`)
- DD orchestrator → Legal agent: dispatches legal work (evidence: `workflow/orchestrator.py`)
- DD orchestrator → Cross-domain analysis: runs cross-domain analysis (evidence: `workflow/orchestrator.py`)
- DD orchestrator → Evidence verification: verifies findings (evidence: `README.md`)
- Financial agent → Findings and review store: saves findings (evidence: `agents/financial_agent.py`)
- Evidence verification → Findings and review store: supports findings (evidence: `README.md`)
- Reviewer → Findings and review store: approves or rejects (evidence: `README.md`)
- FastAPI endpoints → Findings and review store: records review (evidence: `app/main.py`)
- Job lifecycle → Findings and review store: resets job findings (evidence: `workflow/dd_graph.py`)
- FastAPI endpoints → DD report generation: generates report (evidence: `app/main.py`)
- Findings and review store → DD report generation: provides findings (evidence: `README.md`)
- Streamlit UI → Evidence-grounded Q&A: asks workspace questions (evidence: `streamlit_app.py`)
- Evidence-grounded Q&A → Workspace retrieval: retrieves evidence (evidence: `qa/qa_service.py`)
- Evidence-grounded Q&A → Q&A data models: returns answer models (evidence: `qa/qa_service.py`)
- Workspace retrieval → Q&A data models: returns retrieved chunks (evidence: `qa/retriever.py`)
- Document extraction → Evidence-grounded Q&A: supplies workspace documents
