Your Database Is Not the World
CRUD changes records. Agent-ready apps also need to change their minds.
Robot Foodie has a meal-plan deviation detector. If dinner was planned and no food log is linked to that plan, it emits missed_meal. A unit test supplies planned meals, including dinner, and no matching food logs; it expects that label and a compliance rate of zero.
But the household may have eaten dinner and forgotten to log it. Or eaten out. Or cooked something else. The code has observed an absence of a record and turned it into an assertion about what happened.
That small mistake points to a larger design problem: application state is being confused with world state. Traditional applications primarily maintain records. Agentic applications also need to maintain beliefs about a world their records only partially observe.
An agent can turn “no dinner log” into “the pasta is probably still in the fridge,” then recommend pasta for tomorrow. A later correction changes more than the dinner record. It calls the recommendation into question. The application needs to know which conclusions depended on the earlier interpretation, so it can reconsider them.
The dinner that disappeared
Here is the relevant path through Robot Foodie’s current source, shortened to its decision:
for (const plan of plannedMeals) {
if (!matchedMealPlanIds.has(plan.mealPlanId)) {
deviations.push({
deviationType: 'missed_meal',
mealPlanId: plan.mealPlanId,
timestamp: plan.plannedAt,
});
}
}
The unit test covers this branch: with a planned meal and no matching food logs, the detector returns missed_meal and complianceRate: 0. This is a source-level example backed by a mocked database test, not a trace of a live household.
The immediate fix could simply be a better label: no_matching_log. That matters. A person might see “missed meal” as a judgment, and another part of the application might treat it as proof that the plan failed. Renaming the label would stop the detector from presenting an unknown outcome as a missed meal. But an agent still needs to know what to do when a new clue arrives later.
Suppose the user says, “We ate out last night.” It may refer to the planned dinner. The agent can link that statement provisionally, ask about the timing if it matters, and tentatively infer that the planned pasta remains available. It might then recommend that pasta for tomorrow. If the user later says, “Actually, the kids had the planned pasta before we left,” the interpretation changes again. The user should not have to reconstruct the whole story on every turn.
Those later messages are illustrative inputs. Robot Foodie has services for logging eating out and updating a meal plan, but I have not established that this correction sequence runs end to end.
Records and beliefs need different contracts
CRUD means Create, Read, Update, Delete. It describes operations over stored state. A well-built meal app can store incomplete records, attach photos, keep an audit trail, and use agents to read and write through an API. Nothing about CRUD forbids uncertainty.
A record still needs a clear meaning. “Dinner was logged as pasta at 7 p.m.” may be a committed fact about what the user entered. It is not proof that everybody ate pasta at 7 p.m. The application can faithfully report what its records say while acknowledging that the records only partially describe the household.
The same gap appears outside meal planning. A CRM can contain no reply without establishing that a prospect is uninterested. A project system can contain an unchanged task without establishing that the work was never done. The gap becomes consequential when an agent uses those records to decide what happens next.
Memory alone does not resolve it. Chat history can remember “they missed dinner.” A vector store can retrieve it. A database can persist missed_meal. None of those operations inherently preserves whether the statement was observed, reported or inferred. Remembering an inference is different from knowing that it was an inference.
An agent needs a model that keeps those distinctions available at decision time. For the dinner, that could look like this:
| Part of the understanding | What the application preserves |
|---|---|
| Observation | A query at time T found no food log linked to the planned dinner. |
| Hypothesis | The planned dinner may not have happened; its outcome is unresolved. |
| Additional evidence | The user said, “We ate out last night,” provisionally linked to this dinner. |
| Derived belief | The planned pasta may still be available, based on the interpretation that it was not eaten. |
| Dependent decision | Tomorrow’s pasta suggestion assumes enough pasta remains. |
| Correction | The user later reports that the kids ate the planned pasta before leaving. |
| Consequence | Reconsider the inventory belief and the suggestion that relied on it; the amount remaining may still be unknown. |
This is an epistemic data model: a way to represent what the application knows, how it knows it, and where it is making a judgment. An unresolved status can be more honest than a numerical confidence score. The essential property is that an inference stays distinguishable from its evidence and connected to the conclusions drawn from it.
CLUE names the additional contract
Once an agent depends on that working understanding, the application has more to maintain than the latest values. It must preserve evidence, uncertainty, relationships, dependencies and revision. I call that contract CLUE: Capture, Link, Understand, Evolve.
CRUD tells an application how to change its records. CLUE tells an agent how to change its mind. They describe different responsibilities and can use the same database, event log, models and APIs. An agent built on CRUD records could implement the entire CLUE contract.
- Capture: Accept a weak observation now, with its source and time. “We ate out” is useful even without a receipt, exact time or full meal entry.
- Link: Connect that observation to possible people, meals, ingredients and plans. Preserve ambiguity when several matches are plausible, and record which beliefs and decisions depend on an interpretation.
- Understand: Keep separate what was observed, what the agent infers and what remains unknown. “No log” leaves dinner unresolved; “we ate out” still does not establish that nobody ate the pasta.
- Evolve: Revise interpretations when evidence changes, identify dependent conclusions that need reconsideration, and resolve or flag them before relying on them again.
The user supplies the goals, clues, constraints and corrections. The agent does the maintenance work between interactions. This is a proposed application contract, not a claim that Robot Foodie implements every step today.
A thread must carry dependencies
Clues in. Threads out. A thread is the connected account of evidence, interpretations, dependencies, corrections and revised interpretations around something like the planned dinner.
That thread needs provenance. An assertion should point back to the user message, query, rule or model output that produced it. When an agent repeats an earlier inference, repetition does not count as a second independent source.
But provenance alone is insufficient. Suppose the system can perfectly explain that its pasta recommendation came from an inventory assumption, which came from the missing dinner log and the eating-out message. If it keeps recommending that pasta after learning the kids ate it, the explanation has preserved the mistake without helping repair it.
An audit trail answers, “What happened to this record?” A CLUE thread should also answer, “Why do you currently believe this, and what else would need reconsideration if that belief changed?”
When the correction arrives, the system should mark the pasta-availability belief as needing review and follow its dependency to tomorrow’s suggestion. It should then revise the suggestion or flag it as unresolved before presenting it as viable again. It should not simply assert that no pasta remains: the correction says some was eaten, without establishing how much is left.
This is belief dependency and invalidation. The earlier query remains a valid observation about the database at time T; its interpretation no longer supports the same decisions. The application can preserve that history while withdrawing its reliance on the affected conclusions. Unrelated beliefs need not be discarded.
Ordinary tables and an event log can support this. The demanding part is preserving and following the dependencies, including those created when an agent reasons from one claim to another. A free-form summary that loses those connections cannot fulfill the contract merely by being saved and retrieved.
When does the agent ask?
The point is to reduce the bookkeeping imposed on the user. Suppose the goal is to use food already at home while keeping weekday dinners simple. If the next decision is between two meals that both work regardless of whether pasta remains, asking about the pasta adds friction. If tonight’s plan depends on it, a focused question may be worthwhile.
The agent may propose a meal; the user decides whether to accept it. A proposed plan is not a cooked dinner. Afterward, a photo, note or correction can become outcome evidence. The agent can adjust its future suggestions, while keeping a record of what it knew when it made the earlier proposal.
There are three distinct categories here: belief, state mutation and external action. “We probably have enough pasta” is a revisable belief. “Add pasta to the shopping list” is a committed change. “Buy pasta” is an external action requiring its own authorization. Confidence and authority are independent. An agent can be highly confident that pasta is needed and still have no authority to buy it. A user can also authorize a purchase while the amount remaining is uncertain. Revising a belief does not itself authorize a shopping-list change or a purchase.
The current boundary
Robot Foodie already has useful components: eating-out logging, meal-plan adjustment and the deviation detector. The detector’s missing-log branch and its test expose the exact place where a record is being promoted into a conclusion about reality. Renaming missed_meal to no_matching_log would be a concrete first repair.
What the current source and unit test do not demonstrate is a durable, revisable thread through a later user correction, with dependent inventory beliefs and plan suggestions reconsidered accordingly. That is the next test I would want to write:
- Begin with a planned dinner and no matching log. Assert that the outcome remains unresolved.
- Add the eating-out clue. Derive a provisional pasta-availability belief and a suggestion that depends on it, preserving their evidence and dependencies.
- Add the correction that the kids ate the pasta. Assert that the affected inventory belief and suggestion are identified as needing reconsideration.
- Assert that the suggestion is revised or explicitly left unresolved before it can be used again, while the original observations remain available and unrelated conclusions remain intact.
Every derived claim should be traceable to its source. The harder requirement is that a change to the evidence reaches the decisions that relied on it. A test that checks only the corrected dinner record would miss the central failure.
That is also a useful question to bring to an existing schema: which fields are observations, which are interpretations, and when one turns out to be wrong, does the system know what else it has to reconsider?
An agent-ready application needs a revisable model of reality. Its persistent record of interactions is evidence for that model, but the record cannot do the reasoning on its own.
The question for an agent-ready app is simple: when the first explanation is wrong and the user supplies one small correction days later, can the application recover without asking them to start over?