← all repositories
spcl/graph-of-thoughts

When chain-of-thought is too linear, use a graph

It generalizes chain-of-thought and tree-of-thought by letting you structure elaborate LLM reasoning as an executable graph of operations.

graph-of-thoughts
Not currently ranked — collecting fresh signals.
star history

What it does Graph of Thoughts is a Python framework that treats problem-solving with LLMs as a graph traversal. You build a Graph of Operations by appending steps such as Generate, Score, or GroundTruth, and a Controller executes the graph automatically using an LLM as the backend engine. The output is a serialized graph of thought states—complete with scores—that you can inspect and compare. The repo includes the sorting and keyword-counting examples from the original AAAI paper, fully documented.

The interesting bit The framework treats chain-of-thought and tree-of-thought as special cases of a general Graph of Operations, letting you structure LLM reasoning in arbitrary topologies instead of linear strings. That shifts the hard work from prompt wording to graph design—essentially turning prompt engineering into a topological problem.

Key highlights

  • Generalizes chain-of-thought and tree-of-thought by expressing any reasoning pattern as a directed graph of operations.
  • Includes documented examples such as sorting and keyword counting, plus raw paper results for replotting.
  • Supports swapping the LLM backend via the Controller; the README points to configuration instructions for your own model.
  • Emits a serialized output graph of thought states with scores after every run, so you can inspect or diff entire reasoning traces.
  • Heavily documented codebase, with detailed READMEs for the Controller and Operations modules.

Caveats

  • The framework is an execution engine, not a model itself; you must bring your own LLM API access and configuration.
  • The quickstart assumes an OpenAI-style config.json with an API key, so getting started is not fully plug-and-play for other providers.
  • Most of the sophisticated GoT logic in the examples is hidden inside helper functions like got(), so you have to dig into the example source to understand advanced graph layouts.

Verdict Worth a look if you are researching structured LLM reasoning or want to experiment with non-linear prompting topologies beyond simple chains. Skip it if you need a drop-in chatbot or a model that runs without external API keys.

Frequently asked

What is spcl/graph-of-thoughts?
It generalizes chain-of-thought and tree-of-thought by letting you structure elaborate LLM reasoning as an executable graph of operations.
Is graph-of-thoughts open source?
Yes — spcl/graph-of-thoughts is an open-source project tracked on heatdrop.
What language is graph-of-thoughts written in?
spcl/graph-of-thoughts is primarily written in Python.
How popular is graph-of-thoughts?
spcl/graph-of-thoughts has 2.8k stars on GitHub.
Where can I find graph-of-thoughts?
spcl/graph-of-thoughts is on GitHub at https://github.com/spcl/graph-of-thoughts.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.