<?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: zuoxi</title>
    <description>The latest articles on DEV Community by zuoxi (@zuoxixuan0cmyk).</description>
    <link>https://dev.to/zuoxixuan0cmyk</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%2F4106454%2Ff52b7da4-3285-431c-85ac-0f6ecbada16d.jpg</url>
      <title>DEV Community: zuoxi</title>
      <link>https://dev.to/zuoxixuan0cmyk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zuoxixuan0cmyk"/>
    <language>en</language>
    <item>
      <title>Chat History Is Not Project State</title>
      <dc:creator>zuoxi</dc:creator>
      <pubDate>Wed, 02 Sep 2026 15:46:54 +0000</pubDate>
      <link>https://dev.to/zuoxixuan0cmyk/chat-history-is-not-project-state-2p97</link>
      <guid>https://dev.to/zuoxixuan0cmyk/chat-history-is-not-project-state-2p97</guid>
      <description>&lt;p&gt;While building long-running AI projects, I kept running into a failure that did not look like a memory problem at first.&lt;/p&gt;

&lt;p&gt;The model could remember what had been discussed. The conversation history was still there. The problem was that a later session could no longer tell which parts of that history represented the project’s actual state.&lt;/p&gt;

&lt;p&gt;That is a different failure.&lt;/p&gt;

&lt;p&gt;A system can remember a lot and still be wrong about what the project currently holds.&lt;/p&gt;

&lt;h2&gt;
  
  
  A simple cross-session failure
&lt;/h2&gt;

&lt;p&gt;Consider a fictional project.&lt;/p&gt;

&lt;p&gt;On Friday, the project ends with a clear decision:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Current state: A
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Monday, there is a long follow-up conversation about an alternative, B.&lt;/p&gt;

&lt;p&gt;B gets most of the attention. The user asks several questions about it. The model compares B with A, explores consequences, and works through possible reasons to switch.&lt;/p&gt;

&lt;p&gt;But no decision is made.&lt;/p&gt;

&lt;p&gt;The project still formally holds A.&lt;/p&gt;

&lt;p&gt;Then, on Wednesday, a fresh invocation begins. The recent context contains much more discussion of B than A. If the system treats conversational recency as authority, it may answer as though the project has already moved to B.&lt;/p&gt;

&lt;p&gt;Nothing important was forgotten.&lt;/p&gt;

&lt;p&gt;The system simply failed to distinguish &lt;strong&gt;what was discussed&lt;/strong&gt; from &lt;strong&gt;what was adopted&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is the distinction I now treat explicitly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Conversation ≠ Current State
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Conversation is context. It can contain useful evidence, unfinished thinking, speculation, abandoned options, and old conclusions.&lt;/p&gt;

&lt;p&gt;Current state has a narrower job: it tells a later invocation what the project formally holds now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why better memory does not solve this by itself
&lt;/h2&gt;

&lt;p&gt;It is tempting to describe this as a memory problem.&lt;/p&gt;

&lt;p&gt;Sometimes it is. If the system cannot retrieve earlier information, better memory helps.&lt;/p&gt;

&lt;p&gt;But retrieval and authority are different questions.&lt;/p&gt;

&lt;p&gt;A memory system asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can I find the information again?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A state system also has to ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which information should govern the next run?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine a system that can retrieve every prior message perfectly.&lt;/p&gt;

&lt;p&gt;It remembers that A was accepted.&lt;/p&gt;

&lt;p&gt;It remembers that B was discussed.&lt;/p&gt;

&lt;p&gt;It remembers ten arguments for B and three objections.&lt;/p&gt;

&lt;p&gt;It still needs some way to know that B was never adopted.&lt;/p&gt;

&lt;p&gt;More memory can actually make this harder if all retrieved information is presented with roughly the same weight.&lt;/p&gt;

&lt;p&gt;The failure is no longer “I cannot remember enough.”&lt;/p&gt;

&lt;p&gt;It becomes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I remember several incompatible things, but I do not know which one has current authority.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What I mean by an explicit Current
&lt;/h2&gt;

&lt;p&gt;I use &lt;strong&gt;Current&lt;/strong&gt; as a narrow semantic role.&lt;/p&gt;

&lt;p&gt;It is not a full memory store. It is not a summary of the whole project. It is not a claim that the system knows objective truth.&lt;/p&gt;

&lt;p&gt;It answers one operational question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What does the project formally hold right now?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The implementation can be simple.&lt;/p&gt;

&lt;p&gt;A small project might keep a short state file. Another system might use a database record or platform-native storage. The storage mechanism matters less than the responsibility boundary.&lt;/p&gt;

