<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Xia Chen</title>
    <description>The latest articles on DEV Community by Xia Chen (@chenxiachan).</description>
    <link>https://dev.to/chenxiachan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4048034%2F7b28c2c3-94d8-4d6e-aa74-e10bc1081d78.jpg</url>
      <title>DEV Community: Xia Chen</title>
      <link>https://dev.to/chenxiachan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chenxiachan"/>
    <language>en</language>
    <item>
      <title>I made LLM context editable: a graph where the wires are the prompt</title>
      <dc:creator>Xia Chen</dc:creator>
      <pubDate>Sun, 26 Jul 2026 14:26:56 +0000</pubDate>
      <link>https://dev.to/chenxiachan/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt-2afl</link>
      <guid>https://dev.to/chenxiachan/i-made-llm-context-editable-a-graph-where-the-wires-are-the-prompt-2afl</guid>
      <description>&lt;p&gt;Most LLM interfaces present a conversation as a transcript.&lt;/p&gt;

&lt;p&gt;That works until the conversation branches.&lt;/p&gt;

&lt;p&gt;One 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.&lt;/p&gt;

&lt;p&gt;I wanted to make that state editable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wires are the context
&lt;/h2&gt;

&lt;p&gt;I built an open-source prototype called ThoughtDAG.&lt;/p&gt;

&lt;p&gt;Every 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.&lt;/p&gt;

&lt;p&gt;When 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.&lt;/p&gt;

&lt;p&gt;Delete an edge and regenerate the same prompt, and the deleted branch is no longer part of the model's context.&lt;/p&gt;

&lt;p&gt;[Insert the edge-deletion GIF here]&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a DAG?
&lt;/h2&gt;

&lt;p&gt;I did not want an autonomous system that silently reorganized the user's ideas.&lt;/p&gt;

&lt;p&gt;The 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.&lt;/p&gt;

&lt;p&gt;This makes three operations explicit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;branching: explore an alternative without modifying the original path;&lt;/li&gt;
&lt;li&gt;merging: synthesize several selected branches;&lt;/li&gt;
&lt;li&gt;pruning: remove irrelevant context before regenerating an answer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The graph is therefore not an agent workflow. It is a visible, human-controlled representation of model memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local-first by default
&lt;/h2&gt;

&lt;p&gt;The canvas is stored in IndexedDB in the browser. There is no account or hosted database.&lt;/p&gt;

&lt;p&gt;ThoughtDAG 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.&lt;/p&gt;

&lt;p&gt;The project is MIT licensed and built with React, TypeScript, React Flow, Zustand, Express, and the Vercel AI SDK.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/chenxiachan/thoughtdag" rel="noopener noreferrer"&gt;https://github.com/chenxiachan/thoughtdag&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 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.&lt;/p&gt;

&lt;p&gt;I would be interested in critiques of that interaction model, especially from people building long-running LLM interfaces.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>showdev</category>
      <category>opensource</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
