# yuruotong1/automate architecture

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

- Interactive diagram: https://gitdiagram.com/yuruotong1/automate
- Repository: https://github.com/yuruotong1/automate

## Overview

autoMate is a self-hosted AI tool hub: external AI clients use its MCP/HTTP interfaces to reach persistent personal-data tools and SaaS/local executors; its web chat can instead run an agent loop with a configured LLM. The graph preserves notes, files, search, memory, reminders/push, audio, executors, integrations, OAuth, and the browser extension. README documents capabilities beyond the sampled implementation; those branches use supported tree paths, with uncertain call wiring omitted.

Main entry points: [`automate/tools/registry.py`](https://github.com/yuruotong1/automate/blob/master/automate/tools/registry.py) (Tool registry), [`automate/server/app.py`](https://github.com/yuruotong1/automate/blob/master/automate/server/app.py) (FastAPI server), [`automate/store/db.py`](https://github.com/yuruotong1/automate/blob/master/automate/store/db.py) (SQLite store), [`automate/agent/loop.py`](https://github.com/yuruotong1/automate/blob/master/automate/agent/loop.py) (Agent loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_server["FastAPI server<br/>[app.py]"]
  node_mcp["MCP bridge<br/>[mcp_bridge.py]"]
  node_web_ui["Web SPA<br/>[app.js]"]
  node_agent_api["Agent API<br/>[agent.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_agent_loop["Agent loop<br/>[loop.py]"]
  node_providers["Provider manager<br/>[manager.py]"]
  node_tool_registry["Tool registry<br/>[registry.py]"]
end

subgraph group_personal["Personal data"]
  node_notes_memory["Notes and memory<br/>[notes.py]"]
  node_files["File vault<br/>[files.py]"]
  node_search["Hybrid search<br/>[search.py]"]
  node_reminders["Reminders<br/>[reminders.py]"]
  node_push["Web Push<br/>[push.py]"]
  node_audio["Transcription<br/>[audio.py]"]
  node_database[("SQLite store<br/>[db.py]")]
end

subgraph group_actions["Tools and integrations"]
  node_executors["Local executors"]
  node_integrations["SaaS connectors"]
  node_chrome_ext["Chrome extension<br/>[background.js]"]
end

subgraph group_connections["Connections"]
  node_oauth["OAuth flow<br/>[flow.py]"]
  node_oauth_broker["OAuth broker<br/>[main.py]"]
end

node_ai_clients(("AI clients"))
node_web_user(("Web user"))
node_llm{{"LLM providers"}}
node_external_services{{"External services"}}

node_ai_clients -->|"call tools"| node_mcp
node_mcp -->|"mounted in"| node_server
node_web_user -->|"use chat"| node_web_ui
node_web_ui -->|"HTTP requests"| node_server
node_server -->|"routes requests"| node_agent_api
node_agent_api -->|"run agent"| node_agent_loop
node_agent_loop -->|"select client"| node_providers
node_providers -->|"send prompts"| node_llm
node_agent_loop -->|"dispatch tools"| node_tool_registry
node_tool_registry -->|"invoke tools"| node_notes_memory
node_tool_registry -->|"invoke tools"| node_files
node_tool_registry -->|"invoke tool"| node_search
node_search -->|"query index"| node_database
node_tool_registry -->|"invoke tools"| node_reminders
node_reminders -->|"send notifications"| node_push
node_push -->|"Web Push"| node_external_services
node_tool_registry -->|"invoke tool"| node_audio
node_tool_registry -->|"dispatch tools"| node_executors
node_tool_registry -->|"dispatch tools"| node_integrations
node_integrations -->|"call APIs"| node_external_services
node_chrome_ext -.->|"browser control"| node_executors
node_server -->|"mount callback"| node_oauth
node_oauth -->|"store credentials"| node_database
node_oauth -.->|"broker flow"| node_oauth_broker
node_oauth_broker -->|"exchange tokens"| node_external_services
node_notes_memory -->|"persist data"| node_database
node_files -->|"store metadata"| node_database

click node_server "https://github.com/yuruotong1/automate/blob/master/automate/server/app.py"
click node_mcp "https://github.com/yuruotong1/automate/blob/master/automate/server/mcp_bridge.py"
click node_web_ui "https://github.com/yuruotong1/automate/blob/master/automate/frontend/app.js"
click node_agent_api "https://github.com/yuruotong1/automate/blob/master/automate/server/api/agent.py"
click node_agent_loop "https://github.com/yuruotong1/automate/blob/master/automate/agent/loop.py"
click node_providers "https://github.com/yuruotong1/automate/blob/master/automate/providers/manager.py"
click node_tool_registry "https://github.com/yuruotong1/automate/blob/master/automate/tools/registry.py"
click node_notes_memory "https://github.com/yuruotong1/automate/blob/master/automate/notes.py"
click node_files "https://github.com/yuruotong1/automate/blob/master/automate/files.py"
click node_search "https://github.com/yuruotong1/automate/blob/master/automate/tools/search.py"
click node_reminders "https://github.com/yuruotong1/automate/blob/master/automate/reminders.py"
click node_push "https://github.com/yuruotong1/automate/blob/master/automate/push.py"
click node_audio "https://github.com/yuruotong1/automate/blob/master/automate/audio.py"
click node_executors "https://github.com/yuruotong1/automate/tree/master/automate/tools"
click node_integrations "https://github.com/yuruotong1/automate/tree/master/automate/integrations"
click node_chrome_ext "https://github.com/yuruotong1/automate/blob/master/extension/background.js"
click node_oauth "https://github.com/yuruotong1/automate/blob/master/automate/oauth/flow.py"
click node_oauth_broker "https://github.com/yuruotong1/automate/blob/master/cloud/oauth_broker/main.py"
click node_database "https://github.com/yuruotong1/automate/blob/master/automate/store/db.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_server,node_mcp,node_web_ui,node_agent_api,node_ai_clients,node_web_user toneBlue
class node_agent_loop,node_providers,node_tool_registry toneAmber
class node_notes_memory,node_files,node_search,node_reminders,node_push,node_audio,node_database toneMint
class node_executors,node_integrations,node_chrome_ext toneRose
class node_oauth,node_oauth_broker,node_llm,node_external_services toneIndigo
```

## Components

### Entry points

- [FastAPI server](https://github.com/yuruotong1/automate/blob/master/automate/server/app.py): `automate/server/app.py`
- [MCP bridge](https://github.com/yuruotong1/automate/blob/master/automate/server/mcp_bridge.py): `automate/server/mcp_bridge.py`
- [Web SPA](https://github.com/yuruotong1/automate/blob/master/automate/frontend/app.js): `automate/frontend/app.js`
- [Agent API](https://github.com/yuruotong1/automate/blob/master/automate/server/api/agent.py): `automate/server/api/agent.py`

### Agent runtime

- [Agent loop](https://github.com/yuruotong1/automate/blob/master/automate/agent/loop.py): `automate/agent/loop.py`
- [Provider manager](https://github.com/yuruotong1/automate/blob/master/automate/providers/manager.py): `automate/providers/manager.py`
- [Tool registry](https://github.com/yuruotong1/automate/blob/master/automate/tools/registry.py): `automate/tools/registry.py`

### Personal data

- [Notes and memory](https://github.com/yuruotong1/automate/blob/master/automate/notes.py): `automate/notes.py`
- [File vault](https://github.com/yuruotong1/automate/blob/master/automate/files.py): `automate/files.py`
- [Hybrid search](https://github.com/yuruotong1/automate/blob/master/automate/tools/search.py): `automate/tools/search.py`
- [Reminders](https://github.com/yuruotong1/automate/blob/master/automate/reminders.py): `automate/reminders.py`
- [Web Push](https://github.com/yuruotong1/automate/blob/master/automate/push.py): `automate/push.py`
- [Transcription](https://github.com/yuruotong1/automate/blob/master/automate/audio.py): `automate/audio.py`
- [SQLite store](https://github.com/yuruotong1/automate/blob/master/automate/store/db.py): `automate/store/db.py`

### Tools and integrations

- [Local executors](https://github.com/yuruotong1/automate/tree/master/automate/tools): `automate/tools`
- [SaaS connectors](https://github.com/yuruotong1/automate/tree/master/automate/integrations): `automate/integrations`
- [Chrome extension](https://github.com/yuruotong1/automate/blob/master/extension/background.js): `extension/background.js`

### Connections

- [OAuth flow](https://github.com/yuruotong1/automate/blob/master/automate/oauth/flow.py): `automate/oauth/flow.py`
- [OAuth broker](https://github.com/yuruotong1/automate/blob/master/cloud/oauth_broker/main.py): `cloud/oauth_broker/main.py`

### Other components

- **AI clients**
- **Web user**
- **LLM providers**
- **External services**

## Connections

- AI clients → MCP bridge: call tools
- MCP bridge → FastAPI server: mounted in
- Web user → Web SPA: use chat
- Web SPA → FastAPI server: HTTP requests
- FastAPI server → Agent API: routes requests
- Agent API → Agent loop: run agent
- Agent loop → Provider manager: select client
- Provider manager → LLM providers: send prompts
- Agent loop → Tool registry: dispatch tools
- Tool registry → Notes and memory: invoke tools
- Tool registry → File vault: invoke tools
- Tool registry → Hybrid search: invoke tool
- Hybrid search → SQLite store: query index
- Tool registry → Reminders: invoke tools
- Reminders → Web Push: send notifications
- Web Push → External services: Web Push
- Tool registry → Transcription: invoke tool
- Tool registry → Local executors: dispatch tools
- Tool registry → SaaS connectors: dispatch tools
- SaaS connectors → External services: call APIs
- Chrome extension → Local executors: browser control
- FastAPI server → OAuth flow: mount callback
- OAuth flow → SQLite store: store credentials
- OAuth flow → OAuth broker: broker flow
- OAuth broker → External services: exchange tokens
- Notes and memory → SQLite store: persist data
- File vault → SQLite store: store metadata
