Thought Tree: an open 'cognitive programming' framework for modular LLM workflows

Robert Bateman publishes the Thought Tree framework on GitHub as an open 'handoff': an XML schema (TTML) to describe LLM flows as graphs of artifacts and operations. The project, still unfinished, hopes others will carry it on after the author's burnout.
By GitHub (RobertBateman/thoughttree-framework) · June 27, 2026.
Robert Bateman has published on GitHub the `thoughttree-framework` repository, a conceptual and partially prototyped proposal for what he calls «cognitive programming» with LLMs. The project is not a finished product: the author himself explicitly labels it a *handoff release*, that is, an open delivery for the community to pick up, critique, fork or reimplement, given that he cannot continue due to family and work commitments and recovery from burnout.
**The core idea: Data Units → Operations → Data Units**
The core of the framework is surprisingly simple in its abstraction: all cognitive work assisted by LLMs can be described as a graph of transformations over named artifacts. A *Data Unit* is any discrete artifact (source document, requirements record, chapter draft, review report). An *Operation* transforms one or more Data Units into new Data Units. A *Module* groups operations into a reusable cognitive program. A *Cognitive Engine* would be the compiler and runtime that executes that graph.
Unlike a simple prompt or a chain of LLM calls, Thought Tree aims to make every step of the process explicit, inspectable and traceable: every intermediate artifact is recorded, every operation has declared inputs and outputs, and the system can mix LLMs, deterministic functions, external tools and human review within the same flow.
**TTML: Thought Tree Markup Language**
The concrete representation proposed is TTML, an XML format. The README includes a minimal working example: an article-summary module with three sequential operations (DraftSummary → ReviewSummary → ReviseSummary), where each operation declares its input FileRefs and its output artifact. The author acknowledges that TTML is only one possible representation and that alternative formats (YAML, JSON, visual graphs) are perfectly viable over the same underlying model, called the *Thought Tree Program Model*.
The TTML specification is at draft version 0.12.0, with no stable schema or reference importer.
**Actual state of the project: honest and concise**
Bateman is explicit about what is missing, and the list is long: a stable TTML schema, a TTML importer, a reference cognitive engine, a CLI runner, an execution-graph compiler, iterator and collection resolution, output-collision detection, an execution-trace format, a semantic-contracts format, a validation system, a module registry, conformance tests, authoring tools, visualization, a security and governance model, and a production implementation.
There are two partial prototypes, both in C#/Unity: - An early *proof of concept* that does not use TTML but rather a hardcoded array of prompts, yet which demonstrated that the pipeline model could generate a 50,000-word novel from a 500-word description. - A later Cognitive Engine prototype that can connect to Anthropic, OpenAI and local LLMs via KoboldCPP, and runs basic TextCompletion operations, but lacks a stable TTML importer, graph compilation, contracts, validation gates or a trace system.
The repository has 3 stars, 0 forks and 0 issues at the time of its publication on Hacker News, with 1 point and 0 comments. It is a very early-stage project.
**Note on GPT-5.5**
The author explicitly mentions that GPT-5.5 assisted him with the documentation and with adding the concepts of semantic contracts and collections to the framework. This is a notable contextual detail for the date (June 2026), informing about the tools available for projects of this kind.
**Stated differences from existing frameworks**
Bateman compares Thought Tree with several approaches: - *Versus simple prompts*: a prompt asks for an answer; Thought Tree defines the process by which that answer should be produced, reviewed, corrected and traced. - *Versus prompt chains*: chains connect model calls but without named artifacts, explicit dependencies, validation or traces. - *Versus autonomous agents*: agents are flexible but hard to predict, debug or audit; Thought Tree favors explicit structure: defined process → inspectable plan → controlled execution → preserved artifacts → traceable output. Dynamic planning is possible, but the generated plans must be validated and recorded. - *Versus traditional workflow tools*: these are good for deterministic processes; Thought Tree is designed for hybrid cognitive work where LLMs handle semantic ambiguity and code handles structure.
The author invites comparison of Thought Tree with LangGraph, AutoGen, CrewAI, Semantic Kernel and other agent frameworks, acknowledging that he has not done that comparison in depth.
**Proposed use cases**
The README lists several use cases for complex cognitive tasks where quality, traceability and iteration matter: turning scattered notes into formal documentation, generating technical design documents, recovering knowledge from legacy projects, preparing audit or regulatory-compliance packages, generating and reviewing creative content, writing long-form fiction, extracting requirements from source documents, producing recurring research reports, and generating and improving other Thought Tree modules.
**Repository structure**
The repository includes extensive conceptual documentation (README, HANDOFF.md, STATUS.md, ROADMAP.md, CONTRIBUTING.md, GOVERNANCE.md), a `docs/` folder with explainers on architecture, the program model, execution semantics, semantic contracts and an authoring guide, a `spec/` folder with TTML drafts and XSD and JSON schemas, an `examples/` folder with workflow examples (article summary, novel generation, TDD for a video game, compliance-gap analysis), and a `prototypes/` folder with the two Unity prototypes. The code license is MIT; the documentation and specification are CC0.
**Implications for agentic AI**
In general, the problem Thought Tree tries to address is real and recognized in the industry: LLM workflows for complex cognitive tasks tend to be fragile, opaque and hard to audit. The trend toward explicit representations of agent graphs (visible in frameworks like LangChain's LangGraph, or Anthropic's Model Context Protocol) points in a similar direction: separating the definition of the flow from its execution, and making intermediate artifacts inspectable.
What distinguishes Bateman's proposal is the emphasis on named cognitive artifacts (documents, records, drafts) as first-class citizens of the program, and the aspiration to model-provider independence through a separate cognitive engine. The analogy with a compiler (the Cognitive Engine as compiler and runtime of cognitive programs) is conceptually clean.
However, the project faces the usual challenge of «new language/framework» proposals: it needs critical mass of adoption to validate the design, and to compete with already established ecosystems (LangChain, AutoGen, CrewAI, Semantic Kernel) that have active communities, funding and thousands of integrations.
**Honest assessment**
With 3 stars, 0 forks and an author who is stepping away, Thought Tree is currently a well-articulated conceptual proposal but without traction. Its immediate value is as an intellectual reference point for designers of cognitive workflows, not as a production-ready tool. The decision to release it under CC0 and MIT, with honest documentation about its state, is a commendable practice that at least preserves the ideas so that others can build on them or draw inspiration from them.