liveBook · Manning

Knowledge base

As explained in AI Agents and Applications

An internal knowledge base is information encoded in a language model's learned parameters and available without consulting external data sources.

In a retrieval-augmented generation (RAG) application, a knowledge base is a trusted source of external information, such as company documents. This differs from information a model learned during pretraining: RAG retrieves relevant knowledge-base content and adds it to the prompt. section 1.4.2 section 6.1.2

A RAG workflow prepares and uses the knowledge base in stages:

  • Ingest documents, split them into chunks, and create embeddings that represent their meaning. section 1.4.2
  • Store chunks and their embeddings in a vector database so relevant content can be retrieved by similarity. section 1.4.2
  • Retrieve focused context for a question and add it to the prompt, rather than passing in entire large documents. section 1.4.2 section 6.1.2
Figure 1.9 A collection of documents is split into text chunks and transformed into vector-based embeddings. Both text chunks and related embeddings are then stored in a vector store.
figure

Shows how documents become chunks and embeddings stored together in a vector store. section 1.4.2

Retrieving only relevant content can reduce token costs and improve speed and accuracy. Results still depend on finding useful context; adding loosely related material can be less effective than providing a smaller, focused selection. section 1.4.2 section 6.1.2

How AI Agents and Applications covers it

How deep it goes
Describes ingestion, chunking, embedding, storage, and retrieval, while leaving detailed reliability techniques for later.
Examples
Uses company intranets and documents, including PDF, DOCX, TXT, and PPT files, as sources.
What you can do after
Build it from scratch by ingesting documents, creating embeddings, storing them, and retrieving context for prompts.
How it connects
Connects knowledge bases to retrieval-augmented generation, embeddings, vector databases, and prompt grounding.

Also explained in

Compare how 11 books explain knowledge base →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents and Applications. The section links point to the parts of the book it draws on.