10 min readUpdated: November 26, 2026

The Knowledge Factory: Turning Owner Know-How into Agent Context

More context is not the fix. For a restaurant at Tết, the answer is a maintained, versioned body of knowledge — and a loop that turns a wrong answer into a better one for the next customer.

Available in:

A customer messages a family restaurant in Ho Chi Minh City in the week before Tết:

“Cho mình đặt bàn 15 người mùng 2 Tết, có món chay không, giá có tăng không, đặt cọc bao nhiêu?”

Can I book a table for fifteen on the second day of Tết, do you have vegetarian dishes, have prices gone up, and how much is the deposit?

The owner knows every answer. Four of the ten kitchen staff have gone home. The set menu is the only menu on mùng 2. The surcharge moved from ten to fifteen percent this year. The vegetarian set is possible, but only with a day’s notice. The deposit is half. None of that is in a document. It lives in a menu photo, a Zalo voice note from the chef, a Facebook post from Tết 2026, a note on the fridge, and the owner’s head.

LangChain calls this the missing piece: not better models, but better knowledge. I agree. Their version of a knowledge factory, though, assumes a company with Notion, Slack, a content studio and a finance lead who reviews the output. This restaurant has none of those. So let’s reason from the restaurant rather than from the tooling.


One question, many hidden requirements

Take the message apart. What does a correct answer actually need?

  • The lunar date. “Mùng 2” is a different Gregorian date every year. A rule that says “closed on mùng 1” needs a year attached, or it becomes wrong at the next Tết.
  • Current capacity. Fifteen seats with half the kitchen team is a different answer from fifteen seats on an ordinary Tuesday.
  • The vegetarian rule. It exists on the Tết menu, but only with advance notice.
  • The price rule. Which surcharge is current, and does it apply to the set menu or only to individual dishes?
  • The deposit rule. Half, and due when?

Only the first item is in the customer’s message. Everything else is knowledge the business accumulated over years. The assistant either has it, or it guesses.


Try the obvious fix: more context

The reflex is to give the agent everything: the menu photo, every Zalo thread, last year’s Facebook post, the owner’s notes, the whole price history. This is the “just add context” answer. It fails in a very specific way at Tết.

Last year’s Facebook post says the restaurant is closed on mùng 1. That was true in 2026. For 2027 the owner is opening until 2 PM. Both statements are in the context, and nothing in the text tells the model which one has authority. The menu photo shows 1.2 million; a voice note says 1.3 million; a sheet near the till says 1.4 million. Three prices, each official in some sense.

LangChain names this failure context clash: parts of the context disagree. It is not a shortage of information. It is a surplus with no owner, no date and no scope. Add more of it and the model does not get wiser; it gets more fluent about the wrong sentence. Karpathy’s analogy helps here: the context window is RAM, and an operating system does not fix a memory problem by loading every file on disk.

So the first conclusion is negative. The problem is not how much goes into the window. It is what we choose to maintain outside it, and who is allowed to change it.


Knowledge is not context

Context is what the agent has available for this turn: the customer’s message, the conversation so far, this customer’s saved preferences, the open order. Knowledge is the reusable understanding we maintain so that the turn comes out right: what the surcharge means, which price is current, how a booking becomes valid.

The distinction sounds academic until a date is involved. “Mùng 2 Tết” as a fact about 2027 is knowledge with a shelf life. “The customer wants fifteen seats on mùng 2” is context. One of them has to survive many conversations and eventually be replaced; the other is gone when the conversation ends.

This is why a knowledge factory is not a bigger prompt. A prompt has no author, no expiry and no history. Knowledge needs all three.


What are we maintaining, exactly?

For this restaurant, three kinds of knowledge matter, and they should not be stored the same way.

graph LR
  Q["One Tết booking question"] --> P["Procedures<br/>quote, deposit, cutoff"]
  Q --> F["Business facts<br/>vegetarian set, capacity"]
  Q --> D["Data access<br/>where to read availability"]
  P --> R["Published version of the knowledge"]
  F --> R
  D --> R
  R --> A["Answer for this customer"]

Procedures say how work is done properly here: how a set menu is quoted, when a deposit is required, why a booking after 8 PM is refused. These must produce the same result every time, so leaving them as prose is a mistake. They belong in checked rules that can be exercised before a customer sees them. This is the argument we made in Executable Skills for Agents Are Better Than Docs.

Business facts describe how the business works: the vegetarian option, the holiday capacity, the days it is closed. Some were written down and are incomplete; others were never written at all. They matter because they change slowly enough to be worth maintaining but often enough that an old copy causes damage.

Data access guidance says where current information lives. The available tables on mùng 2 are not knowledge — copying them would produce a stale lie by the next morning. They stay in the system of record, read at turn time. What we maintain is the instruction: which source to use, which fields may be shown to a customer, and what to do when the source is missing. This boundary is the part people most often get wrong. Not everything should go into the factory.


Why a document is not enough

