# rikkumahan/agentdate- architecture

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

- Interactive diagram: https://gitdiagram.com/rikkumahan/agentdate-
- Repository: https://github.com/rikkumahan/agentdate-

## Overview

agentDate turns public LinkedIn and Instagram links into evidence-grounded profiles, has profile agents shortlist and simulate dates, then ranks mutual fit for each person. The browser coordinates resumable stages and stores the run locally; API routes perform scraping and agent work. The map includes the documented gender classification, scene views, love map, and profile/date pages. Some pipeline-to-route links are documented in the README rather than visible in the sampled pipeline excerpt.

Main entry points: [`lib/pipeline.ts`](https://github.com/rikkumahan/agentdate-/blob/main/lib/pipeline.ts) (Run coordinator), [`lib/store.ts`](https://github.com/rikkumahan/agentdate-/blob/main/lib/store.ts) (Run store), [`lib/llm.ts`](https://github.com/rikkumahan/agentdate-/blob/main/lib/llm.ts) (LLM runtime), [`app/[run]/page.tsx`](https://github.com/rikkumahan/agentdate-/blob/main/app/%5Brun%5D/page.tsx) (Run dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Run workflow"]
  node_entry["Link entry<br/>[page.tsx]"]
  node_pipeline["Run coordinator<br/>[pipeline.ts]"]
end

subgraph group_agents["Agent services"]
  node_scrape["Social scraping<br/>[route.ts]"]
  node_profile["Profile analysis<br/>[route.ts]"]
  node_gender["Gender classification<br/>[route.ts]"]
  node_shortlist["Agent shortlisting<br/>[route.ts]"]
  node_date["Date simulation<br/>[route.ts]"]
end

subgraph group_ranking["Results and views"]
  node_rank["Mutual ranking<br/>[rank.ts]"]
  node_dashboard["Run dashboard<br/>[page.tsx]"]
  node_love_map["Love map<br/>[lovemap.tsx]"]
  node_profile_page["Person profile<br/>[page.tsx]"]
  node_date_page["Date detail<br/>[page.tsx]"]
  node_date_display["Date scene and transcript<br/>[ui.tsx]"]
  node_scene_art["Scene rendering<br/>[scene.tsx]"]
end

subgraph group_shared["Shared runtime"]
  node_link_parser["Link parser<br/>[links.ts]"]
  node_run_store[("Run store<br/>[store.ts]")]
  node_raw_cleanup["Scrape matching and pruning<br/>[prune.ts]"]
  node_llm["LLM runtime<br/>[llm.ts]"]
  node_demo_data["Demo run data<br/>[demo.json]"]
end

node_visitor(("Visitor"))
node_apify["Apify"]

node_visitor -->|"submits links"| node_entry
node_entry -->|"parses links"| node_link_parser
node_entry -->|"starts run"| node_run_store
node_entry -->|"starts pipeline"| node_pipeline
node_pipeline -->|"updates state"| node_run_store
node_pipeline -->|"posts scrape"| node_scrape
node_pipeline -->|"posts analysis"| node_profile
node_pipeline -->|"posts classification"| node_gender
node_pipeline -->|"posts shortlist"| node_shortlist
node_pipeline -->|"posts dates"| node_date
node_scrape -->|"runs actors"| node_apify
node_scrape -->|"matches and prunes"| node_raw_cleanup
node_profile -->|"generates profile"| node_llm
node_gender -->|"classifies person"| node_llm
node_shortlist -->|"selects dates"| node_llm
node_date -->|"generates turns"| node_llm
node_date -->|"scores date"| node_llm
node_dashboard -->|"loads run"| node_run_store
node_dashboard -->|"controls run"| node_pipeline
node_dashboard -->|"ranks dates"| node_rank
node_dashboard -->|"renders map"| node_love_map
node_profile_page -->|"loads profile"| node_run_store
node_profile_page -->|"shows ranking"| node_rank
node_date_page -->|"loads date"| node_run_store
node_date_page -->|"renders date"| node_date_display
node_date_display -->|"renders scene"| node_scene_art
node_run_store -->|"loads demo"| node_demo_data

click node_entry "https://github.com/rikkumahan/agentdate-/blob/main/app/page.tsx"
click node_link_parser "https://github.com/rikkumahan/agentdate-/blob/main/lib/links.ts"
click node_pipeline "https://github.com/rikkumahan/agentdate-/blob/main/lib/pipeline.ts"
click node_run_store "https://github.com/rikkumahan/agentdate-/blob/main/lib/store.ts"
click node_scrape "https://github.com/rikkumahan/agentdate-/blob/main/app/api/scrape/route.ts"
click node_raw_cleanup "https://github.com/rikkumahan/agentdate-/blob/main/lib/prune.ts"
click node_profile "https://github.com/rikkumahan/agentdate-/blob/main/app/api/analyze/route.ts"
click node_gender "https://github.com/rikkumahan/agentdate-/blob/main/app/api/gender/route.ts"
click node_shortlist "https://github.com/rikkumahan/agentdate-/blob/main/app/api/shortlist/route.ts"
click node_date "https://github.com/rikkumahan/agentdate-/blob/main/app/api/date/route.ts"
click node_llm "https://github.com/rikkumahan/agentdate-/blob/main/lib/llm.ts"
click node_rank "https://github.com/rikkumahan/agentdate-/blob/main/lib/rank.ts"
click node_dashboard "https://github.com/rikkumahan/agentdate-/blob/main/app/%5Brun%5D/page.tsx"
click node_love_map "https://github.com/rikkumahan/agentdate-/blob/main/components/lovemap.tsx"
click node_profile_page "https://github.com/rikkumahan/agentdate-/blob/main/app/%5Brun%5D/p/%5Bpid%5D/page.tsx"
click node_date_page "https://github.com/rikkumahan/agentdate-/blob/main/app/%5Brun%5D/date/%5Bkey%5D/page.tsx"
click node_date_display "https://github.com/rikkumahan/agentdate-/blob/main/components/ui.tsx"
click node_scene_art "https://github.com/rikkumahan/agentdate-/blob/main/components/scene.tsx"
click node_demo_data "https://github.com/rikkumahan/agentdate-/blob/main/public/demo.json"

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_entry,node_pipeline toneBlue
class node_scrape,node_profile,node_gender,node_shortlist,node_date toneAmber
class node_rank,node_dashboard,node_love_map,node_profile_page,node_date_page,node_date_display,node_scene_art,node_apify toneMint
class node_link_parser,node_run_store,node_raw_cleanup,node_llm,node_demo_data toneRose
class node_visitor toneIndigo
```

## Components

### Run workflow

- [Link entry](https://github.com/rikkumahan/agentdate-/blob/main/app/page.tsx): `app/page.tsx`
- [Run coordinator](https://github.com/rikkumahan/agentdate-/blob/main/lib/pipeline.ts): `lib/pipeline.ts`

### Agent services

- [Social scraping](https://github.com/rikkumahan/agentdate-/blob/main/app/api/scrape/route.ts): `app/api/scrape/route.ts`
- [Profile analysis](https://github.com/rikkumahan/agentdate-/blob/main/app/api/analyze/route.ts): `app/api/analyze/route.ts`
- [Gender classification](https://github.com/rikkumahan/agentdate-/blob/main/app/api/gender/route.ts): `app/api/gender/route.ts`
- [Agent shortlisting](https://github.com/rikkumahan/agentdate-/blob/main/app/api/shortlist/route.ts): `app/api/shortlist/route.ts`
- [Date simulation](https://github.com/rikkumahan/agentdate-/blob/main/app/api/date/route.ts): `app/api/date/route.ts`

### Results and views

- [Mutual ranking](https://github.com/rikkumahan/agentdate-/blob/main/lib/rank.ts): `lib/rank.ts`
- [Run dashboard](https://github.com/rikkumahan/agentdate-/blob/main/app/%5Brun%5D/page.tsx): `app/[run]/page.tsx`
- [Love map](https://github.com/rikkumahan/agentdate-/blob/main/components/lovemap.tsx): `components/lovemap.tsx`
- [Person profile](https://github.com/rikkumahan/agentdate-/blob/main/app/%5Brun%5D/p/%5Bpid%5D/page.tsx): `app/[run]/p/[pid]/page.tsx`
- [Date detail](https://github.com/rikkumahan/agentdate-/blob/main/app/%5Brun%5D/date/%5Bkey%5D/page.tsx): `app/[run]/date/[key]/page.tsx`
- [Date scene and transcript](https://github.com/rikkumahan/agentdate-/blob/main/components/ui.tsx): `components/ui.tsx`
- [Scene rendering](https://github.com/rikkumahan/agentdate-/blob/main/components/scene.tsx): `components/scene.tsx`

### Shared runtime

- [Link parser](https://github.com/rikkumahan/agentdate-/blob/main/lib/links.ts): `lib/links.ts`
- [Run store](https://github.com/rikkumahan/agentdate-/blob/main/lib/store.ts): `lib/store.ts`
- [Scrape matching and pruning](https://github.com/rikkumahan/agentdate-/blob/main/lib/prune.ts): `lib/prune.ts`
- [LLM runtime](https://github.com/rikkumahan/agentdate-/blob/main/lib/llm.ts): `lib/llm.ts`
- [Demo run data](https://github.com/rikkumahan/agentdate-/blob/main/public/demo.json): `public/demo.json`

### Other components

- **Visitor**
- **Apify**

## Connections

- Visitor → Link entry: submits links (evidence: `README.md`)
- Link entry → Link parser: parses links (evidence: `app/page.tsx`)
- Link entry → Run store: starts run (evidence: `app/page.tsx`)
- Link entry → Run coordinator: starts pipeline (evidence: `app/page.tsx`)
- Run coordinator → Run store: updates state (evidence: `lib/pipeline.ts`)
- Run coordinator → Social scraping: posts scrape (evidence: `README.md`)
- Run coordinator → Profile analysis: posts analysis (evidence: `lib/pipeline.ts`)
- Run coordinator → Gender classification: posts classification (evidence: `lib/pipeline.ts`)
- Run coordinator → Agent shortlisting: posts shortlist (evidence: `README.md`)
- Run coordinator → Date simulation: posts dates (evidence: `README.md`)
- Social scraping → Apify: runs actors (evidence: `app/api/scrape/route.ts`)
- Social scraping → Scrape matching and pruning: matches and prunes (evidence: `app/api/scrape/route.ts`)
- Profile analysis → LLM runtime: generates profile (evidence: `app/api/analyze/route.ts`)
- Gender classification → LLM runtime: classifies person (evidence: `app/api/gender/route.ts`)
- Agent shortlisting → LLM runtime: selects dates (evidence: `app/api/shortlist/route.ts`)
- Date simulation → LLM runtime: generates turns (evidence: `app/api/date/route.ts`)
- Date simulation → LLM runtime: scores date (evidence: `app/api/date/route.ts`)
- Run dashboard → Run store: loads run (evidence: `app/[run]/page.tsx`)
- Run dashboard → Run coordinator: controls run (evidence: `app/[run]/page.tsx`)
- Run dashboard → Mutual ranking: ranks dates (evidence: `app/[run]/page.tsx`)
- Run dashboard → Love map: renders map (evidence: `app/[run]/page.tsx`)
- Person profile → Run store: loads profile (evidence: `app/[run]/p/[pid]/page.tsx`)
- Person profile → Mutual ranking: shows ranking (evidence: `app/[run]/p/[pid]/page.tsx`)
- Date detail → Run store: loads date (evidence: `app/[run]/date/[key]/page.tsx`)
- Date detail → Date scene and transcript: renders date (evidence: `app/[run]/date/[key]/page.tsx`)
- Date scene and transcript → Scene rendering: renders scene (evidence: `components/ui.tsx`)
- Run store → Demo run data: loads demo (evidence: `lib/store.ts`)
