# trentongage11/remote-ai-access architecture

> Architecture diagram of the GitHub repository trentongage11/remote-ai-access, 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/trentongage11/remote-ai-access
- Repository: https://github.com/trentongage11/remote-ai-access

## Overview

Remote AI Access is a hosted multi-provider AI web app: users chat through a browser or SDK, with server-held provider credentials and optional agent tools. The server also exposes workspace file/search and code-map operations, snapshots, sharing, archive, audit/activity, and review/subagent capabilities. README documents these branches, but excerpts show only selected server calls and storage boundaries; edges are limited to those visible in excerpts or stated explicitly in the README.

Main entry points: [`src/server.js`](https://github.com/trentongage11/remote-ai-access/blob/main/src/server.js) (HTTP API), [`public/app.js`](https://github.com/trentongage11/remote-ai-access/blob/main/public/app.js) (Chat UI), [`src/chat-job-queue.js`](https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-job-queue.js) (Chat Job Queue), [`python-sdk/remote_ai_access/client.py`](https://github.com/trentongage11/remote-ai-access/blob/main/python-sdk/remote_ai_access/client.py) (Python SDK)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User Clients"]
  node_web["Chat UI<br/>[app.js]"]
  node_provider_ui["Provider Selection"]
  node_sdk["Python SDK<br/>[client.py]"]
  node_async_sdk["Async SDK<br/>[async_client.py]"]
end

subgraph group_runtime["Chat Runtime"]
  node_server["HTTP API<br/>[server.js]"]
  node_context["Chat Context<br/>[chat-context.js]"]
  node_provider_config["Provider Config<br/>[provider-config.js]"]
  node_provider_retry["Provider Retry<br/>[provider-retry.js]"]
  node_provider_services{{"AI Providers"}}
  node_chat_jobs["Chat Job Queue<br/>[chat-job-queue.js]"]
  node_job_store[("Job Persistence")]
end

subgraph group_workspace["Workspace Tools"]
  node_file_lab["File Lab<br/>[filelab.js]"]
  node_search["Workspace Search"]
  node_code_map["Code Map<br/>[code-map.js]"]
  node_snapshots["Git Snapshots"]
  node_share["File Sharing<br/>[server.js]"]
end

subgraph group_oversight["History and Oversight"]
  node_archive[("Chat Archive")]
  node_audit["Audit Log<br/>[audit.js]"]
  node_activity["Activity Timeline"]
end

subgraph group_agents["Agent Workflows"]
  node_recipe[("Recipe Schedules")]
  node_subagents["Subagent Policies<br/>[subagent-policy.js]"]
  node_subagent_results["Subagent Results"]
  node_review["Review Workflow<br/>[review-workflow.js]"]
  node_tdd["TDD Workflow<br/>[tdd-workflow.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_web
node_web -->|"selects models"| node_provider_ui
node_web -.->|"sends chat requests"| node_server
node_sdk -->|"calls API"| node_server
node_async_sdk -->|"calls API"| node_server
node_server -->|"resolves context"| node_context
node_server -->|"resolves credentials"| node_provider_config
node_server -->|"retries requests"| node_provider_retry
node_server -->|"proxies inference"| node_provider_services
node_server -.->|"dispatches jobs"| node_chat_jobs
node_chat_jobs -.->|"persists jobs"| node_job_store
node_user -->|"edits workspace"| node_file_lab
node_server -->|"searches workspace"| node_search
node_server -.->|"serves index"| node_code_map
node_server -.->|"tracks file changes"| node_snapshots
node_server -.->|"serves shares"| node_share
node_server -.->|"stores archive"| node_archive
node_user -->|"reviews operations"| node_audit
node_server -.->|"aggregates events"| node_activity
node_server -.->|"schedules recipes"| node_recipe
node_server -.->|"applies policies"| node_subagents
node_server -.->|"records results"| node_subagent_results
node_server -.->|"supports review"| node_review
node_server -.->|"supports coding"| node_tdd

click node_web "https://github.com/trentongage11/remote-ai-access/blob/main/public/app.js"
click node_provider_ui "https://github.com/trentongage11/remote-ai-access/blob/main/public/provider-selection.js"
click node_sdk "https://github.com/trentongage11/remote-ai-access/blob/main/python-sdk/remote_ai_access/client.py"
click node_async_sdk "https://github.com/trentongage11/remote-ai-access/blob/main/python-sdk/remote_ai_access/async_client.py"
click node_server "https://github.com/trentongage11/remote-ai-access/blob/main/src/server.js"
click node_context "https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-context.js"
click node_provider_config "https://github.com/trentongage11/remote-ai-access/blob/main/src/provider-config.js"
click node_provider_retry "https://github.com/trentongage11/remote-ai-access/blob/main/src/provider-retry.js"
click node_chat_jobs "https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-job-queue.js"
click node_job_store "https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-job-persistence.js"
click node_file_lab "https://github.com/trentongage11/remote-ai-access/blob/main/public/filelab.js"
click node_search "https://github.com/trentongage11/remote-ai-access/blob/main/src/workspace-search.js"
click node_code_map "https://github.com/trentongage11/remote-ai-access/blob/main/src/code-map.js"
click node_snapshots "https://github.com/trentongage11/remote-ai-access/blob/main/src/git-change-center.js"
click node_share "https://github.com/trentongage11/remote-ai-access/blob/main/src/server.js"
click node_archive "https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-archive-store.js"
click node_audit "https://github.com/trentongage11/remote-ai-access/blob/main/public/audit.js"
click node_activity "https://github.com/trentongage11/remote-ai-access/blob/main/src/workspace-activity.js"
click node_recipe "https://github.com/trentongage11/remote-ai-access/blob/main/src/agent-recipe-schedule.js"
click node_subagents "https://github.com/trentongage11/remote-ai-access/blob/main/src/subagent-policy.js"
click node_subagent_results "https://github.com/trentongage11/remote-ai-access/blob/main/src/subagent-results.js"
click node_review "https://github.com/trentongage11/remote-ai-access/blob/main/src/review-workflow.js"
click node_tdd "https://github.com/trentongage11/remote-ai-access/blob/main/src/tdd-workflow.js"

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_web,node_provider_ui,node_sdk,node_async_sdk,node_user toneBlue
class node_server,node_context,node_provider_config,node_provider_retry,node_provider_services,node_chat_jobs,node_job_store toneAmber
class node_file_lab,node_search,node_code_map,node_snapshots,node_share toneMint
class node_archive,node_audit,node_activity toneRose
class node_recipe,node_subagents,node_subagent_results,node_review,node_tdd toneIndigo
```

## Components

### User Clients

- [Chat UI](https://github.com/trentongage11/remote-ai-access/blob/main/public/app.js): `public/app.js`
- [Provider Selection](https://github.com/trentongage11/remote-ai-access/blob/main/public/provider-selection.js): `public/provider-selection.js`
- [Python SDK](https://github.com/trentongage11/remote-ai-access/blob/main/python-sdk/remote_ai_access/client.py): `python-sdk/remote_ai_access/client.py`
- [Async SDK](https://github.com/trentongage11/remote-ai-access/blob/main/python-sdk/remote_ai_access/async_client.py): `python-sdk/remote_ai_access/async_client.py`

### Chat Runtime

- [HTTP API](https://github.com/trentongage11/remote-ai-access/blob/main/src/server.js): `src/server.js`
- [Chat Context](https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-context.js): `src/chat-context.js`
- [Provider Config](https://github.com/trentongage11/remote-ai-access/blob/main/src/provider-config.js): `src/provider-config.js`
- [Provider Retry](https://github.com/trentongage11/remote-ai-access/blob/main/src/provider-retry.js): `src/provider-retry.js`
- **AI Providers**
- [Chat Job Queue](https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-job-queue.js): `src/chat-job-queue.js`
- [Job Persistence](https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-job-persistence.js): `src/chat-job-persistence.js`

### Workspace Tools

- [File Lab](https://github.com/trentongage11/remote-ai-access/blob/main/public/filelab.js): `public/filelab.js`
- [Workspace Search](https://github.com/trentongage11/remote-ai-access/blob/main/src/workspace-search.js): `src/workspace-search.js`
- [Code Map](https://github.com/trentongage11/remote-ai-access/blob/main/src/code-map.js): `src/code-map.js`
- [Git Snapshots](https://github.com/trentongage11/remote-ai-access/blob/main/src/git-change-center.js): `src/git-change-center.js`
- [File Sharing](https://github.com/trentongage11/remote-ai-access/blob/main/src/server.js): `src/server.js`

### History and Oversight

- [Chat Archive](https://github.com/trentongage11/remote-ai-access/blob/main/src/chat-archive-store.js): `src/chat-archive-store.js`
- [Audit Log](https://github.com/trentongage11/remote-ai-access/blob/main/public/audit.js): `public/audit.js`
- [Activity Timeline](https://github.com/trentongage11/remote-ai-access/blob/main/src/workspace-activity.js): `src/workspace-activity.js`

### Agent Workflows

- [Recipe Schedules](https://github.com/trentongage11/remote-ai-access/blob/main/src/agent-recipe-schedule.js): `src/agent-recipe-schedule.js`
- [Subagent Policies](https://github.com/trentongage11/remote-ai-access/blob/main/src/subagent-policy.js): `src/subagent-policy.js`
- [Subagent Results](https://github.com/trentongage11/remote-ai-access/blob/main/src/subagent-results.js): `src/subagent-results.js`
- [Review Workflow](https://github.com/trentongage11/remote-ai-access/blob/main/src/review-workflow.js): `src/review-workflow.js`
- [TDD Workflow](https://github.com/trentongage11/remote-ai-access/blob/main/src/tdd-workflow.js): `src/tdd-workflow.js`

### Other components

- **User**

## Connections

- User → Chat UI: uses (evidence: `README.md`)
- Chat UI → Provider Selection: selects models (evidence: `public/app.js`)
- Chat UI → HTTP API: sends chat requests
- Python SDK → HTTP API: calls API (evidence: `python-sdk/remote_ai_access/client.py`)
- Async SDK → HTTP API: calls API (evidence: `python-sdk/remote_ai_access/async_client.py`)
- HTTP API → Chat Context: resolves context (evidence: `src/server.js`)
- HTTP API → Provider Config: resolves credentials (evidence: `src/server.js`)
- HTTP API → Provider Retry: retries requests (evidence: `src/server.js`)
- HTTP API → AI Providers: proxies inference (evidence: `README.md`)
- HTTP API → Chat Job Queue: dispatches jobs (evidence: `src/server.js`)
- Chat Job Queue → Job Persistence: persists jobs
- User → File Lab: edits workspace (evidence: `README.md`)
- HTTP API → Workspace Search: searches workspace (evidence: `src/server.js`)
- HTTP API → Code Map: serves index (evidence: `src/server.js`)
- HTTP API → Git Snapshots: tracks file changes (evidence: `src/server.js`)
- HTTP API → File Sharing: serves shares (evidence: `src/server.js`)
- HTTP API → Chat Archive: stores archive (evidence: `src/server.js`)
- User → Audit Log: reviews operations (evidence: `README.md`)
- HTTP API → Activity Timeline: aggregates events (evidence: `src/server.js`)
- HTTP API → Recipe Schedules: schedules recipes (evidence: `src/server.js`)
- HTTP API → Subagent Policies: applies policies (evidence: `src/server.js`)
- HTTP API → Subagent Results: records results (evidence: `src/server.js`)
- HTTP API → Review Workflow: supports review (evidence: `src/server.js`)
- HTTP API → TDD Workflow: supports coding (evidence: `src/server.js`)
