# skala-smart-farm/agtech-investment architecture

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

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

## Overview

This is a LangGraph-based AgTech startup investment evaluator. Its main workflow discovers candidates, screens them for eligibility, evaluates eligible startups across founder, technology, market, and competition dimensions, then makes investment decisions and generates a checked PDF report. Agentic RAG supplies cited document and web evidence; code validates citations and applies scorecard rules. The README documents the workflow and major capabilities; source excerpts and the index support selected internal links, but unsampled implementations and some runtime wiring are not shown.

Main entry points: [`agents/discovery.py`](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/discovery.py) (Candidate discovery), [`rag/agentic_rag.py`](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/rag/agentic_rag.py) (Agentic RAG), [`tools/web_search.py`](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/tools/web_search.py) (Web search), [`graph/builder.py`](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/graph/builder.py) (Workflow graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow orchestration"]
  node_app["CLI entry<br/>[app.py]"]
  node_graph["Workflow graph<br/>[builder.py]"]
  node_routing["Candidate routing<br/>[routes.py]"]
  node_state["Evaluation state<br/>[state.py]"]
end

subgraph group_evaluation["Startup evaluation"]
  node_discovery["Candidate discovery<br/>[discovery.py]"]
  node_eligibility["Eligibility screening<br/>[eligibility.py]"]
  node_channels["Discovery channels<br/>[channels.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]"]
end

subgraph group_evidence["Evidence and retrieval"]
  node_rag["Agentic RAG<br/>[agentic_rag.py]"]
  node_index["Hybrid retrieval<br/>[index.py]"]
  node_loader["Document loading<br/>[loader.py]"]
  node_web["Web search<br/>[web_search.py]"]
  node_sources[("Evidence registry<br/>[sources.py]")]
end

subgraph group_reporting["Decision and reporting"]
  node_decision["Investment decision<br/>[decision.py]"]
  node_report["Report generation<br/>[report.py]"]
  node_renderer["PDF renderer<br/>[render.py]"]
end

subgraph group_foundation["Shared services"]
  node_judge["Evidence judge<br/>[judge.py]"]
  node_llm["LLM services<br/>[llm.py]"]
  node_bounded["Bounded LLM<br/>[llm_bounded.py]"]
  node_prompts["Prompt rendering<br/>[prompts.py]"]
  node_config["Runtime config<br/>[config.py]"]
end

node_user(("Evaluator"))
node_search_provider["Search providers"]
node_document_corpus["Public documents"]
node_llm_provider["LLM provider"]
node_pdf["PDF output"]

node_user -->|"starts evaluation"| node_app
node_app -->|"runs workflow"| node_graph
node_graph -->|"routes candidates"| node_routing
node_graph -->|"uses state"| node_state
node_graph -->|"runs first"| node_discovery
node_discovery -->|"screens candidates"| node_eligibility
node_discovery -->|"collects candidates"| node_channels
node_eligibility -->|"passes eligible"| node_founder
node_founder -->|"evaluates next"| node_tech
node_tech -->|"evaluates next"| node_market
node_market -->|"evaluates next"| node_competition
node_competition -->|"informs decision"| node_decision
node_decision -->|"routes next candidate"| node_routing
node_routing -->|"selects next"| node_discovery
node_routing -->|"ends at report"| node_report
node_tech -->|"gets technical baseline"| node_rag
node_market -->|"retrieves evidence"| node_rag
node_rag -->|"searches documents"| node_index
node_index -->|"loads corpus"| node_loader
node_rag -->|"supplements evidence"| node_web
node_web -->|"queries providers"| node_search_provider
node_index -.->|"retrieves from"| node_document_corpus
node_discovery -->|"searches candidates"| node_web
node_eligibility -->|"checks public facts"| node_web
node_web -->|"registers evidence"| node_sources
node_rag -->|"records citations"| node_sources
node_decision -->|"judges criteria"| node_judge
node_judge -->|"validates evidence"| node_sources
node_decision -->|"selects report result"| node_report
node_report -->|"renders PDF"| node_renderer
node_renderer -->|"produces"| node_pdf
node_llm -->|"calls model"| node_llm_provider
node_bounded -->|"reuses configuration"| node_llm
node_bounded -->|"requests structured output"| node_llm_provider
node_judge -->|"invokes structured model"| node_bounded
node_bounded -->|"reads settings"| node_config
node_llm -->|"reads model settings"| node_config
node_judge -->|"formats judgment prompt"| node_prompts

click node_app "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/app.py"
click node_graph "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/graph/builder.py"
click node_routing "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/graph/routes.py"
click node_state "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/graph/state.py"
click node_discovery "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/discovery.py"
click node_eligibility "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/eligibility.py"
click node_channels "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/tools/channels.py"
click node_founder "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/founder.py"
click node_tech "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/tech.py"
click node_market "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/market.py"
click node_competition "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/competition.py"
click node_rag "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/rag/agentic_rag.py"
click node_index "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/rag/index.py"
click node_loader "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/rag/loader.py"
click node_web "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/tools/web_search.py"
click node_sources "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/tools/sources.py"
click node_judge "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/judge.py"
click node_decision "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/decision.py"
click node_report "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/report.py"
click node_renderer "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/report/render.py"
click node_llm "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/llm.py"
click node_bounded "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/llm_bounded.py"
click node_prompts "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/prompts.py"
click node_config "https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/config.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_app,node_graph,node_routing,node_state toneBlue
class node_discovery,node_eligibility,node_channels,node_founder,node_tech,node_market,node_competition toneAmber
class node_rag,node_index,node_loader,node_web,node_sources toneMint
class node_decision,node_report,node_renderer toneRose
class node_judge,node_llm,node_bounded,node_prompts,node_config,node_user,node_search_provider,node_document_corpus,node_llm_provider,node_pdf toneIndigo
```

## Components

### Workflow orchestration

- [CLI entry](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/app.py): `app.py`
- [Workflow graph](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/graph/builder.py): `graph/builder.py`
- [Candidate routing](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/graph/routes.py): `graph/routes.py`
- [Evaluation state](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/graph/state.py): `graph/state.py`

### Startup evaluation

- [Candidate discovery](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/discovery.py): `agents/discovery.py`
- [Eligibility screening](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/eligibility.py): `agents/eligibility.py`
- [Discovery channels](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/tools/channels.py): `tools/channels.py`
- [Founder analysis](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/founder.py): `agents/founder.py`
- [Technology analysis](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/tech.py): `agents/tech.py`
- [Market analysis](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/market.py): `agents/market.py`
- [Competition analysis](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/competition.py): `agents/competition.py`

### Evidence and retrieval

- [Agentic RAG](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/rag/agentic_rag.py): `rag/agentic_rag.py`
- [Hybrid retrieval](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/rag/index.py): `rag/index.py`
- [Document loading](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/rag/loader.py): `rag/loader.py`
- [Web search](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/tools/web_search.py): `tools/web_search.py`
- [Evidence registry](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/tools/sources.py): `tools/sources.py`

### Decision and reporting

- [Investment decision](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/decision.py): `agents/decision.py`
- [Report generation](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/agents/report.py): `agents/report.py`
- [PDF renderer](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/report/render.py): `report/render.py`

### Shared services

- [Evidence judge](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/judge.py): `core/judge.py`
- [LLM services](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/llm.py): `core/llm.py`
- [Bounded LLM](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/llm_bounded.py): `core/llm_bounded.py`
- [Prompt rendering](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/prompts.py): `core/prompts.py`
- [Runtime config](https://github.com/skala-smart-farm/agtech-investment/blob/multi-agent-orchestration/core/config.py): `core/config.py`

### Other components

- **Evaluator**
- **Search providers**
- **Public documents**
- **LLM provider**
- **PDF output**

## Connections

- Evaluator → CLI entry: starts evaluation
- CLI entry → Workflow graph: runs workflow (evidence: `app.py`)
- Workflow graph → Candidate routing: routes candidates (evidence: `graph/builder.py`)
- Workflow graph → Evaluation state: uses state (evidence: `graph/builder.py`)
- Workflow graph → Candidate discovery: runs first
- Candidate discovery → Eligibility screening: screens candidates (evidence: `agents/discovery.py`)
- Candidate discovery → Discovery channels: collects candidates (evidence: `agents/discovery.py`)
- Eligibility screening → Founder analysis: passes eligible
- Founder analysis → Technology analysis: evaluates next (evidence: `agents/founder.py`)
- Technology analysis → Market analysis: evaluates next (evidence: `agents/market.py`)
- Market analysis → Competition analysis: evaluates next
- Competition analysis → Investment decision: informs decision
- Investment decision → Candidate routing: routes next candidate (evidence: `graph/routes.py`)
- Candidate routing → Candidate discovery: selects next (evidence: `graph/routes.py`)
- Candidate routing → Report generation: ends at report (evidence: `graph/routes.py`)
- Technology analysis → Agentic RAG: gets technical baseline (evidence: `agents/tech.py`)
- Market analysis → Agentic RAG: retrieves evidence (evidence: `agents/market.py`)
- Agentic RAG → Hybrid retrieval: searches documents (evidence: `rag/agentic_rag.py`)
- Hybrid retrieval → Document loading: loads corpus (evidence: `rag/index.py`)
- Agentic RAG → Web search: supplements evidence (evidence: `rag/agentic_rag.py`)
- Web search → Search providers: queries providers (evidence: `tools/web_search.py`)
- Hybrid retrieval → Public documents: retrieves from
- Candidate discovery → Web search: searches candidates (evidence: `agents/discovery.py`)
- Eligibility screening → Web search: checks public facts (evidence: `agents/eligibility.py`)
- Web search → Evidence registry: registers evidence (evidence: `tools/web_search.py`)
- Agentic RAG → Evidence registry: records citations (evidence: `rag/agentic_rag.py`)
- Investment decision → Evidence judge: judges criteria (evidence: `agents/decision.py`)
- Evidence judge → Evidence registry: validates evidence (evidence: `core/judge.py`)
- Investment decision → Report generation: selects report result (evidence: `agents/report.py`)
- Report generation → PDF renderer: renders PDF (evidence: `agents/report.py`)
- PDF renderer → PDF output: produces (evidence: `report/render.py`)
- LLM services → LLM provider: calls model (evidence: `core/llm.py`)
- Bounded LLM → LLM services: reuses configuration (evidence: `core/llm_bounded.py`)
- Bounded LLM → LLM provider: requests structured output (evidence: `core/llm_bounded.py`)
- Evidence judge → Bounded LLM: invokes structured model (evidence: `core/judge.py`)
- Bounded LLM → Runtime config: reads settings (evidence: `core/llm_bounded.py`)
- LLM services → Runtime config: reads model settings (evidence: `core/llm.py`)
- Evidence judge → Prompt rendering: formats judgment prompt (evidence: `core/judge.py`)
