# antonosika/gpt-engineer architecture

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

- Interactive diagram: https://gitdiagram.com/antonosika/gpt-engineer
- Repository: https://github.com/antonosika/gpt-engineer

## Overview

gpt-engineer is a CLI coding agent: a user supplies a natural-language request (and optionally images or existing code), the agent asks a model to generate or improve files, and it can execute generated code locally. The graph includes prompt intake, agent orchestration, generation/improvement, and local execution/storage, plus documented model and custom-preprompt capabilities. Some subsystem links rely on the SOURCE INDEX or README because their implementation was not excerpted; unverified links are omitted.

Main entry points: [`gpt_engineer/applications/cli/main.py`](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/main.py) (CLI entrypoint), [`gpt_engineer/core/default/steps.py`](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/steps.py) (Generation steps), [`gpt_engineer/applications/cli/cli_agent.py`](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/cli_agent.py) (CLI agent), [`gpt_engineer/core/ai.py`](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/ai.py) (Model client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_cli["CLI entrypoint<br/>[main.py]"]
  node_intake["Prompt intake<br/>[main.py]"]
  node_selection["File selection<br/>[file_selector.py]"]
  node_learning["Learning and collection<br/>[learning.py]"]
end

subgraph group_agent["Agent and generation"]
  node_orchestrator["CLI agent<br/>[cli_agent.py]"]
  node_prompt["Prompt representation<br/>[prompt.py]"]
  node_steps["Generation steps<br/>[steps.py]"]
  node_custom["Custom steps<br/>[custom_steps.py]"]
  node_preprompts["Preprompt templates"]
end

subgraph group_runtime["Execution and files"]
  node_files["Generated file set<br/>[files_dict.py]"]
  node_improvements["Chat-to-files and diffs<br/>[chat_to_files.py]"]
  node_execution["Execution environment"]
  node_file_store[("Workspace file store<br/>[file_store.py]")]
  node_memory[("Project memory<br/>[disk_memory.py]")]
end

subgraph group_integrations["Model integrations"]
  node_ai["Model client<br/>[ai.py]"]
  node_model{{"Language model APIs"}}
end

node_user(("Project author"))

node_user -->|"starts"| node_cli
node_cli -->|"collects request"| node_intake
node_cli -->|"selects files"| node_selection
node_cli -->|"offers learning"| node_learning
node_intake -->|"builds prompt"| node_prompt
node_cli -->|"configures agent"| node_orchestrator
node_orchestrator -->|"runs steps"| node_steps
node_orchestrator -->|"provides client"| node_ai
node_steps -->|"requests generation"| node_ai
node_steps -->|"loads templates"| node_preprompts
node_steps -->|"uses request"| node_prompt
node_custom -->|"requests revisions"| node_ai
node_custom -->|"runs generated code"| node_execution
node_steps -->|"produces files"| node_files
node_orchestrator -->|"improves files"| node_improvements
node_ai -->|"calls model"| node_model
node_execution -->|"uploads and runs"| node_file_store
node_execution -->|"transfers files"| node_files
node_preprompts -->|"reads templates"| node_memory
node_cli -->|"stores project data"| node_memory

click node_cli "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/main.py"
click node_intake "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/main.py"
click node_selection "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/file_selector.py"
click node_learning "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/learning.py"
click node_orchestrator "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/cli_agent.py"
click node_prompt "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/prompt.py"
click node_steps "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/steps.py"
click node_custom "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/tools/custom_steps.py"
click node_preprompts "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/preprompts_holder.py"
click node_ai "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/ai.py"
click node_files "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/files_dict.py"
click node_improvements "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/chat_to_files.py"
click node_execution "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/disk_execution_env.py"
click node_file_store "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/file_store.py"
click node_memory "https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/disk_memory.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_cli,node_intake,node_selection,node_learning toneBlue
class node_orchestrator,node_prompt,node_steps,node_custom,node_preprompts toneAmber
class node_files,node_improvements,node_execution,node_file_store,node_memory toneMint
class node_ai,node_model toneRose
class node_user toneIndigo
```

## Components

### CLI workflow

- [CLI entrypoint](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/main.py): `gpt_engineer/applications/cli/main.py`
- [Prompt intake](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/main.py): `gpt_engineer/applications/cli/main.py`
- [File selection](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/file_selector.py): `gpt_engineer/applications/cli/file_selector.py`
- [Learning and collection](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/learning.py): `gpt_engineer/applications/cli/learning.py`

### Agent and generation

- [CLI agent](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/applications/cli/cli_agent.py): `gpt_engineer/applications/cli/cli_agent.py`
- [Prompt representation](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/prompt.py): `gpt_engineer/core/prompt.py`
- [Generation steps](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/steps.py): `gpt_engineer/core/default/steps.py`
- [Custom steps](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/tools/custom_steps.py): `gpt_engineer/tools/custom_steps.py`
- [Preprompt templates](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/preprompts_holder.py): `gpt_engineer/core/preprompts_holder.py`

### Execution and files

- [Generated file set](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/files_dict.py): `gpt_engineer/core/files_dict.py`
- [Chat-to-files and diffs](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/chat_to_files.py): `gpt_engineer/core/chat_to_files.py`
- [Execution environment](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/disk_execution_env.py): `gpt_engineer/core/default/disk_execution_env.py`
- [Workspace file store](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/file_store.py): `gpt_engineer/core/default/file_store.py`
- [Project memory](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/default/disk_memory.py): `gpt_engineer/core/default/disk_memory.py`

### Model integrations

- [Model client](https://github.com/antonosika/gpt-engineer/blob/main/gpt_engineer/core/ai.py): `gpt_engineer/core/ai.py`
- **Language model APIs**

### Other components

- **Project author**

## Connections

- Project author → CLI entrypoint: starts (evidence: `README.md`)
- CLI entrypoint → Prompt intake: collects request (evidence: `gpt_engineer/applications/cli/main.py`)
- CLI entrypoint → File selection: selects files (evidence: `gpt_engineer/applications/cli/main.py`)
- CLI entrypoint → Learning and collection: offers learning (evidence: `gpt_engineer/applications/cli/main.py`)
- Prompt intake → Prompt representation: builds prompt (evidence: `gpt_engineer/applications/cli/main.py`)
- CLI entrypoint → CLI agent: configures agent (evidence: `gpt_engineer/applications/cli/main.py`)
- CLI agent → Generation steps: runs steps (evidence: `gpt_engineer/applications/cli/cli_agent.py`)
- CLI agent → Model client: provides client (evidence: `gpt_engineer/applications/cli/cli_agent.py`)
- Generation steps → Model client: requests generation (evidence: `gpt_engineer/core/default/steps.py`)
- Generation steps → Preprompt templates: loads templates (evidence: `gpt_engineer/core/default/steps.py`)
- Generation steps → Prompt representation: uses request (evidence: `gpt_engineer/core/default/steps.py`)
- Custom steps → Model client: requests revisions (evidence: `gpt_engineer/tools/custom_steps.py`)
- Custom steps → Execution environment: runs generated code (evidence: `gpt_engineer/tools/custom_steps.py`)
- Generation steps → Generated file set: produces files (evidence: `gpt_engineer/core/default/steps.py`)
- CLI agent → Chat-to-files and diffs: improves files (evidence: `gpt_engineer/applications/cli/cli_agent.py`)
- Model client → Language model APIs: calls model (evidence: `README.md`)
- Execution environment → Workspace file store: uploads and runs (evidence: `gpt_engineer/core/default/disk_execution_env.py`)
- Execution environment → Generated file set: transfers files (evidence: `gpt_engineer/core/default/disk_execution_env.py`)
- Preprompt templates → Project memory: reads templates (evidence: `gpt_engineer/core/preprompts_holder.py`)
- CLI entrypoint → Project memory: stores project data (evidence: `gpt_engineer/applications/cli/main.py`)
