# pathwaycom/pathway architecture

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

- Interactive diagram: https://gitdiagram.com/pathwaycom/pathway
- Repository: https://github.com/pathwaycom/pathway

## Overview

Pathway is a Python framework for building live-data pipelines: users define table inputs and transformations, then run pipelines that process batch or streaming data and expose results through outputs. Python builds and orchestrates the computation; a Rust dataflow engine performs incremental processing. Connectors, persistence, and LLM/RAG tooling are distinct product capabilities. Some subsystem paths are based on the repository tree and README rather than sampled implementation, so their internal call relationships are omitted where evidence is unavailable.

Main entry points: [`src/engine/dataflow.rs`](https://github.com/pathwaycom/pathway/blob/main/src/engine/dataflow.rs) (Rust dataflow engine), [`src/connectors/mod.rs`](https://github.com/pathwaycom/pathway/blob/main/src/connectors/mod.rs) (Input connectors), [`python/pathway/internals/api.py`](https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/api.py) (Python API), [`python/pathway/internals/table.py`](https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/table.py) (Tables and columns)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Python Pipeline API"]
  node_api["Python API<br/>[api.py]"]
  node_tables["Tables and columns<br/>[table.py]"]
  node_operators["Transformations<br/>[operator.py]"]
  node_graph["Storage graph<br/>[storage_graph.py]"]
  node_runner["Graph runner"]
end

subgraph group_runtime["Incremental Runtime"]
  node_engine["Rust dataflow engine<br/>[dataflow.rs]"]
  node_expressions["Expressions<br/>[expression.rs]"]
end

subgraph group_connectors["Data Connectors"]
  node_input["Input connectors<br/>[mod.rs]"]
  node_formats["Data formats<br/>[mod.rs]"]
  node_storage["Connector storage<br/>[mod.rs]"]
  node_external(("External sources"))
  node_output["Output connectors<br/>[mod.rs]"]
end

subgraph group_state["Persistence"]
  node_persist_config["Persistence config<br/>[config.rs]"]
  node_tracker["Snapshot tracker<br/>[tracker.rs]"]
  node_snapshots[("Snapshot storage")]
  node_backends[("Storage backends<br/>[mod.rs]")]
end

subgraph group_ai["LLM and Search"]
  node_llm["LLM tooling<br/>[llms.py]"]
  node_search["Vector search integrations<br/>[mod.rs]"]
end

node_user(("Pipeline developer"))
node_services(("LLM and index services"))

node_user -->|"defines pipelines"| node_api
node_api -->|"creates tables"| node_tables
node_tables -->|"uses transformations"| node_operators
node_operators -.->|"builds graph"| node_graph
node_graph -->|"plans execution"| node_runner
node_runner -->|"runs computation"| node_engine
node_api -.->|"configures sources"| node_input
node_external -->|"supplies data"| node_input
node_input -->|"parses events"| node_formats
node_input -->|"reads and writes"| node_storage
node_formats -.->|"feeds records"| node_engine
node_engine -.->|"evaluates expressions"| node_expressions
node_engine -.->|"produces results"| node_output
node_output -.->|"writes results"| node_external
node_engine -->|"tracks snapshots"| node_tracker
node_tracker -->|"creates readers"| node_persist_config
node_persist_config -->|"selects backend"| node_backends
node_backends -->|"stores cached objects"| node_snapshots
node_user -->|"builds AI pipelines"| node_llm
node_llm -.->|"calls model services"| node_services
node_engine -.->|"uses index integrations"| node_search
node_search -.->|"queries vector indexes"| node_services

click node_api "https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/api.py"
click node_tables "https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/table.py"
click node_operators "https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/operator.py"
click node_graph "https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/graph_runner/storage_graph.py"
click node_runner "https://github.com/pathwaycom/pathway/tree/main/python/pathway/internals/graph_runner"
click node_engine "https://github.com/pathwaycom/pathway/blob/main/src/engine/dataflow.rs"
click node_expressions "https://github.com/pathwaycom/pathway/blob/main/src/engine/expression.rs"
click node_input "https://github.com/pathwaycom/pathway/blob/main/src/connectors/mod.rs"
click node_formats "https://github.com/pathwaycom/pathway/blob/main/src/connectors/data_format/mod.rs"
click node_storage "https://github.com/pathwaycom/pathway/blob/main/src/connectors/data_storage/mod.rs"
click node_output "https://github.com/pathwaycom/pathway/blob/main/src/connectors/data_storage/mod.rs"
click node_persist_config "https://github.com/pathwaycom/pathway/blob/main/src/persistence/config.rs"
click node_tracker "https://github.com/pathwaycom/pathway/blob/main/src/persistence/tracker.rs"
click node_snapshots "https://github.com/pathwaycom/pathway/blob/main/src/persistence/cached_object_storage.rs"
click node_backends "https://github.com/pathwaycom/pathway/blob/main/src/persistence/backends/mod.rs"
click node_llm "https://github.com/pathwaycom/pathway/blob/main/python/pathway/xpacks/llm/llms.py"
click node_search "https://github.com/pathwaycom/pathway/blob/main/src/external_integration/mod.rs"

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_api,node_tables,node_operators,node_graph,node_runner toneBlue
class node_engine,node_expressions toneAmber
class node_input,node_formats,node_storage,node_external,node_output toneMint
class node_persist_config,node_tracker,node_snapshots,node_backends toneRose
class node_llm,node_search,node_user,node_services toneIndigo
```

## Components

### Python Pipeline API

- [Python API](https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/api.py): `python/pathway/internals/api.py`
- [Tables and columns](https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/table.py): `python/pathway/internals/table.py`
- [Transformations](https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/operator.py): `python/pathway/internals/operator.py`
- [Storage graph](https://github.com/pathwaycom/pathway/blob/main/python/pathway/internals/graph_runner/storage_graph.py): `python/pathway/internals/graph_runner/storage_graph.py`
- [Graph runner](https://github.com/pathwaycom/pathway/tree/main/python/pathway/internals/graph_runner): `python/pathway/internals/graph_runner`

### Incremental Runtime

- [Rust dataflow engine](https://github.com/pathwaycom/pathway/blob/main/src/engine/dataflow.rs): `src/engine/dataflow.rs`
- [Expressions](https://github.com/pathwaycom/pathway/blob/main/src/engine/expression.rs): `src/engine/expression.rs`

### Data Connectors

- [Input connectors](https://github.com/pathwaycom/pathway/blob/main/src/connectors/mod.rs): `src/connectors/mod.rs`
- [Data formats](https://github.com/pathwaycom/pathway/blob/main/src/connectors/data_format/mod.rs): `src/connectors/data_format/mod.rs`
- [Connector storage](https://github.com/pathwaycom/pathway/blob/main/src/connectors/data_storage/mod.rs): `src/connectors/data_storage/mod.rs`
- **External sources**
- [Output connectors](https://github.com/pathwaycom/pathway/blob/main/src/connectors/data_storage/mod.rs): `src/connectors/data_storage/mod.rs`

### Persistence

- [Persistence config](https://github.com/pathwaycom/pathway/blob/main/src/persistence/config.rs): `src/persistence/config.rs`
- [Snapshot tracker](https://github.com/pathwaycom/pathway/blob/main/src/persistence/tracker.rs): `src/persistence/tracker.rs`
- [Snapshot storage](https://github.com/pathwaycom/pathway/blob/main/src/persistence/cached_object_storage.rs): `src/persistence/cached_object_storage.rs`
- [Storage backends](https://github.com/pathwaycom/pathway/blob/main/src/persistence/backends/mod.rs): `src/persistence/backends/mod.rs`

### LLM and Search

- [LLM tooling](https://github.com/pathwaycom/pathway/blob/main/python/pathway/xpacks/llm/llms.py): `python/pathway/xpacks/llm/llms.py`
- [Vector search integrations](https://github.com/pathwaycom/pathway/blob/main/src/external_integration/mod.rs): `src/external_integration/mod.rs`

### Other components

- **Pipeline developer**
- **LLM and index services**

## Connections

- Pipeline developer → Python API: defines pipelines
- Python API → Tables and columns: creates tables (evidence: `python/pathway/internals/graph_runner/storage_graph.py`)
- Tables and columns → Transformations: uses transformations
- Transformations → Storage graph: builds graph (evidence: `python/pathway/internals/graph_runner/storage_graph.py`)
- Storage graph → Graph runner: plans execution (evidence: `python/pathway/internals/graph_runner/storage_graph.py`)
- Graph runner → Rust dataflow engine: runs computation
- Python API → Input connectors: configures sources
- External sources → Input connectors: supplies data
- Input connectors → Data formats: parses events (evidence: `src/connectors/mod.rs`)
- Input connectors → Connector storage: reads and writes (evidence: `src/connectors/mod.rs`)
- Data formats → Rust dataflow engine: feeds records (evidence: `src/engine/dataflow.rs`)
- Rust dataflow engine → Expressions: evaluates expressions (evidence: `src/engine/dataflow.rs`)
- Rust dataflow engine → Output connectors: produces results (evidence: `src/engine/dataflow.rs`)
- Output connectors → External sources: writes results
- Rust dataflow engine → Snapshot tracker: tracks snapshots (evidence: `src/engine/dataflow.rs`)
- Snapshot tracker → Persistence config: creates readers (evidence: `src/persistence/tracker.rs`)
- Persistence config → Storage backends: selects backend (evidence: `src/persistence/config.rs`)
- Storage backends → Snapshot storage: stores cached objects (evidence: `src/persistence/cached_object_storage.rs`)
- Pipeline developer → LLM tooling: builds AI pipelines
- LLM tooling → LLM and index services: calls model services
- Rust dataflow engine → Vector search integrations: uses index integrations (evidence: `src/engine/dataflow.rs`)
- Vector search integrations → LLM and index services: queries vector indexes
