# zabrodsk/rockaway-deal-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/zabrodsk/rockaway-deal-intelligence
- Repository: https://github.com/zabrodsk/rockaway-deal-intelligence

## Overview

Deal Intelligence evaluates startup deal flow from uploaded pitch decks, metrics, Specter data, or company URLs. Its principal workflow collects and normalizes evidence, organizes questions, generates and refines pro/con arguments, then ranks deals and presents recommendations. The web app also supports saved analyses, optional web and Specter enrichment, VC-specific matching, and founder–VC debates. The README documents these capabilities; sampled source was partial, so uncertain internal call wiring is omitted.

Main entry points: [`src/agent/pipeline/graph.py`](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/graph.py) (Analysis graph), [`web/app.py`](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/app.py) (Web application), [`web/agent_api.py`](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/agent_api.py) (Agent API), [`web/db.py`](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/db.py) (Supabase data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Intake and evidence"]
  node_ingest["Document ingestion"]
  node_specter_csv["Specter CSV intake<br/>[specter_ingest.py]"]
  node_store["Evidence store<br/>[store.py]"]
end

subgraph group_analysis["Deal analysis"]
  node_pipeline["Analysis graph<br/>[graph.py]"]
  node_tree["Question trees<br/>[tree.py]"]
  node_arguments["Argument generation<br/>[generation.py]"]
  node_refinement["Critique and refinement<br/>[refinement.py]"]
  node_ranking["Deal ranking<br/>[ranking.py]"]
end

subgraph group_enrichment["Optional enrichment"]
  node_web_search["Web search<br/>[providers.py]"]
  node_specter_mcp["Specter MCP"]
  node_person_intel["Person intelligence<br/>[service.py]"]
end

subgraph group_application["Application workflows"]
  node_web["Web application<br/>[app.py]"]
  node_api["Agent API<br/>[agent_api.py]"]
  node_batch["Batch runner<br/>[batch.py]"]
  node_specter_worker["Specter batch worker"]
  node_company_worker["Company worker"]
  node_matching["VC matching<br/>[engine.py]"]
  node_debate["Founder VC debate<br/>[orchestrator.py]"]
  node_company_chat["Company chat<br/>[company_chat.py]"]
end

subgraph group_state["Persistence and services"]
  node_database[("Supabase data<br/>[db.py]")]
  node_llm["LLM providers<br/>[llm.py]"]
end

node_investor(("Investment team"))
node_founder(("Startup founder"))

node_investor -->|"submits deals"| node_web
node_founder -->|"shares evidence"| node_web
node_web -->|"starts analysis"| node_api
node_batch -->|"runs analysis"| node_pipeline
node_api -->|"processes files"| node_ingest
node_api -->|"processes exports"| node_specter_csv
node_ingest -->|"builds evidence"| node_store
node_specter_csv -->|"builds evidence"| node_store
node_api -->|"evaluates deals"| node_pipeline
node_pipeline -->|"organizes questions"| node_tree
node_pipeline -->|"generates arguments"| node_arguments
node_pipeline -->|"refines arguments"| node_refinement
node_pipeline -->|"ranks deals"| node_ranking
node_pipeline -->|"retrieves evidence"| node_store
node_pipeline -->|"requests completions"| node_llm
node_api -.->|"requests search"| node_web_search
node_api -.->|"requests augmentation"| node_specter_mcp
node_specter_mcp -.->|"fetches profiles"| node_person_intel
node_web -.->|"dispatches jobs"| node_specter_worker
node_specter_worker -->|"polls queue"| node_database
node_specter_worker -->|"spawns company runs"| node_company_worker
node_company_worker -->|"evaluates company"| node_pipeline
node_web -->|"reads and writes"| node_database
node_web -->|"triggers matching"| node_matching
node_matching -->|"loads deal data"| node_database
node_web -->|"runs debate"| node_debate
node_debate -->|"persists messages"| node_database
node_web -->|"handles chat"| node_company_chat

click node_web "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/app.py"
click node_api "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/agent_api.py"
click node_batch "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/batch.py"
click node_ingest "https://github.com/zabrodsk/rockaway-deal-intelligence/tree/main/src/agent/ingest"
click node_specter_csv "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/ingest/specter_ingest.py"
click node_store "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/ingest/store.py"
click node_specter_worker "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/specter_batch_worker.py"
click node_company_worker "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/specter_company_worker.py"
click node_pipeline "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/graph.py"
click node_tree "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/answering/tree.py"
click node_arguments "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/generation.py"
click node_refinement "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/refinement.py"
click node_ranking "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/ranking.py"
click node_web_search "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/web_search/providers.py"
click node_specter_mcp "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/ingest/specter_mcp_client.py"
click node_person_intel "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/person_intel/service.py"
click node_matching "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/matching/engine.py"
click node_debate "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/debate/orchestrator.py"
click node_company_chat "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/company_chat.py"
click node_database "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/db.py"
click node_llm "https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/llm.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_ingest,node_specter_csv,node_store toneBlue
class node_pipeline,node_tree,node_arguments,node_refinement,node_ranking toneAmber
class node_web_search,node_specter_mcp,node_person_intel toneMint
class node_web,node_api,node_batch,node_specter_worker,node_company_worker,node_matching,node_debate,node_company_chat toneRose
class node_database,node_llm,node_investor,node_founder toneIndigo
```

## Components

### Intake and evidence

- [Document ingestion](https://github.com/zabrodsk/rockaway-deal-intelligence/tree/main/src/agent/ingest): `src/agent/ingest`
- [Specter CSV intake](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/ingest/specter_ingest.py): `src/agent/ingest/specter_ingest.py`
- [Evidence store](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/ingest/store.py): `src/agent/ingest/store.py`

### Deal analysis

- [Analysis graph](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/graph.py): `src/agent/pipeline/graph.py`
- [Question trees](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/answering/tree.py): `src/agent/pipeline/stages/answering/tree.py`
- [Argument generation](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/generation.py): `src/agent/pipeline/stages/generation.py`
- [Critique and refinement](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/refinement.py): `src/agent/pipeline/stages/refinement.py`
- [Deal ranking](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/pipeline/stages/ranking.py): `src/agent/pipeline/stages/ranking.py`

### Optional enrichment

- [Web search](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/web_search/providers.py): `src/agent/web_search/providers.py`
- [Specter MCP](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/ingest/specter_mcp_client.py): `src/agent/ingest/specter_mcp_client.py`
- [Person intelligence](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/person_intel/service.py): `src/agent/person_intel/service.py`

### Application workflows

- [Web application](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/app.py): `web/app.py`
- [Agent API](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/agent_api.py): `web/agent_api.py`
- [Batch runner](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/batch.py): `src/agent/batch.py`
- [Specter batch worker](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/specter_batch_worker.py): `src/agent/specter_batch_worker.py`
- [Company worker](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/specter_company_worker.py): `src/agent/specter_company_worker.py`
- [VC matching](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/matching/engine.py): `src/agent/matching/engine.py`
- [Founder VC debate](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/debate/orchestrator.py): `src/agent/debate/orchestrator.py`
- [Company chat](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/company_chat.py): `src/agent/company_chat.py`

### Persistence and services

- [Supabase data](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/web/db.py): `web/db.py`
- [LLM providers](https://github.com/zabrodsk/rockaway-deal-intelligence/blob/main/src/agent/llm.py): `src/agent/llm.py`

### Other components

- **Investment team**
- **Startup founder**

## Connections

- Investment team → Web application: submits deals
- Startup founder → Web application: shares evidence
- Web application → Agent API: starts analysis
- Batch runner → Analysis graph: runs analysis
- Agent API → Document ingestion: processes files
- Agent API → Specter CSV intake: processes exports
- Document ingestion → Evidence store: builds evidence
- Specter CSV intake → Evidence store: builds evidence
- Agent API → Analysis graph: evaluates deals
- Analysis graph → Question trees: organizes questions
- Analysis graph → Argument generation: generates arguments
- Analysis graph → Critique and refinement: refines arguments
- Analysis graph → Deal ranking: ranks deals
- Analysis graph → Evidence store: retrieves evidence
- Analysis graph → LLM providers: requests completions
- Agent API → Web search: requests search
- Agent API → Specter MCP: requests augmentation
- Specter MCP → Person intelligence: fetches profiles
- Web application → Specter batch worker: dispatches jobs
- Specter batch worker → Supabase data: polls queue
- Specter batch worker → Company worker: spawns company runs
- Company worker → Analysis graph: evaluates company
- Web application → Supabase data: reads and writes
- Web application → VC matching: triggers matching
- VC matching → Supabase data: loads deal data
- Web application → Founder VC debate: runs debate
- Founder VC debate → Supabase data: persists messages
- Web application → Company chat: handles chat
