Graph-of-Thought

A deterministic runtime for typed reasoning graphs. The engine validates structure, propagates confidence, and surfaces contradictions. The LLM, when used at all, only turns text into a graph — it does not reason here.

These two snapshots were produced by the v0.1 Python engine, with no language model.

Scenario 1

Contradiction (basketball sandbox)

A goal, a solution, and two constraints. One relation is CONTRADICTS — the graph is invalid.

Invalid
Contradictions1
Thoughts4
Relations3
flowchart LR
    n0["I want to play basketball
goal · 0.30"] n1["I have a basketball
solution · 0.20"] n2["I love basketball
constraint · 0.80"] n3["I love sports
constraint · 0.80"] n0 -->|requires| n1 n1 -->|depends_on| n2 n2 -.->|contradicts| n3

What the engine found

  • Direct contradiction: I love basketball CONTRADICTS I love sports

Some paths exist but the reasoning contains inconsistencies.

Relations

  • I want to play basketball requires I have a basketball
  • I have a basketball depends_on I love basketball
  • I love basketball contradicts I love sports

Confidence after propagation

ThoughtTypeBeliefChange
I want to play basketballgoal
0.30
0.30
I have a basketballsolution
0.20
0.20
I love basketballconstraint
0.80
0.80
I love sportsconstraint
0.80
0.80
Raw GraphDTO / Mermaid
{
  "nodes": [
    {
      "id": "c2450db3-1376-4723-b0ac-d08d3854b7cf",
      "concept": "I want to play basketball",
      "node_type": "goal",
      "confidence": 0.3,
      "metadata": {}
    },
    {
      "id": "754d3d18-78c0-4aa4-9861-c93b3c69b80b",
      "concept": "I have a basketball",
      "node_type": "solution",
      "confidence": 0.2,
      "metadata": {}
    },
    {
      "id": "28957ad5-6ba7-4fc0-ab0e-ae2d37ec7f84",
      "concept": "I love basketball",
      "node_type": "constraint",
      "confidence": 0.8,
      "metadata": {}
    },
    {
      "id": "fbbdf506-cfc0-4f69-a667-7f5a7b67b653",
      "concept": "I love sports",
      "node_type": "constraint",
      "confidence": 0.8,
      "metadata": {}
    }
  ],
  "edges": [
    {
      "source_id": "c2450db3-1376-4723-b0ac-d08d3854b7cf",
      "target_id": "754d3d18-78c0-4aa4-9861-c93b3c69b80b",
      "relation_type": "requires",
      "confidence": 0.5,
      "metadata": {}
    },
    {
      "source_id": "754d3d18-78c0-4aa4-9861-c93b3c69b80b",
      "target_id": "28957ad5-6ba7-4fc0-ab0e-ae2d37ec7f84",
      "relation_type": "depends_on",
      "confidence": 0.5,
      "metadata": {}
    },
    {
      "source_id": "28957ad5-6ba7-4fc0-ab0e-ae2d37ec7f84",
      "target_id": "fbbdf506-cfc0-4f69-a667-7f5a7b67b653",
      "relation_type": "contradicts",
      "confidence": 0.5,
      "metadata": {}
    }
  ],
  "metadata": {}
}
flowchart LR
    n0["I want to play basketball<br/>goal · 0.30"]
    n1["I have a basketball<br/>solution · 0.20"]
    n2["I love basketball<br/>constraint · 0.80"]
    n3["I love sports<br/>constraint · 0.80"]
    n0 -->|requires| n1
    n1 -->|depends_on| n2
    n2 -.->|contradicts| n3

Scenario 2

Epistemic propagation (rain → wet grass)

Rain supports wet grass. Epistemic propagation raises belief in the supported node.

Valid
Contradictions0
Thoughts2
Relations1
flowchart LR
    n0["Rain
fact · 0.90"] n1["Wet grass
concept · 0.60"] n0 -->|supports| n1

What the engine found

No structural violations.

Some paths exist but the reasoning contains inconsistencies.

Relations

  • Rain supports Wet grass

Confidence after propagation

ThoughtTypeBeliefChange
Rainfact
0.90
0.90
Wet grassconcept
0.60
↑ 0.50 → 0.60
Raw GraphDTO / Mermaid
{
  "nodes": [
    {
      "id": "68d0777a-8117-4593-bb14-4fc67db46ba0",
      "concept": "Rain",
      "node_type": "fact",
      "confidence": 0.9,
      "metadata": {}
    },
    {
      "id": "f9235061-602a-451f-b104-c538ec8f97e7",
      "concept": "Wet grass",
      "node_type": "concept",
      "confidence": 0.6,
      "metadata": {}
    }
  ],
  "edges": [
    {
      "source_id": "68d0777a-8117-4593-bb14-4fc67db46ba0",
      "target_id": "f9235061-602a-451f-b104-c538ec8f97e7",
      "relation_type": "supports",
      "confidence": 0.5,
      "metadata": {}
    }
  ],
  "metadata": {}
}
flowchart LR
    n0["Rain<br/>fact · 0.90"]
    n1["Wet grass<br/>concept · 0.60"]
    n0 -->|supports| n1