{"slug": "i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt", "title": "I made LLM context editable: a graph where the wires are the prompt", "summary": "A developer built ThoughtDAG, an open-source prototype that represents LLM conversations as a directed acyclic graph where edges determine which upstream nodes are included in the model's context. The tool allows users to manually edit context by deleting edges, making model memory visible and human-controlled rather than delegated to retrieval or agents.", "body_md": "Most LLM interfaces present a conversation as a transcript.\n\nThat works until the conversation branches.\n\nOne branch contains useful research. Another is a discarded hypothesis. A third is an unrelated detour. The interface may show where they came from, but the user often cannot see exactly which branches will be included in the model's next request.\n\nI wanted to make that state editable.\n\nI built an open-source prototype called ThoughtDAG.\n\nEvery question-and-answer exchange is a node on an infinite canvas. An edge is not merely a visual relationship: it determines which upstream nodes are included when the next request is constructed.\n\nWhen a user asks from a node, ThoughtDAG walks its incoming graph, orders the relevant ancestors, and turns them into the message sequence sent to the selected model.\n\nDelete an edge and regenerate the same prompt, and the deleted branch is no longer part of the model's context.\n\n[Insert the edge-deletion GIF here]\n\nI did not want an autonomous system that silently reorganized the user's ideas.\n\nThe graph is directed because context flows from earlier reasoning into later reasoning. It is acyclic because a node should not recursively include itself in its own history.\n\nThis makes three operations explicit:\n\nThe graph is therefore not an agent workflow. It is a visible, human-controlled representation of model memory.\n\nThe canvas is stored in IndexedDB in the browser. There is no account or hosted database.\n\nThoughtDAG can connect to Ollama for local inference, or to an arbitrary OpenAI-compatible endpoint. PDFs remain on the user's machine; only extracted text is sent when a remote model is deliberately used.\n\nThe project is MIT licensed and built with React, TypeScript, React Flow, Zustand, Express, and the Vercel AI SDK.\n\nRepo: [https://github.com/chenxiachan/thoughtdag](https://github.com/chenxiachan/thoughtdag)\n\nThe question I am testing now is whether people actually want to control context manually, or whether they would rather delegate memory selection to retrieval and agents.\n\nI would be interested in critiques of that interaction model, especially from people building long-running LLM interfaces.", "url": "https://wpnews.pro/news/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt", "canonical_source": "https://dev.to/chenxiachan/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt-2afl", "published_at": "2026-07-26 14:26:56+00:00", "updated_at": "2026-07-26 14:59:59.590585+00:00", "lang": "en", "topics": ["large-language-models", "developer-tools", "ai-tools", "ai-agents"], "entities": ["ThoughtDAG", "Ollama", "OpenAI", "React", "TypeScript", "React Flow", "Zustand", "Vercel AI SDK"], "alternates": {"html": "https://wpnews.pro/news/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt", "markdown": "https://wpnews.pro/news/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt.md", "text": "https://wpnews.pro/news/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt.txt", "jsonld": "https://wpnews.pro/news/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt.jsonld"}}