# venkatganeshreddy/cd_relay architecture

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

- Interactive diagram: https://gitdiagram.com/venkatganeshreddy/cd_relay
- Repository: https://github.com/venkatganeshreddy/cd_relay

## Overview

Relay is a role-aware department operating copilot: contributors submit daily work and leads manage goals, tasks, and worklogs; the workspace consolidates this activity into reports, recommendations, and planning drafts. Its React screens use a shared Supabase client for data and auth, while server-side agent graphs provide grounded AI workflows. The repository also exposes Relay data through MCP servers. The README documents these system boundaries and capabilities; some wiring and implementation details are unsampled, so those relationships are not expanded.

Main entry points: [`app.jsx`](https://github.com/venkatganeshreddy/cd_relay/blob/main/app.jsx) (App & Routing), [`agents/modal_app.py`](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/modal_app.py) (Agent HTTP Endpoints), [`agents/graphs/common.py`](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/common.py) (Shared Agent Runtime), [`supabase-client.js`](https://github.com/venkatganeshreddy/cd_relay/blob/main/supabase-client.js) (Data & Auth Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Department Workspace"]
  node_workspace_ui["App &amp; Routing<br/>[app.jsx]"]
  node_auth["Role Access<br/>[views-auth.jsx]"]
  node_submissions["Daily Reports<br/>[views-submit.jsx]"]
  node_operations["Tasks &amp; Escalations<br/>[views-ops.jsx]"]
  node_goals["Team Goals<br/>[views-goals.jsx]"]
  node_worklogs["Department Worklogs<br/>[views-worklogs.jsx]"]
  node_dashboard["Dashboard &amp; Roll-ups"]
  node_scribe_ui["Meeting Notes<br/>[views-relay.jsx]"]
  node_concierge["Concierge Q&amp;A<br/>[views-copilot.jsx]"]
  node_engram_ui["Engram Feedback<br/>[views-engram.jsx]"]
  node_farm["Agent Farm<br/>[views-farm.jsx]"]
  node_system_reference["Codex &amp; System Map"]
end

subgraph group_agents["AI Agent Workflows"]
  node_advisor["Advisor Recommendations<br/>[advisor.py]"]
  node_scribe["Scribe &amp; Dispatcher<br/>[scribe.py]"]
  node_rollup["Grounded Roll-ups<br/>[rollup.py]"]
  node_planner["Monthly Planner<br/>[planner.py]"]
  node_curator["Curator Memory<br/>[curator.py]"]
  node_sentry["Sentry Escalation<br/>[sentry.py]"]
end

subgraph group_runtime["Agent Runtime"]
  node_agent_api["Agent HTTP Endpoints<br/>[modal_app.py]"]
  node_shared_runtime["Shared Agent Runtime<br/>[common.py]"]
  node_llm["LLM &amp; REST Access<br/>[llm.py]"]
  node_schemas["Structured Output Schemas<br/>[schemas.py]"]
end

subgraph group_integrations["Data &amp; Integrations"]
  node_supabase_client["Data &amp; Auth Client<br/>[supabase-client.js]"]
  node_supabase[("Supabase Store &amp; Auth")]
  node_mcp_tools["MCP Read Tools<br/>[tools.mjs]"]
  node_mcp_local["Local MCP Server<br/>[server.mjs]"]
  node_mcp_oauth["OAuth MCP Server<br/>[oauth-server.mjs]"]
end

node_contributor(("Contributor / Lead"))
node_claude(("Claude MCP Client"))
node_model_service{{"OpenRouter Models"}}

node_contributor -->|"uses"| node_workspace_ui
node_workspace_ui -->|"routes to"| node_auth
node_workspace_ui -->|"loads screens"| node_submissions
node_workspace_ui -->|"loads screens"| node_operations
node_workspace_ui -->|"loads screens"| node_goals
node_workspace_ui -->|"loads screens"| node_worklogs
node_workspace_ui -->|"loads screens"| node_dashboard
node_workspace_ui -->|"loads screens"| node_scribe_ui
node_workspace_ui -->|"loads screens"| node_concierge
node_workspace_ui -->|"loads screens"| node_engram_ui
node_workspace_ui -->|"loads screens"| node_farm
node_workspace_ui -->|"loads screens"| node_system_reference
node_auth -->|"uses"| node_supabase_client
node_submissions -->|"persists reports"| node_supabase_client
node_operations -->|"reads and writes"| node_supabase_client
node_goals -->|"persists goals"| node_supabase_client
node_worklogs -->|"reads worklogs"| node_supabase_client
node_dashboard -->|"reads reports"| node_supabase_client
node_supabase_client -->|"queries and writes"| node_supabase
node_contributor -->|"requests agent work"| node_agent_api
node_agent_api -->|"dispatches to"| node_advisor
node_agent_api -->|"dispatches to"| node_scribe
node_agent_api -->|"dispatches to"| node_rollup
node_agent_api -->|"dispatches to"| node_planner
node_agent_api -->|"dispatches to"| node_curator
node_agent_api -->|"dispatches to"| node_sentry
node_advisor -->|"calls"| node_shared_runtime
node_scribe -->|"calls"| node_shared_runtime
node_rollup -->|"calls"| node_shared_runtime
node_planner -->|"calls"| node_shared_runtime
node_curator -->|"calls"| node_shared_runtime
node_sentry -->|"uses"| node_shared_runtime
node_shared_runtime -->|"calls"| node_llm
node_shared_runtime -->|"validates outputs"| node_schemas
node_llm -->|"sends prompts"| node_model_service
node_llm -->|"reads and writes"| node_supabase
node_mcp_local -->|"registers tools"| node_mcp_tools
node_mcp_oauth -->|"uses tools"| node_mcp_tools
node_claude -->|"queries"| node_mcp_local
node_claude -->|"connects"| node_mcp_oauth
node_mcp_tools -->|"queries Relay data"| node_supabase
node_engram_ui -.->|"feeds corrections"| node_curator
node_concierge -.->|"forwards questions"| node_agent_api

click node_workspace_ui "https://github.com/venkatganeshreddy/cd_relay/blob/main/app.jsx"
click node_auth "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-auth.jsx"
click node_submissions "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-submit.jsx"
click node_operations "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-ops.jsx"
click node_goals "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-goals.jsx"
click node_worklogs "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-worklogs.jsx"
click node_dashboard "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-dashboard.jsx"
click node_scribe_ui "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-relay.jsx"
click node_concierge "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-copilot.jsx"
click node_engram_ui "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-engram.jsx"
click node_farm "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-farm.jsx"
click node_system_reference "https://github.com/venkatganeshreddy/cd_relay/blob/main/views-architecture.jsx"
click node_supabase_client "https://github.com/venkatganeshreddy/cd_relay/blob/main/supabase-client.js"
click node_agent_api "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/modal_app.py"
click node_shared_runtime "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/common.py"
click node_llm "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/llm.py"
click node_schemas "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/schemas.py"
click node_advisor "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/advisor.py"
click node_scribe "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/scribe.py"
click node_rollup "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/rollup.py"
click node_planner "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/planner.py"
click node_curator "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/curator.py"
click node_sentry "https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/sentry.py"
click node_mcp_tools "https://github.com/venkatganeshreddy/cd_relay/blob/main/mcp/tools.mjs"
click node_mcp_local "https://github.com/venkatganeshreddy/cd_relay/blob/main/mcp/server.mjs"
click node_mcp_oauth "https://github.com/venkatganeshreddy/cd_relay/blob/main/mcp/oauth-server.mjs"

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_workspace_ui,node_auth,node_submissions,node_operations,node_goals,node_worklogs,node_dashboard,node_scribe_ui,node_concierge,node_engram_ui,node_farm,node_system_reference,node_claude toneBlue
class node_advisor,node_scribe,node_rollup,node_planner,node_curator,node_sentry toneAmber
class node_agent_api,node_shared_runtime,node_llm,node_schemas,node_model_service toneMint
class node_supabase_client,node_supabase,node_mcp_tools,node_mcp_local,node_mcp_oauth toneRose
class node_contributor toneIndigo
```

## Components

### Department Workspace

- [App & Routing](https://github.com/venkatganeshreddy/cd_relay/blob/main/app.jsx): `app.jsx`
- [Role Access](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-auth.jsx): `views-auth.jsx`
- [Daily Reports](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-submit.jsx): `views-submit.jsx`
- [Tasks & Escalations](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-ops.jsx): `views-ops.jsx`
- [Team Goals](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-goals.jsx): `views-goals.jsx`
- [Department Worklogs](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-worklogs.jsx): `views-worklogs.jsx`
- [Dashboard & Roll-ups](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-dashboard.jsx): `views-dashboard.jsx`
- [Meeting Notes](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-relay.jsx): `views-relay.jsx`
- [Concierge Q&A](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-copilot.jsx): `views-copilot.jsx`
- [Engram Feedback](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-engram.jsx): `views-engram.jsx`
- [Agent Farm](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-farm.jsx): `views-farm.jsx`
- [Codex & System Map](https://github.com/venkatganeshreddy/cd_relay/blob/main/views-architecture.jsx): `views-architecture.jsx`

### AI Agent Workflows

- [Advisor Recommendations](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/advisor.py): `agents/graphs/advisor.py`
- [Scribe & Dispatcher](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/scribe.py): `agents/graphs/scribe.py`
- [Grounded Roll-ups](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/rollup.py): `agents/graphs/rollup.py`
- [Monthly Planner](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/planner.py): `agents/graphs/planner.py`
- [Curator Memory](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/curator.py): `agents/graphs/curator.py`
- [Sentry Escalation](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/sentry.py): `agents/graphs/sentry.py`

### Agent Runtime

- [Agent HTTP Endpoints](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/modal_app.py): `agents/modal_app.py`
- [Shared Agent Runtime](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/common.py): `agents/graphs/common.py`
- [LLM & REST Access](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/llm.py): `agents/llm.py`
- [Structured Output Schemas](https://github.com/venkatganeshreddy/cd_relay/blob/main/agents/graphs/schemas.py): `agents/graphs/schemas.py`

### Data & Integrations

- [Data & Auth Client](https://github.com/venkatganeshreddy/cd_relay/blob/main/supabase-client.js): `supabase-client.js`
- **Supabase Store & Auth**
- [MCP Read Tools](https://github.com/venkatganeshreddy/cd_relay/blob/main/mcp/tools.mjs): `mcp/tools.mjs`
- [Local MCP Server](https://github.com/venkatganeshreddy/cd_relay/blob/main/mcp/server.mjs): `mcp/server.mjs`
- [OAuth MCP Server](https://github.com/venkatganeshreddy/cd_relay/blob/main/mcp/oauth-server.mjs): `mcp/oauth-server.mjs`

### Other components

- **Contributor / Lead**
- **Claude MCP Client**
- **OpenRouter Models**

## Connections

- Contributor / Lead → App & Routing: uses (evidence: `README.md`)
- App & Routing → Role Access: routes to (evidence: `README.md`)
- App & Routing → Daily Reports: loads screens (evidence: `README.md`)
- App & Routing → Tasks & Escalations: loads screens (evidence: `README.md`)
- App & Routing → Team Goals: loads screens (evidence: `README.md`)
- App & Routing → Department Worklogs: loads screens (evidence: `README.md`)
- App & Routing → Dashboard & Roll-ups: loads screens (evidence: `README.md`)
- App & Routing → Meeting Notes: loads screens (evidence: `README.md`)
- App & Routing → Concierge Q&A: loads screens (evidence: `README.md`)
- App & Routing → Engram Feedback: loads screens (evidence: `README.md`)
- App & Routing → Agent Farm: loads screens (evidence: `README.md`)
- App & Routing → Codex & System Map: loads screens (evidence: `README.md`)
- Role Access → Data & Auth Client: uses (evidence: `README.md`)
- Daily Reports → Data & Auth Client: persists reports (evidence: `README.md`)
- Tasks & Escalations → Data & Auth Client: reads and writes (evidence: `README.md`)
- Team Goals → Data & Auth Client: persists goals (evidence: `README.md`)
- Department Worklogs → Data & Auth Client: reads worklogs (evidence: `README.md`)
- Dashboard & Roll-ups → Data & Auth Client: reads reports (evidence: `README.md`)
- Data & Auth Client → Supabase Store & Auth: queries and writes (evidence: `README.md`)
- Contributor / Lead → Agent HTTP Endpoints: requests agent work (evidence: `README.md`)
- Agent HTTP Endpoints → Advisor Recommendations: dispatches to (evidence: `agents/modal_app.py`)
- Agent HTTP Endpoints → Scribe & Dispatcher: dispatches to (evidence: `agents/modal_app.py`)
- Agent HTTP Endpoints → Grounded Roll-ups: dispatches to (evidence: `agents/modal_app.py`)
- Agent HTTP Endpoints → Monthly Planner: dispatches to (evidence: `agents/modal_app.py`)
- Agent HTTP Endpoints → Curator Memory: dispatches to (evidence: `agents/modal_app.py`)
- Agent HTTP Endpoints → Sentry Escalation: dispatches to (evidence: `agents/modal_app.py`)
- Advisor Recommendations → Shared Agent Runtime: calls (evidence: `agents/graphs/advisor.py`)
- Scribe & Dispatcher → Shared Agent Runtime: calls (evidence: `agents/graphs/scribe.py`)
- Grounded Roll-ups → Shared Agent Runtime: calls (evidence: `agents/graphs/rollup.py`)
- Monthly Planner → Shared Agent Runtime: calls (evidence: `agents/graphs/planner.py`)
- Curator Memory → Shared Agent Runtime: calls (evidence: `agents/graphs/curator.py`)
- Sentry Escalation → Shared Agent Runtime: uses (evidence: `agents/graphs/sentry.py`)
- Shared Agent Runtime → LLM & REST Access: calls (evidence: `agents/graphs/common.py`)
- Shared Agent Runtime → Structured Output Schemas: validates outputs (evidence: `agents/graphs/common.py`)
- LLM & REST Access → OpenRouter Models: sends prompts (evidence: `agents/llm.py`)
- LLM & REST Access → Supabase Store & Auth: reads and writes (evidence: `agents/llm.py`)
- Local MCP Server → MCP Read Tools: registers tools (evidence: `mcp/server.mjs`)
- OAuth MCP Server → MCP Read Tools: uses tools (evidence: `mcp/oauth-server.mjs`)
- Claude MCP Client → Local MCP Server: queries (evidence: `README.md`)
- Claude MCP Client → OAuth MCP Server: connects (evidence: `README.md`)
- MCP Read Tools → Supabase Store & Auth: queries Relay data (evidence: `mcp/tools.mjs`)
- Engram Feedback → Curator Memory: feeds corrections
- Concierge Q&A → Agent HTTP Endpoints: forwards questions
