Enterprise Knowledge-Base Agents: From Prototype to Production
A working enterprise knowledge-base agent is more than a language model answering from internal documents. This article covers acceptance criteria, retrieval choices for single-clause, cross-document, and high-frequency questions, server-side tool boundaries, memory, offline deployment, and maintenance and evaluation—so teams can ship a scoped read-only system before adding stepwise retrieval, knowledge pages, tools, memory, or graphs.
1. Define acceptance criteria before deciding what the agent must do
Handing internal documents to a large language model does not, by itself, create an enterprise knowledge-base agent. A system that answers “what does this policy say” usually only needs to retrieve evidence and generate an answer. A system that must “confirm the equipment model, then look up the applicable procedure, then check work-order status” needs to decide the next step from intermediate results and call tools as needed. Both tasks can share the same knowledge base, but they do not have to share the same complex workflow.
Take shift-support assistance as an example. When a user asks, “After a protection trip, reclosing failed—which checks should I look up?”, the system first has to confirm the equipment category, the applicable procedure, and the document version. If equipment information is incomplete, it should ask a follow-up question rather than stitching clauses from different equipment into one checklist. When the material is sufficient, it can group items by check category and point each category to a specific section. The system is offering guidance on which procedures to consult. It must not treat retrieved text as live equipment status, and it must not replace an on-site decision.
Acceptance should make at least three things explicit: which questions must be answered, when the system must ask for clarification or stop, and how long it may take to return a complete answer with sources. That last item should be measured end to end, including retrieval, reranking, tool calls, and generation. A fast first token does not mean the user gets a usable conclusion in time.
2. Choose the knowledge base by how the evidence is distributed
2.1 Single-clause lookup: start with a hybrid vector and keyword baseline
Retrieval-augmented generation (RAG) finds evidence in documents before the model writes an answer, then has the model organize language from that evidence. Vector search is good at questions that mean the same thing but are worded differently. Keyword search is more stable for equipment IDs, procedure clause numbers, fault codes, and domain terms. For enterprise documents, merge candidates from both paths and rerank by relevance. Do not ask vector search to handle semantic similarity and exact matching at the same time.
How documents are split also affects answer quality. Prefer splits along sections, clauses, or complete tables. Keep parent headings, and record document version, effective date, scope, and access permissions. Fixed-length chunks can be a fallback, but a clause and its exceptions should not land in unrelated fragments. For example, one passage may list inspection items while the conditions of use sit in the previous section. If retrieval returns the items without the conditions, the model can cite accurately and still apply the conclusion to the wrong situation. A practical pattern is to locate with a short passage, then fetch the surrounding clause or necessary neighboring content.
2.2 Cross-document lookup: complete the evidence before considering a graph
When the answer is spread across several files, simply returning more passages often brings in more irrelevant material. A more economical approach is to break the question into smaller searchable questions: which class the equipment belongs to, which procedure version currently applies, and whether related sections add exceptions. The system can run follow-up retrieval from equipment names, clause numbers, or cross-references found in the first round, then combine the evidence.
If the same kinds of questions repeatedly depend on stable relationship chains—for example, among equipment, protection functions, fault symptoms, and procedure clauses—graph-augmented retrieval may be worth considering. The graph follows relationships to related objects; the source text still has to support the conclusion. Each important relationship should trace back to a source. When equipment shares a name, a procedure has changed, or relationships conflict, there also needs to be a disambiguation and review process. Whether a graph is worth building should be judged on the same set of cross-document questions, compared with stepwise retrieval: whether evidence is found more completely, and what it costs to build and update. Simple questions should not be routed through the graph.
2.3 High-frequency operations questions: maintain structured knowledge pages
For recurring handover questions, inspection notes, and procedure explanations, scattered material can be organized into structured knowledge pages. Each page should record conditions of use, a step overview, common exceptions, original sources, and an owner. A model can help summarize new material, flag conflicts, and draft revisions, but high-risk content should be published only after human review. Knowledge pages help people look things up; they should not quietly replace official documents.
The key to a mixed design is one reliable default path: answer routine questions with the lower-cost retrieval method first; when evidence is insufficient, add retrieval or follow relationships as needed; if conditions of use are still unclear, return the missing information instead of continuing until the answer only looks complete.
3. Models and tools: let the server enforce execution boundaries
Model choice should start from real business samples and deployment constraints. Test whether the model can read negative conditions in procedures, cite sources correctly, ask for clarification when information is insufficient, and submit tool parameters in the agreed format. Then test memory use, full response time, and tail latency at the target concurrency. Quantization can reduce memory pressure, but terminology understanding, structured output, and citation accuracy should be rechecked. Problems that a fixed workflow can solve do not need the model to plan repeatedly.
A tool definition is an execution contract, not a note written for the model. For an internal knowledge-retrieval tool, the query field should reject empty strings and whitespace-only input, document type should be limited to supported values, and results should carry a document identifier, version, and source location. User identity, department permissions, and accessible scope should come from a trusted session on the server. The server must not accept authorization data filled in by the model.
At runtime, accept only registered tools, and check parameters, permissions, and execution conditions. Read-only actions such as looking up material or querying status may run automatically within authorization. Write actions such as creating a work order or changing a record need separate authorization, and a confirmation step scaled to business impact. If a write times out, verify whether it already ran before retrying, so the same submission is not sent twice. Also cap the number of calls and total time for a single task. If a tool is unavailable, state clearly which information cannot be verified. Do not let the model simulate query results.
4. Memory: keep task progress, do not write guesses down as facts
Conversation context is for resolving references such as “that piece of equipment just now.” Task state records what has already been looked up, which conditions are still unconfirmed, and what comes next. Long-term memory should store only authorized information that is actually worth reusing, such as an output preference the user explicitly set. These three have different lifetimes and should not be kept together indefinitely in one history log.
In particular, separate information supplied by the user, facts the system has verified, and hypotheses the model proposed. An equipment model guessed in the previous turn must not automatically become a retrieval filter in the next turn. Content kept across sessions needs a source, write permission, retention period, and a way to delete it. Information that can change—procedure versions, work-order status, and the like—should be checked again against a trusted source, not reused from an old conversation.
5. Offline deployment: validate the whole path, not only local inference
In a disconnected environment, starting a generation model on the internal network is only the first step. Document parsing, embedding generation, candidate reranking, index storage, authentication, logging, and internal tools should each be checked for hidden external-network dependencies. Before go-live, actually disconnect external networks and verify cold start, index rebuild, service restart, and failure recovery. Avoid a system that can answer questions in normal operation but depends on an external download when the index is rebuilt.
Capacity planning has to cover both request peaks and content updates. Long context and high concurrency both increase inference load, and batch parsing and index builds can compete with online traffic. Update work can run on a separate queue or during off-peak hours. When there is too much evidence, drop duplicate or inapplicable passages first. Under overload, the system may fall back to returning the original text and clause location, but it must not skip permission checks or mark an unverified conclusion as confirmed.
6. Knowledge maintenance and evaluation: trace each error to a specific stage
Document release should be versioned. After new material enters the system, parse it, deduplicate it, check metadata, and update the index. Switch it to the active version only after it is confirmed searchable. Older procedures may be retained for audit, but they should not answer current questions by default. Retrieve them by time range only when the user explicitly asks about a historical policy. When a document is withdrawn or permissions are tightened, update the index, knowledge pages, and answer cache together so stale content does not reappear through a side path.
The evaluation set should cover single-clause lookup, cross-document questions, version conflicts, no-answer cases, insufficient permissions, and unavailable tools. Do not score an answer with one overall number. First check whether the correct material was retrieved. Then check whether the citation supports the specific conclusion. Finally check whether the model dropped a condition, called a tool incorrectly, or answered when it should have asked a follow-up. If the correct clause never entered the context, fix document splitting and retrieval first. If the clause was retrieved but the answer omitted an exception, inspect context assembly and generation constraints. After every change to the model, index, or tool definitions, rerun the critical samples and keep a rollback plan.
In practice, deliver a clearly scoped read-only question-answering system first, and get document permissions, versions, and citations right. Then, from real failure cases, add stepwise retrieval, domain knowledge pages, and necessary tools. Introduce memory or a graph only when questions truly need multi-turn or cross-document handling. Maturity is not measured by how many steps the system can run on its own. It is measured by whether it can say where a conclusion came from, which conditions it applies under, and when it must stop and hand the decision to a person.
