# skala-smart-farm/agtech-investment-agent-final architecture

> Architecture diagram of the GitHub repository skala-smart-farm/agtech-investment-agent-final, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skala-smart-farm/agtech-investment-agent-final
- Repository: https://github.com/skala-smart-farm/agtech-investment-agent-final

## Overview

This is a LangGraph multi-agent system that discovers public AgTech AI startup candidates, screens eligibility, evaluates eligible companies, and produces an investment decision and checked PDF report. The README documents the evaluation sequence and the comparison across candidates; the graph modules route between discovery, evaluation, and reporting. Evidence collection combines web search and a document/web RAG path, with a shared evidence registry and code-based citation checks. Some subsystem links reflect documented workflow or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`agents/discovery.py`](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/discovery.py) (Candidate Discovery), [`agents/tech.py`](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/tech.py) (Technology Analysis), [`graph/builder.py`](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/builder.py) (Graph Builder), [`agents/eligibility.py`](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/eligibility.py) (Eligibility Gate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Workflow"]
  node_application["Application<br/>[app.py]"]
  node_graph_builder["Graph Builder<br/>[builder.py]"]
  node_graph_routes["Workflow Routes<br/>[routes.py]"]
  node_graph_state["Workflow State<br/>[state.py]"]
  node_discovery_graph["Discovery Flow<br/>[discovery_graph.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_discovery["Candidate Discovery<br/>[discovery.py]"]
  node_eligibility["Eligibility Gate<br/>[eligibility.py]"]
  node_founder["Founder Analysis<br/>[founder.py]"]
  node_tech["Technology Analysis<br/>[tech.py]"]
  node_market["Market Analysis<br/>[market.py]"]
  node_competition["Competition Analysis<br/>[competition.py]"]
  node_decision["Investment Decision<br/>[decision.py]"]
  node_judge["Criterion Judge<br/>[judge.py]"]
end

subgraph group_evidence["Evidence"]
  node_rag["Agentic RAG<br/>[agentic_rag.py]"]
  node_retrieval["Hybrid Retrieval<br/>[index.py]"]
  node_corpus["Document Loading<br/>[loader.py]"]
  node_web_search["Web Search<br/>[web_search.py]"]
  node_channels["Discovery Channels<br/>[channels.py]"]
  node_registry[("Evidence Registry<br/>[sources.py]")]
  node_grounding["Citation Checks<br/>[grounding.py]"]
end

subgraph group_runtime["Shared Runtime"]
  node_llm["LLM Runtime<br/>[llm.py]"]
  node_bounded_llm["Bounded LLM<br/>[llm_bounded.py]"]
end

subgraph group_reporting["Reporting"]
  node_report_agent["Report Generation<br/>[report.py]"]
  node_pdf_render["PDF Renderer<br/>[render.py]"]
  node_report_result["Evaluation Report"]
end

node_investor(("Evaluator"))
node_search_services["Search Providers"]
node_llm_service["LLM Service"]

node_investor -->|"runs"| node_application
node_application -->|"starts"| node_graph_builder
node_graph_builder -->|"configures"| node_graph_routes
node_graph_builder -->|"uses"| node_graph_state
node_graph_builder -->|"registers"| node_discovery_graph
node_discovery_graph -->|"dispatches"| node_discovery
node_discovery_graph -->|"dispatches"| node_eligibility
node_discovery -->|"screens"| node_eligibility
node_discovery -->|"collects candidates"| node_channels
node_discovery -->|"searches"| node_web_search
node_eligibility -->|"checks sources"| node_web_search
node_eligibility -->|"checks listings"| node_channels
node_graph_routes -->|"routes next"| node_founder
node_founder -->|"evaluates next"| node_tech
node_tech -->|"evaluates next"| node_market
node_market -->|"evaluates next"| node_competition
node_competition -->|"evaluates next"| node_decision
node_founder -->|"judges criteria"| node_judge
node_tech -->|"judges criteria"| node_judge
node_market -->|"uses RAG"| node_rag
node_tech -->|"queries baseline"| node_rag
node_rag -->|"retrieves documents"| node_retrieval
node_retrieval -->|"loads corpus"| node_corpus
node_rag -->|"searches web"| node_web_search
node_web_search -->|"queries providers"| node_search_services
node_discovery -->|"records evidence"| node_registry
node_tech -->|"records evidence"| node_registry
node_decision -->|"reads evidence"| node_registry
node_decision -->|"verifies quotes"| node_grounding
node_judge -->|"requests judgments"| node_bounded_llm
node_bounded_llm -->|"uses runtime"| node_llm
node_llm -->|"calls"| node_llm_service
node_graph_routes -->|"routes at completion"| node_report_agent
node_report_agent -->|"renders report"| node_pdf_render
node_pdf_render -->|"produces PDF"| node_report_result
node_report_agent -->|"uses results"| node_decision
node_report_result -->|"delivers report"| node_investor

click node_application "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/app.py"
click node_graph_builder "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/builder.py"
click node_graph_routes "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/routes.py"
click node_graph_state "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/state.py"
click node_discovery_graph "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/discovery_graph.py"
click node_discovery "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/discovery.py"
click node_eligibility "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/eligibility.py"
click node_founder "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/founder.py"
click node_tech "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/tech.py"
click node_market "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/market.py"
click node_competition "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/competition.py"
click node_decision "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/decision.py"
click node_judge "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/core/judge.py"
click node_rag "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/rag/agentic_rag.py"
click node_retrieval "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/rag/index.py"
click node_corpus "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/rag/loader.py"
click node_web_search "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/web_search.py"
click node_channels "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/channels.py"
click node_registry "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/sources.py"
click node_grounding "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/grounding.py"
click node_llm "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/core/llm.py"
click node_bounded_llm "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/core/llm_bounded.py"
click node_report_agent "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/report.py"
click node_pdf_render "https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/report/render.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_application,node_graph_builder,node_graph_routes,node_graph_state,node_discovery_graph toneBlue
class node_discovery,node_eligibility,node_founder,node_tech,node_market,node_competition,node_decision,node_judge toneAmber
class node_rag,node_retrieval,node_corpus,node_web_search,node_channels,node_registry,node_grounding toneMint
class node_llm,node_bounded_llm toneRose
class node_report_agent,node_pdf_render,node_report_result,node_investor,node_search_services,node_llm_service toneIndigo
```

## Components

### Workflow

- [Application](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/app.py): `app.py`
- [Graph Builder](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/builder.py): `graph/builder.py`
- [Workflow Routes](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/routes.py): `graph/routes.py`
- [Workflow State](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/state.py): `graph/state.py`
- [Discovery Flow](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/graph/discovery_graph.py): `graph/discovery_graph.py`

### Evaluation

- [Candidate Discovery](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/discovery.py): `agents/discovery.py`
- [Eligibility Gate](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/eligibility.py): `agents/eligibility.py`
- [Founder Analysis](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/founder.py): `agents/founder.py`
- [Technology Analysis](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/tech.py): `agents/tech.py`
- [Market Analysis](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/market.py): `agents/market.py`
- [Competition Analysis](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/competition.py): `agents/competition.py`
- [Investment Decision](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/decision.py): `agents/decision.py`
- [Criterion Judge](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/core/judge.py): `core/judge.py`

### Evidence

- [Agentic RAG](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/rag/agentic_rag.py): `rag/agentic_rag.py`
- [Hybrid Retrieval](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/rag/index.py): `rag/index.py`
- [Document Loading](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/rag/loader.py): `rag/loader.py`
- [Web Search](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/web_search.py): `tools/web_search.py`
- [Discovery Channels](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/channels.py): `tools/channels.py`
- [Evidence Registry](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/sources.py): `tools/sources.py`
- [Citation Checks](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/tools/grounding.py): `tools/grounding.py`

### Shared Runtime

- [LLM Runtime](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/core/llm.py): `core/llm.py`
- [Bounded LLM](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/core/llm_bounded.py): `core/llm_bounded.py`

### Reporting

- [Report Generation](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/agents/report.py): `agents/report.py`
- [PDF Renderer](https://github.com/skala-smart-farm/agtech-investment-agent-final/blob/main/report/render.py): `report/render.py`
- **Evaluation Report**

### Other components

- **Evaluator**
- **Search Providers**
- **LLM Service**

## Connections

- Evaluator → Application: runs (evidence: `README.md`)
- Application → Graph Builder: starts (evidence: `app.py`)
- Graph Builder → Workflow Routes: configures (evidence: `graph/builder.py`)
- Graph Builder → Workflow State: uses (evidence: `graph/builder.py`)
- Graph Builder → Discovery Flow: registers (evidence: `graph/builder.py`)
- Discovery Flow → Candidate Discovery: dispatches (evidence: `graph/discovery_graph.py`)
- Discovery Flow → Eligibility Gate: dispatches (evidence: `graph/discovery_graph.py`)
- Candidate Discovery → Eligibility Gate: screens (evidence: `agents/discovery.py`)
- Candidate Discovery → Discovery Channels: collects candidates (evidence: `agents/discovery.py`)
- Candidate Discovery → Web Search: searches (evidence: `agents/discovery.py`)
- Eligibility Gate → Web Search: checks sources (evidence: `agents/eligibility.py`)
- Eligibility Gate → Discovery Channels: checks listings (evidence: `agents/eligibility.py`)
- Workflow Routes → Founder Analysis: routes next (evidence: `README.md`)
- Founder Analysis → Technology Analysis: evaluates next (evidence: `README.md`)
- Technology Analysis → Market Analysis: evaluates next (evidence: `README.md`)
- Market Analysis → Competition Analysis: evaluates next (evidence: `README.md`)
- Competition Analysis → Investment Decision: evaluates next (evidence: `README.md`)
- Founder Analysis → Criterion Judge: judges criteria (evidence: `core/judge.py`)
- Technology Analysis → Criterion Judge: judges criteria (evidence: `agents/tech.py`)
- Market Analysis → Agentic RAG: uses RAG (evidence: `agents/market.py`)
- Technology Analysis → Agentic RAG: queries baseline (evidence: `agents/tech.py`)
- Agentic RAG → Hybrid Retrieval: retrieves documents (evidence: `rag/agentic_rag.py`)
- Hybrid Retrieval → Document Loading: loads corpus (evidence: `rag/index.py`)
- Agentic RAG → Web Search: searches web (evidence: `rag/agentic_rag.py`)
- Web Search → Search Providers: queries providers (evidence: `tools/web_search.py`)
- Candidate Discovery → Evidence Registry: records evidence (evidence: `agents/discovery.py`)
- Technology Analysis → Evidence Registry: records evidence (evidence: `agents/tech.py`)
- Investment Decision → Evidence Registry: reads evidence (evidence: `agents/decision.py`)
- Investment Decision → Citation Checks: verifies quotes (evidence: `agents/decision.py`)
- Criterion Judge → Bounded LLM: requests judgments (evidence: `core/judge.py`)
- Bounded LLM → LLM Runtime: uses runtime (evidence: `core/llm_bounded.py`)
- LLM Runtime → LLM Service: calls (evidence: `core/llm.py`)
- Workflow Routes → Report Generation: routes at completion (evidence: `graph/routes.py`)
- Report Generation → PDF Renderer: renders report (evidence: `agents/report.py`)
- PDF Renderer → Evaluation Report: produces PDF (evidence: `README.md`)
- Report Generation → Investment Decision: uses results (evidence: `agents/report.py`)
- Evaluation Report → Evaluator: delivers report (evidence: `README.md`)
