# gust-feng/synech architecture

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

- Interactive diagram: https://gitdiagram.com/gust-feng/synech
- Repository: https://github.com/gust-feng/synech

## Overview

Synech is a local-first agent workspace. A user submits a conversation or attaches context in the panel; the server coordinates an ordinary-agent run, which uses model and tool capabilities, then exposes activity and results back to the panel. Separate product branches manage spaces and references, memory, and configuration/integrations. The sampled code confirms preview, context, memory, storage, and MCP behavior; some run orchestration and UI-to-server wiring are inferred from module names and package metadata, not inspected source.

Main entry points: [`src/app/panel-server/index.ts`](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/index.ts) (Panel server), [`src/app/panel-server/ordinary/ordinary-routes.ts`](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/ordinary/ordinary-routes.ts) (Conversation routes), [`src/app/panel-ui/src/App.tsx`](https://github.com/gust-feng/synech/blob/main/src/app/panel-ui/src/App.tsx) (Workbench UI), [`src/app/ordinary-agent/ordinary-agent-feature.ts`](https://github.com/gust-feng/synech/blob/main/src/app/ordinary-agent/ordinary-agent-feature.ts) (Agent coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_panel["Panel experience"]
  node_panelui["Workbench UI<br/>[App.tsx]"]
  node_uiapi["Panel API client<br/>[api.ts]"]
  node_server["Panel server<br/>[index.ts]"]
end

subgraph group_agent["Agent runtime"]
  node_ordinaryroutes["Conversation routes<br/>[ordinary-routes.ts]"]
  node_ordinaryfeature["Agent coordinator"]
  node_turnapp["Turn application"]
  node_agentloop["Agent session loop"]
  node_modelruntime["Model runtime<br/>[agent-loop.ts]"]
  node_capabilities["Tool capabilities"]
  node_sessions["Session repository"]
end

subgraph group_workspace["Workspace content"]
  node_context["Context attachments<br/>[context-routes.ts]"]
  node_spaces["Spaces and references<br/>[space-routes.ts]"]
  node_previewclient["Reference preview client"]
end

subgraph group_memory["Memory"]
  node_memoryroutes["Memory routes<br/>[routes-memory.ts]"]
  node_agentmemory["Agent memory routes"]
  node_memoryfeature["Memory feature<br/>[memory-feature.ts]"]
end

subgraph group_platform["Configuration and integrations"]
  node_mcpmanager["MCP manager<br/>[mcp-manager.ts]"]
  node_config["Configuration center<br/>[index.ts]"]
  node_storage["Panel storage<br/>[panel-storage.ts]"]
  node_database[("SQLite runtime database")]
end

node_user(("User"))
node_provider(("Model provider"))
node_mcpservice{{"MCP servers"}}

node_user -->|"uses"| node_panelui
node_panelui -->|"requests"| node_uiapi
node_uiapi -->|"sends HTTP"| node_server
node_server -->|"dispatches"| node_ordinaryroutes
node_ordinaryroutes -->|"coordinates runs"| node_ordinaryfeature
node_ordinaryfeature -->|"starts turns"| node_turnapp
node_turnapp -->|"runs session"| node_agentloop
node_agentloop -->|"requests model"| node_modelruntime
node_modelruntime -->|"sends prompts"| node_provider
node_agentloop -->|"invokes tools"| node_capabilities
node_capabilities -.->|"offers MCP tools"| node_mcpmanager
node_mcpmanager -.->|"calls tools"| node_mcpservice
node_ordinaryroutes -->|"handles attachments"| node_context
node_panelui -->|"loads previews"| node_previewclient
node_previewclient -->|"requests previews"| node_spaces
node_server -->|"dispatches"| node_spaces
node_server -->|"dispatches"| node_memoryroutes
node_ordinaryroutes -->|"handles memory"| node_agentmemory
node_memoryroutes -->|"queries and mutates"| node_memoryfeature
node_agentmemory -->|"queries and mutates"| node_memoryfeature
node_server -->|"serves settings"| node_config
node_storage -->|"opens"| node_database
node_ordinaryfeature -->|"uses sessions"| node_sessions

click node_panelui "https://github.com/gust-feng/synech/blob/main/src/app/panel-ui/src/App.tsx"
click node_uiapi "https://github.com/gust-feng/synech/blob/main/src/app/panel-ui/src/api.ts"
click node_server "https://github.com/gust-feng/synech/blob/main/src/app/panel-server/index.ts"
click node_ordinaryroutes "https://github.com/gust-feng/synech/blob/main/src/app/panel-server/ordinary/ordinary-routes.ts"
click node_ordinaryfeature "https://github.com/gust-feng/synech/blob/main/src/app/ordinary-agent/ordinary-agent-feature.ts"
click node_turnapp "https://github.com/gust-feng/synech/blob/main/src/app/application/ordinary-turn-application.ts"
click node_agentloop "https://github.com/gust-feng/synech/blob/main/src/adapters/intelligence/agent-session-loop.ts"
click node_modelruntime "https://github.com/gust-feng/synech/blob/main/src/app/model-runtime/agent-loop.ts"
click node_capabilities "https://github.com/gust-feng/synech/blob/main/src/app/capability/capability-center.ts"
click node_mcpmanager "https://github.com/gust-feng/synech/blob/main/src/adapters/mcp/mcp-manager.ts"
click node_context "https://github.com/gust-feng/synech/blob/main/src/app/panel-server/workbench/context-routes.ts"
click node_spaces "https://github.com/gust-feng/synech/blob/main/src/app/panel-server/spaces/space-routes.ts"
click node_previewclient "https://github.com/gust-feng/synech/blob/main/src/app/panel-ui/src/personal-workbench/workbench/app/components/referencePreviewClient.ts"
click node_memoryroutes "https://github.com/gust-feng/synech/blob/main/src/app/panel-server/routes-memory.ts"
click node_agentmemory "https://github.com/gust-feng/synech/blob/main/src/app/panel-server/ordinary/agent-memory-routes.ts"
click node_memoryfeature "https://github.com/gust-feng/synech/blob/main/src/app/memory/memory-feature.ts"
click node_config "https://github.com/gust-feng/synech/blob/main/src/app/config-center/index.ts"
click node_storage "https://github.com/gust-feng/synech/blob/main/src/app/panel-server/storage/panel-storage.ts"
click node_database "https://github.com/gust-feng/synech/blob/main/src/adapters/runtime-storage/sqlite-runtime-database.ts"
click node_sessions "https://github.com/gust-feng/synech/blob/main/src/adapters/intelligence/file-system-agent-session-repository.ts"

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_panelui,node_uiapi,node_server,node_user toneBlue
class node_ordinaryroutes,node_ordinaryfeature,node_turnapp,node_agentloop,node_modelruntime,node_capabilities,node_sessions toneAmber
class node_context,node_spaces,node_previewclient,node_mcpservice toneMint
class node_memoryroutes,node_agentmemory,node_memoryfeature toneRose
class node_mcpmanager,node_config,node_storage,node_database,node_provider toneIndigo
```

## Components

### Panel experience

- [Workbench UI](https://github.com/gust-feng/synech/blob/main/src/app/panel-ui/src/App.tsx): `src/app/panel-ui/src/App.tsx`
- [Panel API client](https://github.com/gust-feng/synech/blob/main/src/app/panel-ui/src/api.ts): `src/app/panel-ui/src/api.ts`
- [Panel server](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/index.ts): `src/app/panel-server/index.ts`

### Agent runtime

- [Conversation routes](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/ordinary/ordinary-routes.ts): `src/app/panel-server/ordinary/ordinary-routes.ts`
- [Agent coordinator](https://github.com/gust-feng/synech/blob/main/src/app/ordinary-agent/ordinary-agent-feature.ts): `src/app/ordinary-agent/ordinary-agent-feature.ts`
- [Turn application](https://github.com/gust-feng/synech/blob/main/src/app/application/ordinary-turn-application.ts): `src/app/application/ordinary-turn-application.ts`
- [Agent session loop](https://github.com/gust-feng/synech/blob/main/src/adapters/intelligence/agent-session-loop.ts): `src/adapters/intelligence/agent-session-loop.ts`
- [Model runtime](https://github.com/gust-feng/synech/blob/main/src/app/model-runtime/agent-loop.ts): `src/app/model-runtime/agent-loop.ts`
- [Tool capabilities](https://github.com/gust-feng/synech/blob/main/src/app/capability/capability-center.ts): `src/app/capability/capability-center.ts`
- [Session repository](https://github.com/gust-feng/synech/blob/main/src/adapters/intelligence/file-system-agent-session-repository.ts): `src/adapters/intelligence/file-system-agent-session-repository.ts`

### Workspace content

- [Context attachments](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/workbench/context-routes.ts): `src/app/panel-server/workbench/context-routes.ts`
- [Spaces and references](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/spaces/space-routes.ts): `src/app/panel-server/spaces/space-routes.ts`
- [Reference preview client](https://github.com/gust-feng/synech/blob/main/src/app/panel-ui/src/personal-workbench/workbench/app/components/referencePreviewClient.ts): `src/app/panel-ui/src/personal-workbench/workbench/app/components/referencePreviewClient.ts`

### Memory

- [Memory routes](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/routes-memory.ts): `src/app/panel-server/routes-memory.ts`
- [Agent memory routes](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/ordinary/agent-memory-routes.ts): `src/app/panel-server/ordinary/agent-memory-routes.ts`
- [Memory feature](https://github.com/gust-feng/synech/blob/main/src/app/memory/memory-feature.ts): `src/app/memory/memory-feature.ts`

### Configuration and integrations

- [MCP manager](https://github.com/gust-feng/synech/blob/main/src/adapters/mcp/mcp-manager.ts): `src/adapters/mcp/mcp-manager.ts`
- [Configuration center](https://github.com/gust-feng/synech/blob/main/src/app/config-center/index.ts): `src/app/config-center/index.ts`
- [Panel storage](https://github.com/gust-feng/synech/blob/main/src/app/panel-server/storage/panel-storage.ts): `src/app/panel-server/storage/panel-storage.ts`
- [SQLite runtime database](https://github.com/gust-feng/synech/blob/main/src/adapters/runtime-storage/sqlite-runtime-database.ts): `src/adapters/runtime-storage/sqlite-runtime-database.ts`

### Other components

- **User**
- **Model provider**
- **MCP servers**

## Connections

- User → Workbench UI: uses
- Workbench UI → Panel API client: requests
- Panel API client → Panel server: sends HTTP
- Panel server → Conversation routes: dispatches
- Conversation routes → Agent coordinator: coordinates runs
- Agent coordinator → Turn application: starts turns
- Turn application → Agent session loop: runs session
- Agent session loop → Model runtime: requests model
- Model runtime → Model provider: sends prompts
- Agent session loop → Tool capabilities: invokes tools
- Tool capabilities → MCP manager: offers MCP tools
- MCP manager → MCP servers: calls tools
- Conversation routes → Context attachments: handles attachments
- Workbench UI → Reference preview client: loads previews
- Reference preview client → Spaces and references: requests previews
- Panel server → Spaces and references: dispatches
- Panel server → Memory routes: dispatches
- Conversation routes → Agent memory routes: handles memory
- Memory routes → Memory feature: queries and mutates
- Agent memory routes → Memory feature: queries and mutates
- Panel server → Configuration center: serves settings
- Panel storage → SQLite runtime database: opens
- Agent coordinator → Session repository: uses sessions
