# stanford-oval/storm architecture

> Architecture diagram of the GitHub repository stanford-oval/storm, 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/stanford-oval/storm
- Repository: https://github.com/stanford-oval/storm

## Overview

Knowledge-Storm is a modular LLM knowledge-curation system with two products: STORM generates cited Wikipedia-like articles, while Co-STORM supports human-guided research through discourse and a shared mind map. The primary STORM workflow is topic submission, perspective-driven retrieval, outline construction, article writing, polishing, and displayed output. Co-STORM adds warm-start research, moderated turns, grounded answers, and knowledge-base insertion. The graph preserves documented capabilities; several internal module calls are inferred only where the sampled engine or README explicitly describes them.

Main entry points: [`knowledge_storm/lm.py`](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/lm.py) (Language Models), [`knowledge_storm/storm_wiki/engine.py`](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/engine.py) (STORM Runner), [`knowledge_storm/storm_wiki/modules/knowledge_curation.py`](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/knowledge_curation.py) (Knowledge Curation), [`knowledge_storm/collaborative_storm/engine.py`](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/engine.py) (Co-STORM Runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration and UI"]
  node_demo_ui["Streamlit Demo"]
  node_storm_runner["STORM Runner<br/>[engine.py]"]
  node_costorm_runner["Co-STORM Runner<br/>[engine.py]"]
  node_article_viewer["Article Viewer<br/>[demo_util.py]"]
end

subgraph group_storm["STORM Curation"]
  node_curation["Knowledge Curation"]
  node_retriever["Source Retriever<br/>[retriever.py]"]
  node_info_table["Information Table<br/>[storm_dataclass.py]"]
  node_outline["Outline Generation"]
  node_article_generation["Article Generation"]
  node_article_polish["Article Polishing<br/>[article_polish.py]"]
end

subgraph group_collab["Co-STORM Collaboration"]
  node_warmstart["Warm Start Research"]
  node_discourse["Discourse Manager<br/>[engine.py]"]
  node_agents["Co-STORM Agents<br/>[co_storm_agents.py]"]
  node_grounded_qa["Grounded Answers"]
  node_insertion["Information Insertion"]
  node_knowledge_base[("Shared Knowledge Base<br/>[dataclass.py]")]
end

subgraph group_runtime["Models and Retrieval"]
  node_retrieval_models["Retrieval Models<br/>[rm.py]"]
  node_lm_runtime["Language Models<br/>[lm.py]"]
  node_encoder["Embedding Encoder<br/>[encoder.py]"]
end

subgraph group_artifacts["Article Artifacts"]
  node_article_files["Article Files<br/>[demo_util.py]"]
end

node_user(("Human User"))
node_web_search["Web Search"]
node_llm_provider["LLM Provider"]

node_user -->|"submits topic"| node_demo_ui
node_demo_ui -->|"runs research"| node_storm_runner
node_storm_runner -->|"starts curation"| node_curation
node_curation -->|"requests sources"| node_retriever
node_retriever -->|"executes queries"| node_retrieval_models
node_retrieval_models -.->|"searches web"| node_web_search
node_curation -->|"collects evidence"| node_info_table
node_storm_runner -->|"generates outline"| node_outline
node_outline -->|"uses evidence"| node_info_table
node_storm_runner -->|"writes article"| node_article_generation
node_article_generation -->|"uses references"| node_info_table
node_storm_runner -->|"polishes article"| node_article_polish
node_article_polish -->|"writes result"| node_article_files
node_article_viewer -->|"reads result"| node_article_files
node_demo_ui -->|"shows result"| node_article_viewer
node_costorm_runner -->|"starts warmup"| node_warmstart
node_warmstart -->|"answers questions"| node_grounded_qa
node_grounded_qa -->|"retrieves grounding"| node_retrieval_models
node_warmstart -->|"initializes map"| node_knowledge_base
node_costorm_runner -->|"manages turns"| node_discourse
node_discourse -->|"selects agent"| node_agents
node_agents -->|"requests answers"| node_grounded_qa
node_costorm_runner -->|"inserts turn"| node_insertion
node_insertion -->|"updates map"| node_knowledge_base
node_knowledge_base -->|"supports similarity"| node_encoder
node_curation -->|"prompts models"| node_lm_runtime
node_outline -->|"prompts models"| node_lm_runtime
node_article_generation -->|"prompts models"| node_lm_runtime
node_article_polish -->|"prompts models"| node_lm_runtime
node_agents -->|"prompts models"| node_lm_runtime
node_lm_runtime -.->|"calls models"| node_llm_provider

click node_demo_ui "https://github.com/stanford-oval/storm/blob/main/frontend/demo_light/pages_util/CreateNewArticle.py"
click node_storm_runner "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/engine.py"
click node_costorm_runner "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/engine.py"
click node_article_viewer "https://github.com/stanford-oval/storm/blob/main/frontend/demo_light/demo_util.py"
click node_curation "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/knowledge_curation.py"
click node_retriever "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/retriever.py"
click node_info_table "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/storm_dataclass.py"
click node_outline "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/outline_generation.py"
click node_article_generation "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/article_generation.py"
click node_article_polish "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/article_polish.py"
click node_warmstart "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py"
click node_discourse "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/engine.py"
click node_agents "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/co_storm_agents.py"
click node_grounded_qa "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/grounded_question_answering.py"
click node_insertion "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/information_insertion_module.py"
click node_knowledge_base "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/dataclass.py"
click node_retrieval_models "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/rm.py"
click node_lm_runtime "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/lm.py"
click node_encoder "https://github.com/stanford-oval/storm/blob/main/knowledge_storm/encoder.py"
click node_article_files "https://github.com/stanford-oval/storm/blob/main/frontend/demo_light/demo_util.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_demo_ui,node_storm_runner,node_costorm_runner,node_article_viewer,node_user toneBlue
class node_curation,node_retriever,node_info_table,node_outline,node_article_generation,node_article_polish toneAmber
class node_warmstart,node_discourse,node_agents,node_grounded_qa,node_insertion,node_knowledge_base toneMint
class node_retrieval_models,node_lm_runtime,node_encoder toneRose
class node_article_files,node_web_search,node_llm_provider toneIndigo
```

## Components

### Orchestration and UI

- [Streamlit Demo](https://github.com/stanford-oval/storm/blob/main/frontend/demo_light/pages_util/CreateNewArticle.py): `frontend/demo_light/pages_util/CreateNewArticle.py`
- [STORM Runner](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/engine.py): `knowledge_storm/storm_wiki/engine.py`
- [Co-STORM Runner](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/engine.py): `knowledge_storm/collaborative_storm/engine.py`
- [Article Viewer](https://github.com/stanford-oval/storm/blob/main/frontend/demo_light/demo_util.py): `frontend/demo_light/demo_util.py`

### STORM Curation

- [Knowledge Curation](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/knowledge_curation.py): `knowledge_storm/storm_wiki/modules/knowledge_curation.py`
- [Source Retriever](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/retriever.py): `knowledge_storm/storm_wiki/modules/retriever.py`
- [Information Table](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/storm_dataclass.py): `knowledge_storm/storm_wiki/modules/storm_dataclass.py`
- [Outline Generation](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/outline_generation.py): `knowledge_storm/storm_wiki/modules/outline_generation.py`
- [Article Generation](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/article_generation.py): `knowledge_storm/storm_wiki/modules/article_generation.py`
- [Article Polishing](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/storm_wiki/modules/article_polish.py): `knowledge_storm/storm_wiki/modules/article_polish.py`

### Co-STORM Collaboration

- [Warm Start Research](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py): `knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py`
- [Discourse Manager](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/engine.py): `knowledge_storm/collaborative_storm/engine.py`
- [Co-STORM Agents](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/co_storm_agents.py): `knowledge_storm/collaborative_storm/modules/co_storm_agents.py`
- [Grounded Answers](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/grounded_question_answering.py): `knowledge_storm/collaborative_storm/modules/grounded_question_answering.py`
- [Information Insertion](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/collaborative_storm/modules/information_insertion_module.py): `knowledge_storm/collaborative_storm/modules/information_insertion_module.py`
- [Shared Knowledge Base](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/dataclass.py): `knowledge_storm/dataclass.py`

### Models and Retrieval

- [Retrieval Models](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/rm.py): `knowledge_storm/rm.py`
- [Language Models](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/lm.py): `knowledge_storm/lm.py`
- [Embedding Encoder](https://github.com/stanford-oval/storm/blob/main/knowledge_storm/encoder.py): `knowledge_storm/encoder.py`

### Article Artifacts

- [Article Files](https://github.com/stanford-oval/storm/blob/main/frontend/demo_light/demo_util.py): `frontend/demo_light/demo_util.py`

### Other components

- **Human User**
- **Web Search**
- **LLM Provider**

## Connections

- Human User → Streamlit Demo: submits topic
- Streamlit Demo → STORM Runner: runs research
- STORM Runner → Knowledge Curation: starts curation
- Knowledge Curation → Source Retriever: requests sources
- Source Retriever → Retrieval Models: executes queries
- Retrieval Models → Web Search: searches web
- Knowledge Curation → Information Table: collects evidence
- STORM Runner → Outline Generation: generates outline
- Outline Generation → Information Table: uses evidence
- STORM Runner → Article Generation: writes article
- Article Generation → Information Table: uses references
- STORM Runner → Article Polishing: polishes article
- Article Polishing → Article Files: writes result
- Article Viewer → Article Files: reads result
- Streamlit Demo → Article Viewer: shows result
- Co-STORM Runner → Warm Start Research: starts warmup
- Warm Start Research → Grounded Answers: answers questions
- Grounded Answers → Retrieval Models: retrieves grounding
- Warm Start Research → Shared Knowledge Base: initializes map
- Co-STORM Runner → Discourse Manager: manages turns
- Discourse Manager → Co-STORM Agents: selects agent
- Co-STORM Agents → Grounded Answers: requests answers
- Co-STORM Runner → Information Insertion: inserts turn
- Information Insertion → Shared Knowledge Base: updates map
- Shared Knowledge Base → Embedding Encoder: supports similarity
- Knowledge Curation → Language Models: prompts models
- Outline Generation → Language Models: prompts models
- Article Generation → Language Models: prompts models
- Article Polishing → Language Models: prompts models
- Co-STORM Agents → Language Models: prompts models
- Language Models → LLM Provider: calls models
