liveBook · Manning

Domain knowledge

As explained in AI Agents in Action, Second Edition

Domain knowledge is specialized understanding of the concepts, facts, practices, relationships, and constraints of a particular subject area.

Domain knowledge is information an agent needs for a particular subject or task that it cannot rely on its model alone to supply. Product documents, policies, and engineering records can provide that context. Unlike conversational memory, which records past interactions and experiences, knowledge usually comes from external documents or structured data. section 1.3.4 section 6.6

Keeping knowledge outside the prompt lets a collection grow independently of the model’s context window. Retrieval searches that collection for a question; augmentation puts selected results into the current prompt. Only the most relevant pieces fit in any one call, so selection matters as much as storage. section 6.1 section 1.3.4

Table 6.1 Sources, storage formats, and retrieval mechanisms of knowledge and memory used in agent applications

Source

Storage format

Retrieval mechanism

Memory (short-term)—previous conversation thread

Agent/user conversation thread stored as text

Provided automatically as message history

Memory (long-term)—previous user conversations

Summarized memories stored as text or in a vector database (semantic)

Semantic/vector search

Knowledge (unstructured), documents (PDFs)

Vector database (semantic) and text document index

Semantic/vector search and keyword search

Knowledge (structured), database tables, structured logs

Same format as source

Relational database queries, log parsing

Compare the routes from source to answer: documents can use semantic or keyword search, while database tables can be queried in their structured form. section 6.1

Choose retrieval to match the question:

  • Use semantic search to find related passages, but add keyword search when exact terms, jargon, or numbers matter. section 6.6
  • Use relational or graph queries when the answer depends on structured records or relationships. section 6.6
  • Keep results current and scoped to the requester; filter by metadata such as product, version, date, role, or tenant. section 11.1.4

A filtered knowledge lookup

Suppose an agent needs to answer a question about a product policy. A retrieval tool can search a vector knowledge base and return five snippets filtered by product, version, date, role, and tenant. The agent should answer from those snippets, cite the retrieved passages, and say it does not know when they contain no answer. This keeps an unrelated or restricted document from becoming answer context. section 11.1.4 section 6.6

How AI Agents in Action, Second Edition covers it

How deep it goes
Defines retrieval and augmentation, compares storage and search routes, and gives implementation guidance without detailing model internals.
Examples
Compares PDFs and database tables in a retrieval table and filters a vector knowledge base by product, version, role, and tenant.
What it assumes
Defines retrieval and augmentation before using a code example that assumes a generic vector database.
What you can do after
Operate/configure it through selective retrieval, metadata filters, hybrid search, and answers grounded in retrieved passages.
How it connects
Connects knowledge to conversational memory, context windows, retrieval-augmented generation, hybrid search, and answer grounding.

Also explained in

Compare how 17 books explain domain knowledge →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.