Graph of Thoughts (GoT) is a Python framework that models problems as a Graph of Operations executed by an LLM, with examples for sorting and configurable prompting. It provides setup steps, sample code, and two GoT variants (cot and got) to compare results.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
Official implementation of Graph of Thoughts: Solving Elaborate Problems with Large Language Models. Framework models problems as a Graph of Operations (GoO) executed by an LLM engine. Flexible and extensible for GoT or GoOs resembling CoT or ToT.
How it works
Construct a Graph of Operations, including generation, scoring, and grounding operations. Use a Language Model (e.g., ChatGPT) configured via a config.json. Run a Controller with a prompter and parser to produce an output graph (JSON) representing the final thought states and scores.
Getting started
Setup requires Python 3.8+. Installation options:
- Quick install from PyPI: ```bash pip install graph_of_thoughts
- Editable source install: ```bash
git clone https://github.com/spcl/graph-of-thoughts.git
cd graph-of-thoughts
pip install -e .
Configure LLM as described in the Controller README: graph_of_thoughts/controller/README.md.
Recent releases
Latest releases:
- v0.0.2 (2023-09-26)
- v0.0.1 (2023-08-23)
Traction
Not provided in this repository facts beyond overall stars and forks: 2831 stars, 216 forks.
Caveats
License not listed. Repository created 2023-08-18 and last push 2026-03-24. Language: Python. Open issues: 7.
Examples
Code examples show two usage modes:
- CoT-like approach using Generate, Score, GroundTruth operations and SortingPrompter/SortingParser.
- GoT approach retrieving the Graph of Operations via got() and configuring initial state with phase and method.
Sample usage snippets are provided exactly as in the README, including environment setup and how to run scripts:
pip install graph_of_thoughts
- ```bash
git clone https://github.com/spcl/graph-of-thoughts.git
cd graph-of-thoughts
pip install -e .
- Example code blocks demonstrating constructing gop, lm, and ctrl objects and running ctrl.run().
Code examples
The README includes Python snippets for running sorting with CoT and GoT, configuring the LM from a config.json, and outputting graphs (output_cot.json, output_got.json).






