{"id":51224796,"url":"https://github.com/saagpatel/thought-trails","last_synced_at":"2026-06-28T10:03:11.849Z","repository":{"id":366076427,"uuid":"1188653430","full_name":"saagpatel/thought-trails","owner":"saagpatel","description":"Visualize LLM chain-of-thought as a live D3 force graph — watch reasoning emerge node by node","archived":false,"fork":false,"pushed_at":"2026-06-20T05:35:17.000Z","size":958,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T07:16:08.838Z","etag":null,"topics":["d3","llm","ollama","react","rust","tauri","typescript","visualization"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saagpatel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-22T11:54:47.000Z","updated_at":"2026-06-20T05:35:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/saagpatel/thought-trails","commit_stats":null,"previous_names":["saagpatel/thought-trails"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/saagpatel/thought-trails","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Fthought-trails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Fthought-trails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Fthought-trails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Fthought-trails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saagpatel","download_url":"https://codeload.github.com/saagpatel/thought-trails/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saagpatel%2Fthought-trails/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34884278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["d3","llm","ollama","react","rust","tauri","typescript","visualization"],"created_at":"2026-06-28T10:03:11.406Z","updated_at":"2026-06-28T10:03:11.841Z","avatar_url":"https://github.com/saagpatel.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thought-trails\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-3178c6?style=flat-square\u0026logo=typescript\u0026logoColor=white)](#) [![Rust](https://img.shields.io/badge/Rust-dea584?style=flat-square\u0026logo=rust\u0026logoColor=white)](#) [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](#)\n\n\u003e A model's chain-of-thought isn't a wall of text — it's a graph. thought-trails makes you see it that way\n\nthought-trails connects to a local Ollama instance, streams reasoning tokens in real time, and parses the `\u003cthink\u003e` block into a live D3 force-directed graph. Claims, evidence, backtracks, and conclusions appear as typed nodes the moment they're generated. Watch a model's reasoning structure emerge as it thinks.\n\n## Features\n\n- **Live graph** — submits a prompt to any local Ollama model and renders the chain-of-thought as a D3 force-directed graph, one node at a time as tokens stream in\n- **Typed nodes** — claims (blue), evidence (green), backtracks (orange), and conclusions (purple) parsed by a heuristic Rust streaming parser\n- **Comparison mode** — run the same prompt against two models side by side and compare their reasoning graphs\n- **Replay** — replay any completed session at 0.5×, 1×, 2×, or 4× speed with a scrub slider\n- **Search** — Cmd+F to search node text; matching nodes highlight and collapsed parents auto-expand\n- **Export** — download the current graph as a standalone SVG or a full JSON snapshot (nodes, edges, event log, metadata)\n- **Session history** — sessions persist locally across app restarts and are accessible from the sidebar\n\n## Quick Start\n\n### Prerequisites\n\n- Rust stable toolchain (via [rustup](https://rustup.rs))\n- Node.js 20+\n- [Ollama](https://ollama.com) running locally on port 11434\n- A reasoning model pulled, e.g. `ollama pull deepseek-r1:14b`\n- macOS (built as a native macOS desktop app)\n\n### Installation\n\n```bash\ngit clone https://github.com/saagpatel/thought-trails.git\ncd thought-trails\nnpm install\n```\n\n### Usage\n\n```bash\n# Start Ollama (if not already running)\nollama serve\n\n# Development mode\nnpm run tauri dev\n\n# Run tests\nnpm test\n\n# Production build\nnpm run tauri build\n```\n\n## Tech Stack\n\n| Layer | Technology |\n|-------|------------|\n| Desktop shell | Tauri 2 |\n| Frontend | React 18, TypeScript 5.7 |\n| Graph rendering | D3.js 7 (force-directed) |\n| Styling | Tailwind CSS 4 |\n| Build | Vite 6 |\n| Backend | Rust (reqwest streaming, heuristic CoT parser) |\n| LLM runtime | Ollama (local, any model) |\n| Tests | Vitest + Testing Library |\n\n## Architecture\n\nThe Rust backend streams tokens from Ollama's HTTP API using `reqwest` with chunked transfer encoding and forwards parsed node events to the frontend via Tauri's event system. The heuristic CoT parser runs on the Rust side — it buffers incoming tokens, detects sentence boundaries, and classifies each span into a node type using pattern matching against a small rule set. The D3 simulation runs entirely in the browser; nodes are added incrementally without restarting the layout, so the graph evolves smoothly as reasoning progresses.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaagpatel%2Fthought-trails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaagpatel%2Fthought-trails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaagpatel%2Fthought-trails/lists"}