The Core Bottleneck of Agent Development: Knowledge Factories Matter More Than Software Factories

The bottleneck in building Agents is context rather than the model; teams should build knowledge factories, not just software factories.
The article argues that while the SaaS industry relies on software factories for scalable application production, AI Agents follow different logic: the hardest part is context—the knowledge the Agent possesses. The model is only the engine; context is the fuel, and a lack of high-quality knowledge supply leads to hallucination and deployment difficulties. Therefore, teams should build a 'knowledge factory'—a system that continuously collects, cleans, organizes, and updates knowledge—addressing knowledge acquisition and structuring, dynamic updates, and context selection and compression. Software factories provide the runtime vehicle, knowledge factories provide the intelligent core, and the two are complementary. The article recommends treating knowledge engineering as a first-class citizen and notes that Agents' competitive moat will shift from model invocation to the ability to organize knowledge assets.
SaaS as an industry is fundamentally software-driven, which is why so many teams are building "software factories" to mass-produce applications. But when the focus shifts to AI Agents, this logic is being overturned. A view shared on Twitter points out: the hardest part of building an Agent is context—the knowledge the Agent possesses. If you're building an Agent, what you really need to build is a "knowledge factory," not just a software factory.

Why Does Context Become the Bottleneck for Agents?
The behavior of traditional software is strictly defined by code logic, with relatively deterministic inputs and outputs. In contrast, an Agent's intelligence depends heavily on how well it grasps task background, domain knowledge, and real-time information. The model itself provides reasoning capability, but without precise, structured context, an Agent is prone to hallucination or giving answers divorced from the situation.
In other words, the model is the engine, and context is the fuel. Without high-quality fuel, even the strongest engine cannot drive an Agent to run reliably. This also explains why many Agent projects dazzle in demos but struggle in production—the gap is often not in the model, but in the knowledge supply.
Context window refers to the upper limit on the total number of tokens a large language model can receive in a single inference pass, covering user input, system prompts, retrieved knowledge snippets, and conversation history. Mainstream models have grown from 4K windows in the early days to 128K and even millions of tokens today, but this is still very limited compared to the total volume of an enterprise knowledge base. This leads to two direct consequences: first, you cannot stuff all knowledge into the prompt at once and must perform retrieval and filtering; second, the longer the window, the more the model's attention to information in the middle position tends to decay (the "lost in the middle" phenomenon), causing key knowledge to be overlooked. Therefore, context management is not simply about enlarging the window, but about making precise trade-offs within limited capacity—and this is exactly the core engineering problem a knowledge factory needs to solve.
Hallucination refers to the model generating content that seems plausible but is factually incorrect or unsupported. In Agent scenarios, the root cause of hallucination is often not insufficient model capability, but missing or erroneous context—when the model has no authoritative knowledge to rely on, it tends to fill in the gaps using vague patterns memorized in its parameters. Common mitigation methods include retrieval-augmented generation (RAG), requiring the model to cite sources, and explicitly marking knowledge boundaries in the context. This also explains why the quality of the knowledge supply directly determines an Agent's reliability.
Knowledge Factory: The New Infrastructure of the Agent Era
A "knowledge factory" is not a simple document repository, but a system that continuously collects, cleans, organizes, and updates knowledge. It needs to solve several key problems:
1. Knowledge Acquisition and Structuring
Agents draw on diverse knowledge sources, including internal documents, databases, API responses, and conversation history. The first step of a knowledge factory is to transform this unstructured or semi-structured information into a form that can be retrieved and reasoned over. This involves document parsing, entity extraction, relationship construction, and more.
Retrieval-Augmented Generation (RAG) is the mainstream paradigm for injecting external knowledge into Agents today: first retrieve snippets relevant to the current task from a knowledge base, then splice them into the prompt for the model to generate an answer. The key steps of RAG include document chunking, vector embedding, similarity retrieval, and reranking. Among these, chunking strategy directly affects retrieval granularity—chunks that are too small lose context, while chunks that are too large introduce noise and waste the window. Beyond vector retrieval, hybrid retrieval (combining keyword BM25 with semantic vectors) and knowledge graphs (organizing knowledge by entities and relationships) are also important forms of structured knowledge; the former improves recall, while the latter excels at multi-hop reasoning and relational questions. The "structuring" step of a knowledge factory is essentially about preparing high-quality, addressable knowledge units for these retrieval methods.
2. Dynamic Knowledge Updates
A static knowledge base quickly becomes outdated. A knowledge factory must have incremental update capability, able to sense changes in data sources and sync them into the Agent's context. This is especially critical for time-sensitive scenarios such as customer service and operations.
3. Context Selection and Compression
A model's context window is limited, while the total volume of knowledge often far exceeds the window capacity. A knowledge factory needs to dynamically filter the most relevant knowledge snippets based on the current task and inject them in an appropriate form. This is not just a retrieval problem, but the core challenge of context engineering.
Context engineering is a practice area that has emerged after prompt engineering. It focuses not on "how to phrase a question," but on "which information to put into the limited context window, in what order and format." It covers system prompt design, tool definitions, filtering of retrieval results, summarization and compression of conversation history, and state management across multi-turn interactions. Compared with prompt engineering, context engineering places more emphasis on systematic information orchestration: for example, placing the most relevant evidence at the beginning and end of the window to counter attention decay, rolling summaries of long conversations, or dynamically switching knowledge sources by task stage. For teams building a knowledge factory, context engineering is the last mile that turns "knowledge assets" into "model-usable input," and its quality often determines an Agent's actual performance more than the total volume of knowledge.
Synergy Between Software Factories and Knowledge Factories
This is not to deny the value of software factories. Software factories solve the problem of application delivery efficiency, while knowledge factories solve the problem of an Agent's cognitive quality. The two are complementary: software factories provide the runtime vehicle, and knowledge factories provide the intelligent core.
For teams building Agents, a pragmatic recommendation is: treat knowledge engineering as a first-class citizen. Plan the knowledge collection pipeline, storage structure, and update mechanisms early in architecture design, rather than retrofitting after the Agent performs poorly.
Implications for Developers
Although this tweet is short, it points out an easily overlooked truth: the competitive moat of Agents lies not in model invocation, but in the ability to organize knowledge assets. As model capabilities become increasingly commoditized, whoever can build a more efficient knowledge factory will be able to make Agents perform more reliably and professionally in real-world scenarios.
For SaaS teams, this may mean a role shift—from software producers to knowledge operators. And the teams that establish knowledge factories first will gain advantages in the Agent era that are hard to replicate.
One-line Summary
The bottleneck in building Agents lies in context rather than the model; teams should build knowledge factories, not just software factories.
Paragraph Summary
The article points out that the SaaS industry relies on software factories for scalable application production, but the underlying logic of AI Agents is different: the hardest part is context, i.e., the knowledge the Agent possesses. The model is just the engine; context is the fuel. A lack of high-quality knowledge supply leads to hallucination and difficulty in production deployment. Therefore, what teams really need to build is a "knowledge factory"—a system that continuously collects, cleans, organizes, and updates knowledge—which must solve three major problems: knowledge acquisition and structuring, dynamic updates, and context selection and compression. Software factories provide the runtime vehicle, while knowledge factories provide the intelligent core; the two are complementary. The article recommends treating knowledge engineering as a first-class citizen and notes that the competitive moat of Agents will shift from model invocation to the ability to organize knowledge assets.
Related articles

Hero or Luck? Technical Reflections Sparked by an Arizona Grandfather Finding a Missing Toddler in the Desert
An Arizona grandfather finding a missing toddler in the desert hits Hacker News. This article analyzes emergency search, drone thermal imaging, child location devices, and community collaboration, exploring the boundaries of technology and human effort in extreme environments, while noting the material's limitations.

Run Agentic Coding on Mac with One Command: The Localcode Open-Source Tool
Localcode is an open-source agentic coding tool for Mac that launches with a single command. This article examines its local, open-source, minimal-install positioning, who it suits, and the information gaps to consider before adoption.

Lean Formalization of Masullo Manuscript: Progress Map Sparks Discussion
A public progress map for a Lean formalization project of Alessandro Masullo's manuscript sparks Hacker News discussion on formalization costs, collaboration, and AI-assisted proving.