STORM
STORM is an LLM system that writes Wikipedia-like articles from scratch based on Internet search. It solves the problem of automating the research and writing process for long articles with citations. It is for developers and researchers who want to generate comprehensive, cited articles on any topic.
✨ Key features
- Breaks down article generation into pre-writing and writing stages.
- Uses perspective-guided question asking and simulated conversations for research.
- Supports multiple language models via litellm integration.
- Integrates various search engines and retrievers (e.g., You.com, Bing).
- Co-STORM enables human-AI collaborative knowledge curation.
- Modular design using dspy for easy customization.
🎯 Use cases
- Generate Wikipedia-style articles on any topic.
- Assist in pre-writing stage for Wikipedia editors.
- Explore a topic through simulated expert conversations.
- Collaboratively curate knowledge with human-AI discourse.
- Ground article generation on user-provided documents.
📦 Installation
🧰 Requirements: Python 3.11, API keys for language models (e.g., OpenAI) and search engines (e.g., Bing, You.com) as needed.
To install the knowledge storm library, use pip install knowledge-storm.
You could also install the source code which allows you to modify the behavior of STORM engine directly.
- Clone the git repository.
git clone https://github.com/stanford-oval/storm.git
cd storm
- Install the required packages.
conda create -n storm python=3.11
conda activate storm
pip install -r requirements.txt
🚀 Usage
import os
from knowledge_storm import STORMWikiRunnerArguments, STORMWikiRunner, STORMWikiLMConfigs
from knowledge_storm.lm import LitellmModel
from knowledge_storm.rm import YouRM
lm_configs = STORMWikiLMConfigs()
openai_kwargs = {
'api_key': os.getenv("OPENAI_API_KEY"),
'temperature': 1.0,
'top_p': 0.9,
}
gpt_35 = LitellmModel(model='gpt-3.5-turbo', max_tokens=500, **openai_kwargs)
gpt_4 = LitellmModel(model='gpt-4o', max_tokens=3000, **openai_kwargs)
lm_configs.set_conv_simulator_lm(gpt_35)
lm_configs.set_question_asker_lm(gpt_35)
lm_configs.set_outline_gen_lm(gpt_4)
lm_configs.set_article_gen_lm(gpt_4)
lm_configs.set_article_polish_lm(gpt_4)
engine_args = STORMWikiRunnerArguments(...)
rm = YouRM(ydc_api_key=os.getenv('YDC_API_KEY'), k=engine_args.search_top_k)
runner = STORMWikiRunner(engine_args, lm_configs, rm)
topic = input('Topic: ')
runner.run(
topic=topic,
do_research=True,
do_generate_outline=True,
do_generate_article=True,
do_polish_article=True,
)
runner.post_run()
runner.summary()
⚠️ Good to know
The system cannot produce publication-ready articles that often require a significant number of edits; it is helpful in the pre-writing stage.
❓ FAQ
What language models are supported?
All language models supported by litellm are supported, including OpenAI models like GPT-3.5 and GPT-4o.
What retrieval modules are available?
The package supports YouRM, BingSearch, VectorRM, SerperRM, BraveRM, SearXNG, DuckDuckGoSearchRM, TavilySearchRM, GoogleSearch, and AzureAISearch.
Can I use my own documents for grounding?
Yes, VectorRM supports grounding on user-provided documents.
How do I run Co-STORM?
You can run Co-STORM using the example script: python examples/costorm_examples/run_costorm_gpt.py --output-dir $OUTPUT_DIR --retriever bing after setting up API keys in secrets.toml.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.