spatial conversation engine

træk — follow ideas, not threads.

træk turns linear chats into a spatial canvas of branching conversations — built for AI-native products where reasoning is not linear.

Branch conversations without losing history
Navigate discussions like a map, not a log
Streaming-first & markdown aware
Live topology preview (read-only)

The problem with classic chat UIs

Most AI products still present long-form reasoning as a single scrolling thread. That works for quick answers — but breaks down as soon as conversations become exploratory, multi-directional, iterative, agent-driven, and reasoning-heavy.

Context gets buried, alternative paths are lost, and it becomes hard to see how a decision was reached.

If AI thinking branches, your UI shouldn’t stay flat.

possible paths

træk treats conversations as a navigable graph instead of a frozen log — so branching exploration is the default, not an edge-case.

What træk gives you

træk replaces the scrolling timeline with a spatial mental model of the conversation. Each message is a node; every reply is a direction you can branch, follow, or revisit.

  • Branching conversations — explore alternatives without overwriting the main path.
  • Readable layout — parents stay above, replies fan out horizontally as complexity grows.
  • Pan & zoom canvas — move through large dialogs like a diagram, not a log.
  • Thought nodes — attach system / reasoning steps without polluting the visible path.
  • Streaming-first — render tokens in place while keeping the topology intact.
Quick start
npm install traek
<script lang="ts">
  import {
    TraekCanvas,
    TraekEngine,
    DEFAULT_TRACK_ENGINE_CONFIG
  } from 'traek';

  const engine = new TraekEngine(DEFAULT_TRACK_ENGINE_CONFIG);

  // Canvas calls this with the text the user typed
  // and the node they're replying from (for branching).
  function onSendMessage(input, fromNode) {
    const userNode = engine.addNode(input, 'user', {
      parentIds: fromNode?.id ? [fromNode.id] : []
    });

    const assistantNode = engine.addNode('', 'assistant', {
      // Parent defaults to the active node (the new user message),
      // so replies naturally branch from the message you answered.
      autofocus: true
    });

    // stream chunks into assistantNode.content here...
  }

  <TraekCanvas {engine} {onSendMessage} />
</script>

Engine + canvas, cleanly separated

træk keeps the conversation graph and the UI as separate layers:

  • TraekEngine — owns nodes, relationships, layout logic, and state.
  • TraekCanvas — renders the spatial UI, pan/zoom, and interaction.

You stay in control of message creation, streaming, persistence, and model orchestration. træk keeps everything navigable and coherent.

Built for

  • AI chat products
  • agent interfaces
  • prompt exploration tools
  • research assistants
  • reasoning-heavy workflows
  • multi-path generation UIs

Drop-in integration

Use TraekCanvas as a ready-made UI, or wire TraekEngine into your own components and render messages your way.

Stop designing AI conversations as a single thread.

træk is under active development. Try the demos, drop it into your product, and shape how spatial AI conversations feel.