Imagine writing a perfect Tết document in January 2026. It records the prices, the hours, the vegetarian rule and the deposit. By Tết 2027, four things have changed and the document is now an authoritative source of wrong answers.

A document has no author field that a system can act on, no freshness signal, no scope, and no safe way to be wrong. Editing it in place destroys the history you need to understand what changed. Handing it to the answering agent to maintain is worse: an agent trying to close a booking is not an agent qualified to rewrite business policy.

What we need is a loop with a version number. The rules are typed artifacts, changes happen in a private workspace, checks and tests run before anything is merged, and publishing to the customer-facing version is a separate, explicit act. “Tết 2027 prices” becomes a release rather than an overwrite. That is the same shape as the software factory idea LangChain describes, applied to knowledge instead of code — and it is the subject of Open Knowledge Format vs Agent Skills.


What the loop has to do

Six questions got us here. Each has an answer in how we built this, named briefly rather than demonstrated.

  • Who writes the knowledge? The owner talks. A spoken sentence becomes a typed rule instead of a form to fill in. The Command Center routes a request to a narrow editor that owns only the relevant artifacts.
  • Who resolves conflicts? A curator that reads raw signals — notes, menus, past conversations, flagged answers — is separate from the agent answering customers. The answering agent is good at noticing a gap; fixing it needs a different job.
  • How do we stop a bad edit? Artifact checks validate structure, a small test suite exercises the quoting rules, and a commit gate refuses an inconsistent change. Publishing to the customer-facing version takes a second, explicit action. Rollback is a release pointer, not a memory.
  • How does a mistake become an improvement? This is the important one. A quote is wrong at 9 PM on mùng 1; the customer shows up with the wrong expectation; the owner flags the answer between tables. The reviewed conversation and its trace become evidence. The curator finds the cause in a specific rule, an editor patches it, tests rerun, and the change is published. The next table gets the current number. The loop runs during Tết, not in a review meeting in March.
  • Which source wins? Published knowledge has authority. A Facebook post from the previous year does not. This is encoded, not hoped for.
  • What happens when knowledge is missing? Fail closed. The quoting tools report that they are not ready; a field that is not declared in the schema cannot be written; the assistant asks or escalates and does not invent a price. The general case is made in Determinism as Infrastructure.
graph LR
  W["Wrong surcharge quoted at 9 PM"] --> O["Owner flags the answer"]
  O --> T["Conversation plus trace as evidence"]
  T --> G["Curator locates the cause in one rule"]
  G --> E["Editor patches the rule"]
  E --> S["Tests rerun"]
  S --> C["Commit to in-development version"]
  C --> L["Publish to customer-facing version"]
  L --> N["Next table gets the current price"]

Traces matter here more than they sound. A flagged answer alone says “this was wrong”. A trace says which tool ran, which rule produced the number, and what the agent saw. That is what turns a complaint into a repair. We wrote about keeping those traces in our own database in LangChain Deep Agent Observability in Your Own Database.


Start with one workflow

You do not need to document the restaurant before the assistant can help. Pick the question that recurs and hurts most when it is wrong — for this owner, it is quoting a Tết table. Let the assistant answer it. Look at where it struggles. Fix that rule, publish it, and see whether the next answer is better.

Tết is a good first loop precisely because it is annual and everything changes: prices, hours, staff, menu. A knowledge factory that survives Tết can survive an ordinary Tuesday. And the measure is not how much knowledge you wrote down. It is how quickly a correction becomes a correct answer for the next customer.

LangChain ends its article with the same advice: do not document everything before agents start working; build a system where doing the work reveals what is missing. In a family restaurant, the owner does not have a documentation sprint in them. They have one question at a time, and a phone that keeps ringing.

Try it with your own model key.


FAQ

Isn’t this just RAG? RAG retrieves text. It does not decide which source has authority, when a fact expires, or how a correction becomes a durable change. In the Tết example, retrieval happily returns two conflicting prices. A knowledge factory adds ownership, versions, checks and a curator that turns evidence into an update.

Do I have to write everything down before Tết? No. That is the point of a loop. Start with one recurring question, let the assistant answer it, inspect where it struggles, and fix the specific rule that was wrong. The knowledge base grows from real work instead of a documentation sprint.

What about fast-changing things like table availability? Those do not belong in the factory. Availability and the current order draft stay in the system of record and are read at turn time. The knowledge is the instruction on where to look and what to trust, not a copy of the data.

How does an agent flag missing knowledge? Mostly by failing closed. If a required rule or catalog is absent, the quoting tools report that they are not ready instead of producing a number. The owner can also flag an answer directly; that flagged conversation and its trace become evidence for the curator.

Why does knowledge need versions? Because the correct answer changes with time. A mùng 1 closing rule from 2026 is wrong at Tết 2027. Keeping releases rather than overwriting one file lets a change be tested, published explicitly, and rolled back if it turns out to be wrong.


Sources


Tags: knowledge-factory context-engineering agent-skills small-business-ai deterministic-ai quotyai

Found this useful? Share it.

Related articles