&lt;p&gt;The important part is that a later invocation does not have to infer formal state from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the most recent message;&lt;/li&gt;
&lt;li&gt;the longest discussion;&lt;/li&gt;
&lt;li&gt;whichever idea appears most often;&lt;/li&gt;
&lt;li&gt;or whatever happens to be near the end of the context window.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the formal state changes, there should be a reason for that change.&lt;/p&gt;

&lt;p&gt;Discussion alone is not enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  State authority is not the same as truth
&lt;/h2&gt;

&lt;p&gt;There is another subtle point.&lt;/p&gt;

&lt;p&gt;Suppose Current says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Current state: B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means B is the project’s formal working state.&lt;/p&gt;

&lt;p&gt;It does &lt;strong&gt;not&lt;/strong&gt; mean B is guaranteed to still match the outside world.&lt;/p&gt;

&lt;p&gt;If the project has been inactive for two weeks, B may be stale.&lt;/p&gt;

&lt;p&gt;That creates a separate recovery problem: first restore where the project left off, then check whether reality has changed.&lt;/p&gt;

&lt;p&gt;I keep those operations separate because otherwise persistence quietly turns into certainty.&lt;/p&gt;

&lt;p&gt;A saved state can be valid as a record of what the project knew and still need revalidation before being treated as fresh reality.&lt;/p&gt;

&lt;h2&gt;
  
  
  This also changes how I think about persistence
&lt;/h2&gt;

&lt;p&gt;Once Current is explicit, another question becomes easier to ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does this run actually need to change persistent state?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not every useful conversation does.&lt;/p&gt;

&lt;p&gt;The Monday discussion about B may be valuable in the moment and still produce no formal update.&lt;/p&gt;

&lt;p&gt;That is fine.&lt;/p&gt;

&lt;p&gt;A run can answer questions, explore alternatives, or confirm that nothing material changed.&lt;/p&gt;

&lt;p&gt;Persistence should not happen just because something new appeared in the conversation.&lt;/p&gt;

&lt;p&gt;This is one reason I no longer treat “save more” as a default improvement.&lt;/p&gt;

&lt;p&gt;Selective persistence is often safer than comprehensive persistence.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you probably do not need this
&lt;/h2&gt;

&lt;p&gt;For many AI tasks, none of this is necessary.&lt;/p&gt;

&lt;p&gt;If the task is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one-off;&lt;/li&gt;
&lt;li&gt;short-lived;&lt;/li&gt;
&lt;li&gt;contained in one session;&lt;/li&gt;
&lt;li&gt;easy to restart from scratch;&lt;/li&gt;
&lt;li&gt;or not dependent on a stable project state;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then conversation history may be perfectly adequate.&lt;/p&gt;

&lt;p&gt;Adding an explicit state model would only create overhead.&lt;/p&gt;

&lt;p&gt;The distinction becomes useful when future invocations need to continue from a stable interpretation of the project rather than simply continue the conversation.&lt;/p&gt;

&lt;p&gt;That is the threshold I care about.&lt;/p&gt;

&lt;h2&gt;
  
  
  The broader pattern
&lt;/h2&gt;

&lt;p&gt;Once I started looking at this as a state-authority problem, similar boundaries appeared elsewhere.&lt;/p&gt;

&lt;p&gt;Recovering the last saved state is not the same as proving that it still matches current reality.&lt;/p&gt;

&lt;p&gt;Learning something during a run is not the same as changing the production rules that govern future runs.&lt;/p&gt;

&lt;p&gt;Historical material can remain valuable without belonging in every runtime context.&lt;/p&gt;

&lt;p&gt;These are related problems, but I do not think they need to be solved by one giant “memory framework.”&lt;/p&gt;

&lt;p&gt;For me, the useful move was smaller: separate responsibilities first, then add mechanisms only when an observed failure justifies them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I am documenting the rest
&lt;/h2&gt;

&lt;p&gt;I have been turning these design decisions into a small set of public notes covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the problem model;&lt;/li&gt;
&lt;li&gt;responsibility boundaries;&lt;/li&gt;
&lt;li&gt;persistence and recovery;&lt;/li&gt;
&lt;li&gt;synthetic worked examples;&lt;/li&gt;
&lt;li&gt;testing long-running behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repository is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/zuoxixuan0-cmyk/long-running-ai-project-design" rel="noopener noreferrer"&gt;Long-Running AI Project Design&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The public notes stay at the design level. They do not include production prompts, schemas, state, business logic, or implementation-specific fixtures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing thought
&lt;/h2&gt;

&lt;p&gt;For short AI interactions, “memory” is often a good enough abstraction.&lt;/p&gt;

&lt;p&gt;For long-running projects, I have found it too broad.&lt;/p&gt;

&lt;p&gt;The system needs to know not only what it can remember, but what that remembered information is allowed to mean.&lt;/p&gt;

&lt;p&gt;That is why I now treat project state as a separate design problem from chat history.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>architecture</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
