# jay2323-tech/relaymind architecture

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

- Interactive diagram: https://gitdiagram.com/jay2323-tech/relaymind
- Repository: https://github.com/jay2323-tech/relaymind

## Overview

RelayMind is an agent-memory and coordination application: users work in a development workspace, while backend run endpoints can invoke a Planner–Reviewer engine that persists evidence-backed handoffs and reviews. A separate platform surface manages decisions, tasks, and proposed actions. The README says frontend/API integration and real identity and task approval are still pending, so the UI-to-backend relationship is shown as an intended, not completed, connection. Several backend relationships are supported by the source index rather than full excerpts; uncertain links are omitted.

Main entry points: [`backend/src/relaymind/agents/engine.py`](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/agents/engine.py) (Planner–Reviewer engine), [`frontend/src/App.tsx`](https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/App.tsx) (Workspace app), [`backend/src/relaymind/graph/access.py`](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/graph/access.py) (Graph access), [`backend/src/relaymind/main.py`](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/main.py) (API application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace UI"]
  node_app["Workspace app<br/>[App.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_conversation_ui["Chat and history<br/>[conversation.tsx]"]
  node_track_ui["Run track<br/>[RelayTrack.tsx]"]
  node_inspector_ui["Evidence and actions<br/>[inspector.tsx]"]
end

subgraph group_api["Backend API"]
  node_backend_app["API application<br/>[main.py]"]
  node_run_api["Session and run API<br/>[runs.py]"]
  node_platform_api["Platform API<br/>[platform.py]"]
end

subgraph group_engine["Agent coordination"]
  node_engine["Planner–Reviewer engine<br/>[engine.py]"]
  node_agent_loop["Agent loop and providers<br/>[loop.py]"]
  node_platform_bridge["Platform bridge<br/>[bridge.py]"]
end

subgraph group_memory["Graph memory"]
  node_artifact_memory[("Run artifacts<br/>[artifacts.py]")]
  node_conversation_memory[("Conversation memory<br/>[conversations.py]")]
  node_decision_memory[("Decisions and sources<br/>[decisions.py]")]
  node_episode_memory[("Sourced episodes<br/>[episodes.py]")]
  node_procedure_memory[("Procedure versions<br/>[procedures.py]")]
  node_task_memory[("Tasks and versions<br/>[tasks.py]")]
  node_action_service["Approved task actions<br/>[actions.py]"]
  node_graph_access["Graph access<br/>[access.py]"]
  node_graph_db[("FalkorDB graph<br/>[connection.py]")]
end

node_user(("Workspace user"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_conversation_ui
node_app -->|"renders"| node_track_ui
node_app -->|"renders"| node_inspector_ui
node_app -->|"requests"| node_api_client
node_api_client -.->|"calls API"| node_backend_app
node_backend_app -->|"mounts"| node_run_api
node_backend_app -->|"mounts"| node_platform_api
node_run_api -->|"dispatches runs"| node_engine
node_engine -->|"runs agents"| node_agent_loop
node_engine -->|"reads platform state"| node_platform_bridge
node_engine -->|"persists artifacts"| node_artifact_memory
node_engine -->|"reads conversation"| node_conversation_memory
node_engine -->|"reads episodes"| node_episode_memory
node_engine -->|"reads procedures"| node_procedure_memory
node_platform_bridge -->|"loads decisions"| node_decision_memory
node_platform_bridge -->|"loads task state"| node_task_memory
node_platform_api -->|"handles actions"| node_action_service
node_action_service -->|"updates task versions"| node_task_memory
node_decision_memory -->|"authorizes graph access"| node_graph_access
node_task_memory -->|"authorizes graph access"| node_graph_access
node_conversation_memory -->|"authorizes graph access"| node_graph_access
node_graph_access -->|"selects graph"| node_graph_db

click node_app "https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/api/client.ts"
click node_conversation_ui "https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/ui/conversation.tsx"
click node_track_ui "https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/ui/track/RelayTrack.tsx"
click node_inspector_ui "https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/ui/inspector.tsx"
click node_backend_app "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/main.py"
click node_run_api "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/api/runs.py"
click node_platform_api "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/api/platform.py"
click node_engine "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/agents/engine.py"
click node_agent_loop "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/agents/loop.py"
click node_platform_bridge "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/platform/bridge.py"
click node_artifact_memory "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/artifacts.py"
click node_conversation_memory "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/conversations.py"
click node_decision_memory "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/decisions.py"
click node_episode_memory "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/episodes.py"
click node_procedure_memory "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/procedures.py"
click node_task_memory "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/tasks.py"
click node_action_service "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/services/actions.py"
click node_graph_access "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/graph/access.py"
click node_graph_db "https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/graph/connection.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_api_client,node_conversation_ui,node_track_ui,node_inspector_ui,node_user toneBlue
class node_backend_app,node_run_api,node_platform_api toneAmber
class node_engine,node_agent_loop,node_platform_bridge toneMint
class node_artifact_memory,node_conversation_memory,node_decision_memory,node_episode_memory,node_procedure_memory,node_task_memory,node_action_service,node_graph_access,node_graph_db toneRose
```

## Components

### Workspace UI

- [Workspace app](https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Chat and history](https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/ui/conversation.tsx): `frontend/src/ui/conversation.tsx`
- [Run track](https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/ui/track/RelayTrack.tsx): `frontend/src/ui/track/RelayTrack.tsx`
- [Evidence and actions](https://github.com/jay2323-tech/relaymind/blob/main/frontend/src/ui/inspector.tsx): `frontend/src/ui/inspector.tsx`

### Backend API

- [API application](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/main.py): `backend/src/relaymind/main.py`
- [Session and run API](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/api/runs.py): `backend/src/relaymind/api/runs.py`
- [Platform API](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/api/platform.py): `backend/src/relaymind/api/platform.py`

### Agent coordination

- [Planner–Reviewer engine](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/agents/engine.py): `backend/src/relaymind/agents/engine.py`
- [Agent loop and providers](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/agents/loop.py): `backend/src/relaymind/agents/loop.py`
- [Platform bridge](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/platform/bridge.py): `backend/src/relaymind/platform/bridge.py`

### Graph memory

- [Run artifacts](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/artifacts.py): `backend/src/relaymind/memory/artifacts.py`
- [Conversation memory](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/conversations.py): `backend/src/relaymind/memory/conversations.py`
- [Decisions and sources](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/decisions.py): `backend/src/relaymind/memory/decisions.py`
- [Sourced episodes](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/episodes.py): `backend/src/relaymind/memory/episodes.py`
- [Procedure versions](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/procedures.py): `backend/src/relaymind/memory/procedures.py`
- [Tasks and versions](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/memory/tasks.py): `backend/src/relaymind/memory/tasks.py`
- [Approved task actions](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/services/actions.py): `backend/src/relaymind/services/actions.py`
- [Graph access](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/graph/access.py): `backend/src/relaymind/graph/access.py`
- [FalkorDB graph](https://github.com/jay2323-tech/relaymind/blob/main/backend/src/relaymind/graph/connection.py): `backend/src/relaymind/graph/connection.py`

### Other components

- **Workspace user**

## Connections

- Workspace user → Workspace app: uses (evidence: `README.md`)
- Workspace app → Chat and history: renders (evidence: `frontend/src/App.tsx`)
- Workspace app → Run track: renders (evidence: `frontend/src/App.tsx`)
- Workspace app → Evidence and actions: renders (evidence: `frontend/src/App.tsx`)
- Workspace app → API client: requests (evidence: `frontend/src/App.tsx`)
- API client → API application: calls API (evidence: `README.md`)
- API application → Session and run API: mounts (evidence: `backend/src/relaymind/main.py`)
- API application → Platform API: mounts (evidence: `backend/src/relaymind/main.py`)
- Session and run API → Planner–Reviewer engine: dispatches runs (evidence: `backend/src/relaymind/api/runs.py`)
- Planner–Reviewer engine → Agent loop and providers: runs agents (evidence: `backend/src/relaymind/agents/engine.py`)
- Planner–Reviewer engine → Platform bridge: reads platform state (evidence: `backend/src/relaymind/agents/engine.py`)
- Planner–Reviewer engine → Run artifacts: persists artifacts (evidence: `backend/src/relaymind/agents/engine.py`)
- Planner–Reviewer engine → Conversation memory: reads conversation (evidence: `backend/src/relaymind/agents/engine.py`)
- Planner–Reviewer engine → Sourced episodes: reads episodes (evidence: `backend/src/relaymind/agents/engine.py`)
- Planner–Reviewer engine → Procedure versions: reads procedures (evidence: `backend/src/relaymind/agents/engine.py`)
- Platform bridge → Decisions and sources: loads decisions (evidence: `backend/src/relaymind/platform/bridge.py`)
- Platform bridge → Tasks and versions: loads task state (evidence: `backend/src/relaymind/platform/bridge.py`)
- Platform API → Approved task actions: handles actions (evidence: `backend/src/relaymind/api/platform.py`)
- Approved task actions → Tasks and versions: updates task versions (evidence: `backend/src/relaymind/services/actions.py`)
- Decisions and sources → Graph access: authorizes graph access (evidence: `backend/src/relaymind/memory/decisions.py`)
- Tasks and versions → Graph access: authorizes graph access (evidence: `backend/src/relaymind/memory/tasks.py`)
- Conversation memory → Graph access: authorizes graph access (evidence: `backend/src/relaymind/memory/conversations.py`)
- Graph access → FalkorDB graph: selects graph (evidence: `backend/src/relaymind/graph/access.py`)
