Home / Technical articles / Agent

Agent

How to build an agent's knowledge base: turning 402 fault records into something searchable

A knowledge base is not just documents dumped into a vector store. What really determines whether an agent is usable is the granularity of records and the retrieval path.

First separate the two kinds of knowledge

The first step in building an agent knowledge base is to separate phenomenon knowledge from principle knowledge.

Symptom knowledge: what error the equipment reports, what the screen shows, what abnormal sounds occur, and under what conditions. This knowledge is used to locate the problem.

Principle knowledge: what a component does, why it fails, and what a failure affects. This is the knowledge used to explain and to advise.

Storing the two together makes retrieval much worse. The right approach is to build them separately: retrieve by symptom first, then add the underlying principle.

Granularity of a single record

A good fault record looks like this:

· Symptom description (how users describe the problem, in their own words)

· Possible causes (ranked by probability, usually two to four)

· How to tell (how to distinguish these causes)

· Handling steps (split into “can be done on site” and “requires a service call”)

· Related devices (which device models show this problem)

Too coarse (one record covering a dozen situations) retrieves inaccurately; too fine (one record per screw) retrieves nothing. In practice, one record per “fault symptom a user can describe clearly” works best.

Why use the user's own words

This is the most easily overlooked point.

An engineer's log says 'main control board communication timeout', while on-site staff say 'the screen went black', 'it stopped', 'it keeps spinning'.

If the knowledge base only holds engineers' wording, frontline staff describing a symptom will not find anything.

The method: every record carries a set of aliases — the technical term plus three to five user phrasings. Retrieval runs both paths.

Designing the retrieval path

Plain vector search is not enough for fault scenarios, because fault descriptions are often very short (“it stopped” — three characters), and vector similarity cannot tell them apart.

More reliable is a dual path of 'keywords + vectors':

· Keyword path: match symptom aliases exactly and return the result on a hit

· Vector path: when keywords miss, use semantic similarity to find the closest entries

The two result sets are merged and ranked by confidence; anything below the threshold gets a plain “not found, please contact the manufacturer” — far better than a wrong suggestion.

The knowledge base must be able to grow

A knowledge base is never finished in one pass; it has to grow through use.

The method: after each agent suggestion, the user reports solved or not solved.

Unresolved records are flagged, reviewed periodically by engineers and added to the knowledge base.

Run it this way for a year and the knowledge base will be clearly better than its initial version. Conversely, without a feedback loop it stays where it started and is out of date within six months.

Scale is not the point; coverage is

402 entries does not sound like much, but if those 402 cover 80% of common faults, that is enough.

How to measure coverage: count last year's repair records and see how many map to an entry in the knowledge base.

If coverage is below 60%, the granularity or classification of records is wrong — it is not a matter of quantity.

Piling up thousands of entries, all low-frequency, is worth less in practice than carefully refining 400 high-frequency ones.

← All articles Talk through your scenario