# weavemindai/weft architecture

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

- Interactive diagram: https://gitdiagram.com/weavemindai/weft
- Repository: https://github.com/weavemindai/weft

## Overview

Weft is a language and runtime for composing AI, human, API, database, and infrastructure nodes into durable orchestrations. A user authors a graph, the compiler validates and builds it, and the runtime coordinates node execution, waits, signals, and recorded values; users can inspect and operate runs through the CLI and graph interface. The README documents the workflow and major capabilities, while sampled source is limited, so several runtime connections below reflect documented behavior rather than inspected call sites.

Main entry points: [`crates/weft-dispatcher/src/app.rs`](https://github.com/weavemindai/weft/blob/main/crates/weft-dispatcher/src/app.rs) (Dispatcher), [`crates/weft-engine/src/execution_driver.rs`](https://github.com/weavemindai/weft/blob/main/crates/weft-engine/src/execution_driver.rs) (Execution engine), [`crates/weft-catalog/src/lib.rs`](https://github.com/weavemindai/weft/blob/main/crates/weft-catalog/src/lib.rs) (Node catalog), [`crates/weft-engine/src/storage.rs`](https://github.com/weavemindai/weft/blob/main/crates/weft-engine/src/storage.rs) (Runtime file storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring and compile"]
  node_project["Weft project<br/>[project.rs]"]
  node_compiler["Compiler<br/>[weft_compiler.rs]"]
end

subgraph group_runtime["Execution runtime"]
  node_engine["Execution engine"]
  node_core["Runtime primitives<br/>[loop_runtime.rs]"]
  node_listener["Signal listeners<br/>[lib.rs]"]
  node_infra["Infrastructure lifecycle<br/>[lifecycle.rs]"]
end

subgraph group_integrations["Nodes and integrations"]
  node_catalog["Node catalog<br/>[lib.rs]"]
  node_ai_nodes["AI nodes<br/>[call.rs]"]
  node_service_nodes["Service nodes<br/>[api.rs]"]
  node_human_nodes["Human interaction<br/>[mod.rs]"]
end

subgraph group_operations["Operations and state"]
  node_cli["weft CLI<br/>[main.rs]"]
  node_dispatcher["Dispatcher<br/>[app.rs]"]
  node_journal[("Execution journal<br/>[lib.rs]")]
  node_broker["Broker services<br/>[lib.rs]"]
  node_storage["Runtime file storage<br/>[storage.rs]"]
  node_graph_ui["Graph interface<br/>[engine.svelte.ts]"]
end

node_user(("Developer / operator"))
node_object_store[("Object store")]
node_providers["External services"]
node_person(("Human reviewer"))

node_user -->|"authors"| node_project
node_user -->|"operates"| node_cli
node_project -->|"compiled by"| node_compiler
node_compiler -->|"builds program for"| node_engine
node_cli -->|"sends commands"| node_dispatcher
node_dispatcher -->|"coordinates runs"| node_engine
node_engine -->|"uses runtime"| node_core
node_engine -->|"records execution"| node_journal
node_listener -->|"delivers signals"| node_dispatcher
node_engine -->|"executes nodes from"| node_catalog
node_catalog -->|"includes"| node_ai_nodes
node_catalog -->|"includes"| node_service_nodes
node_catalog -->|"includes"| node_human_nodes
node_ai_nodes -.->|"calls"| node_providers
node_service_nodes -.->|"calls"| node_providers
node_human_nodes -->|"requests review"| node_person
node_person -->|"submits response"| node_dispatcher
node_dispatcher -->|"manages lifecycle"| node_infra
node_engine -->|"uses file storage"| node_storage
node_storage -->|"requests URLs and metadata"| node_broker
node_broker -->|"presigns transfers"| node_object_store
node_storage -->|"transfers bytes"| node_object_store
node_user -->|"inspects graph"| node_graph_ui
node_graph_ui -->|"edits and queries"| node_dispatcher
node_dispatcher -->|"serves run records"| node_journal

click node_project "https://github.com/weavemindai/weft/blob/main/crates/weft-compiler/src/project.rs"
click node_compiler "https://github.com/weavemindai/weft/blob/main/crates/weft-compiler/src/weft_compiler.rs"
click node_cli "https://github.com/weavemindai/weft/blob/main/crates/weft-cli/src/main.rs"
click node_dispatcher "https://github.com/weavemindai/weft/blob/main/crates/weft-dispatcher/src/app.rs"
click node_engine "https://github.com/weavemindai/weft/blob/main/crates/weft-engine/src/execution_driver.rs"
click node_core "https://github.com/weavemindai/weft/blob/main/crates/weft-core/src/exec/loop_runtime.rs"
click node_journal "https://github.com/weavemindai/weft/blob/main/crates/weft-journal/src/lib.rs"
click node_listener "https://github.com/weavemindai/weft/blob/main/crates/weft-listener/src/lib.rs"
click node_catalog "https://github.com/weavemindai/weft/blob/main/crates/weft-catalog/src/lib.rs"
click node_ai_nodes "https://github.com/weavemindai/weft/blob/main/catalog/ai/llm/call.rs"
click node_service_nodes "https://github.com/weavemindai/weft/blob/main/catalog/google/api.rs"
click node_human_nodes "https://github.com/weavemindai/weft/blob/main/catalog/human/query/mod.rs"
click node_infra "https://github.com/weavemindai/weft/blob/main/crates/weft-infra-supervisor/src/lifecycle.rs"
click node_broker "https://github.com/weavemindai/weft/blob/main/crates/weft-broker/src/lib.rs"
click node_storage "https://github.com/weavemindai/weft/blob/main/crates/weft-engine/src/storage.rs"
click node_graph_ui "https://github.com/weavemindai/weft/blob/main/packages/weft-graph/src/webview/lib/projection/engine.svelte.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_project,node_compiler,node_person toneBlue
class node_engine,node_core,node_listener,node_infra,node_object_store toneAmber
class node_catalog,node_ai_nodes,node_service_nodes,node_human_nodes toneMint
class node_cli,node_dispatcher,node_journal,node_broker,node_storage,node_graph_ui toneRose
class node_user,node_providers toneIndigo
```

## Components

### Authoring and compile

- [Weft project](https://github.com/weavemindai/weft/blob/main/crates/weft-compiler/src/project.rs): `crates/weft-compiler/src/project.rs`
- [Compiler](https://github.com/weavemindai/weft/blob/main/crates/weft-compiler/src/weft_compiler.rs): `crates/weft-compiler/src/weft_compiler.rs`

### Execution runtime

- [Execution engine](https://github.com/weavemindai/weft/blob/main/crates/weft-engine/src/execution_driver.rs): `crates/weft-engine/src/execution_driver.rs`
- [Runtime primitives](https://github.com/weavemindai/weft/blob/main/crates/weft-core/src/exec/loop_runtime.rs): `crates/weft-core/src/exec/loop_runtime.rs`
- [Signal listeners](https://github.com/weavemindai/weft/blob/main/crates/weft-listener/src/lib.rs): `crates/weft-listener/src/lib.rs`
- [Infrastructure lifecycle](https://github.com/weavemindai/weft/blob/main/crates/weft-infra-supervisor/src/lifecycle.rs): `crates/weft-infra-supervisor/src/lifecycle.rs`

### Nodes and integrations

- [Node catalog](https://github.com/weavemindai/weft/blob/main/crates/weft-catalog/src/lib.rs): `crates/weft-catalog/src/lib.rs`
- [AI nodes](https://github.com/weavemindai/weft/blob/main/catalog/ai/llm/call.rs): `catalog/ai/llm/call.rs`
- [Service nodes](https://github.com/weavemindai/weft/blob/main/catalog/google/api.rs): `catalog/google/api.rs`
- [Human interaction](https://github.com/weavemindai/weft/blob/main/catalog/human/query/mod.rs): `catalog/human/query/mod.rs`

### Operations and state

- [weft CLI](https://github.com/weavemindai/weft/blob/main/crates/weft-cli/src/main.rs): `crates/weft-cli/src/main.rs`
- [Dispatcher](https://github.com/weavemindai/weft/blob/main/crates/weft-dispatcher/src/app.rs): `crates/weft-dispatcher/src/app.rs`
- [Execution journal](https://github.com/weavemindai/weft/blob/main/crates/weft-journal/src/lib.rs): `crates/weft-journal/src/lib.rs`
- [Broker services](https://github.com/weavemindai/weft/blob/main/crates/weft-broker/src/lib.rs): `crates/weft-broker/src/lib.rs`
- [Runtime file storage](https://github.com/weavemindai/weft/blob/main/crates/weft-engine/src/storage.rs): `crates/weft-engine/src/storage.rs`
- [Graph interface](https://github.com/weavemindai/weft/blob/main/packages/weft-graph/src/webview/lib/projection/engine.svelte.ts): `packages/weft-graph/src/webview/lib/projection/engine.svelte.ts`

### Other components

- **Developer / operator**
- **Object store**
- **External services**
- **Human reviewer**

## Connections

- Developer / operator → Weft project: authors
- Developer / operator → weft CLI: operates
- Weft project → Compiler: compiled by
- Compiler → Execution engine: builds program for
- weft CLI → Dispatcher: sends commands
- Dispatcher → Execution engine: coordinates runs
- Execution engine → Runtime primitives: uses runtime
- Execution engine → Execution journal: records execution
- Signal listeners → Dispatcher: delivers signals
- Execution engine → Node catalog: executes nodes from
- Node catalog → AI nodes: includes
- Node catalog → Service nodes: includes
- Node catalog → Human interaction: includes
- AI nodes → External services: calls
- Service nodes → External services: calls
- Human interaction → Human reviewer: requests review
- Human reviewer → Dispatcher: submits response
- Dispatcher → Infrastructure lifecycle: manages lifecycle
- Execution engine → Runtime file storage: uses file storage
- Runtime file storage → Broker services: requests URLs and metadata
- Broker services → Object store: presigns transfers
- Runtime file storage → Object store: transfers bytes
- Developer / operator → Graph interface: inspects graph
- Graph interface → Dispatcher: edits and queries
- Dispatcher → Execution journal: serves run records
