# google-deepmind/dramatron architecture

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

- Interactive diagram: https://gitdiagram.com/google-deepmind/dramatron
- Repository: https://github.com/google-deepmind/dramatron

## Overview

Dramatron is a Colab-based co-writing tool for developing theatre scripts and screenplays with a language model. A writer starts from a log line; the notebook supports hierarchical generation of character descriptions, plot points, locations, and dialogue, which writers can compile, edit, and rewrite. The README describes these capabilities but no source excerpts are available, so the graph uses the notebook as the implementation path for the documented stages; it does not infer internal calls or sequencing between them.

Main entry points: [`colab/dramatron.ipynb`](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb) (Dramatron Colab)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_writing["Writer workflow"]
  node_colab["Dramatron Colab<br/>[dramatron.ipynb]"]
  node_logline["Log line<br/>[dramatron.ipynb]"]
  node_compile["Compile and revise<br/>[dramatron.ipynb]"]
end

subgraph group_generation["Story generation"]
  node_hierarchy["Hierarchical generation<br/>[dramatron.ipynb]"]
  node_characters["Character descriptions<br/>[dramatron.ipynb]"]
  node_plot["Plot points<br/>[dramatron.ipynb]"]
  node_locations["Location descriptions<br/>[dramatron.ipynb]"]
  node_dialogue["Dialogue<br/>[dramatron.ipynb]"]
end

subgraph group_integration["Model integration"]
  node_model["Writer-supplied LLM"]
end

node_writer(("Writer"))

node_writer -->|"uses interactively"| node_colab
node_writer -->|"provides starting point"| node_logline
node_colab -->|"supports"| node_hierarchy
node_colab -->|"generates"| node_characters
node_colab -->|"generates"| node_plot
node_colab -->|"generates"| node_locations
node_colab -->|"generates"| node_dialogue
node_writer -->|"compiles and revises"| node_compile
node_writer -.->|"implements sampling for"| node_model

click node_colab "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"
click node_logline "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"
click node_compile "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"
click node_hierarchy "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"
click node_characters "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"
click node_plot "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"
click node_locations "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"
click node_dialogue "https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb"

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_colab,node_logline,node_compile toneBlue
class node_hierarchy,node_characters,node_plot,node_locations,node_dialogue toneAmber
class node_model toneMint
class node_writer toneIndigo
```

## Components

### Writer workflow

- [Dramatron Colab](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`
- [Log line](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`
- [Compile and revise](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`

### Story generation

- [Hierarchical generation](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`
- [Character descriptions](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`
- [Plot points](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`
- [Location descriptions](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`
- [Dialogue](https://github.com/google-deepmind/dramatron/blob/main/colab/dramatron.ipynb): `colab/dramatron.ipynb`

### Model integration

- **Writer-supplied LLM**

### Other components

- **Writer**

## Connections

- Writer → Dramatron Colab: uses interactively (evidence: `README.md`)
- Writer → Log line: provides starting point (evidence: `README.md`)
- Dramatron Colab → Hierarchical generation: supports (evidence: `README.md`)
- Dramatron Colab → Character descriptions: generates (evidence: `README.md`)
- Dramatron Colab → Plot points: generates (evidence: `README.md`)
- Dramatron Colab → Location descriptions: generates (evidence: `README.md`)
- Dramatron Colab → Dialogue: generates (evidence: `README.md`)
- Writer → Compile and revise: compiles and revises (evidence: `README.md`)
- Writer → Writer-supplied LLM: implements sampling for (evidence: `README.md`)
