chenxiachan/thoughtdag

Your thinking deserves a map: an infinite canvas where LLM conversations grow into an editable thought graph. Wires are the context.

ThoughtDAG – A graph‑based UI for LLM conversations

What it is – ThoughtDAG is an open‑source desktop/web application that lets you treat each turn of an LLM chat as a node in a graph. Edges (called wires) define which previous turns are fed as context into the next request, so you can branch, prune, reconnect, or merge discussion paths without losing the underlying work.

Why it matters – Traditional chat windows are linear; ThoughtDAG gives you an infinite canvas where you can:

  • Explore side questions in separate branches.
  • Pull in relevant past turns from any local LLM session (Claude, Codex, DeepSeek Harness, Pi, etc.) via a built‑in index.
  • Use a lightweight decision model (Jev) to rank and select the most useful excerpts before sending them to the LLM.
  • Preview exactly what the model will receive, edit that context, and re‑run downstream nodes when upstream edits occur.

Key capabilities

Feature What you can do
Graph‑based context Connect/disconnect nodes to shape the prompt; the graph, not just visual layout, determines the model input.
Recall & relevance layer Optional Jev model ranks past excerpts; you can manually include/exclude them.
CLI tools thoughtdag find, thoughtdag topics, etc., let you search local conversation history from the terminal and jump to matching turns.
DeepSeek Harness plugin Use ThoughtDAG inside the DeepSeek Harness desktop app as a plug‑in, switching between plain chat and the graph canvas.
Document‑side‑by‑side Open PDFs, images or HTML alongside the canvas, clip passages/figures into nodes, and keep page references.
Condense & Weave Collapse a long branch into a short summary or generate a cited prose version that can be exported as Markdown.
Session Atlas Load a saved local agent session as a graph, browse its nodes, and continue the conversation from any point.
Export Thought Map Save the graph structure (nodes, edges, counts) without full text for sharing or analysis.
Per‑node model selection Run different LLM back‑ends on separate branches without changing the whole canvas.
Read‑only sharing Publish a graph for others to inspect while keeping the underlying data private.

Installation

  • Desktop app (macOS, Windows, Linux): brew install --cask thoughtdag or download from the website.
  • CLI: npm install -g thoughtdag then use thoughtdag commands; thoughtdag setup mcp exposes read‑only history tools for agents.
  • From source:
    git clone https://github.com/chenxiachan/thoughtdag.git
    cd thoughtdag
    npm install
    npm run dev   # frontend on :5173
    npm run server   # LLM proxy on :3001
    
  • Browser demo: https://app.thoughtdag.workers.dev (no API key needed, but limited features).

Typical workflow

  1. Connect a model – configure an OpenAI‑compatible endpoint, Ollama, or the provider used by DeepSeek Harness.
  2. Start a conversation – each turn appears as a node.
  3. Branch – select text in an answer, create a side node, explore independently.
  4. Recall – search your local index for related past turns, let Jev rank them, and add the chosen excerpts as wires.
  5. Preview – view the exact prompt that will be sent.
  6. Edit – prune or reconnect wires, condense long branches, or swap the model for a specific node.
  7. Export – save the canvas as a Thought Map or Markdown document.

Research angle – The repo includes a Context Intervention Benchmark showing how editing the graph (removing a wrong claim or its sub‑graph) can repair downstream model outputs. Results are presented as a case study, not a general leaderboard.

License & community – MIT‑licensed, active contributors, a roadmap, and a buy‑me‑a‑coffee link for support. Issues and feature requests are welcomed via the GitHub repo.


ThoughtDAG lets you treat LLM prompting as a mutable, visual data structure, giving you fine‑grained control over what the model sees while keeping the exploratory flow of a conversation.

Related

  • Dispatch
  • Project
  • Project
  • Project