liveBook · Manning

Knowledge base

As explained in Domain-Specific Small Language Models

Retrieved outside information supplied to a model at inference time to ground its output.

An external knowledge base supplies retrieved information to a model at inference time so generation is grounded in source material. section 2.2 section 13.2

Here it appears as the retrieval source in retrieval-augmented generation, where retrieved context is fed to a pretrained LLM to improve accuracy and freshness. section 2.2 section 13.2

The treatment breaks the workflow into two phases:

  • Offline, document corpora are chunked, embedded, and stored in a vector database with indexes for search. section 13.2
  • Online, a user query is embedded, similar chunks are retrieved, and the generator model answers with that context. section 13.2
  • The pipeline can also check outputs against sources to improve transparency and accuracy. section 2.2

PDF-based retrieval

A single PDF is parsed, split into sentence chunks, embedded with a sentence transformer, searched by cosine similarity, and passed as context to a chat model. section 13.2

How Domain-Specific Small Language Models covers it

How deep it goes
Explains the two-phase RAG flow and a worked PDF retrieval pipeline, but stops short of dedicated framework coverage.
Examples
Uses a PDF query example, sentence chunking, cosine similarity search, and a blocked KV-cache retrieval result snippet.
What it assumes
Assumes basic LLM usage and introduces retrieval, embeddings, and vector search from the ground up.
What you can do after
Apply it via RAG to retrieve relevant passages and generate more accurate, up-to-date answers.
How it connects
Connects RAG, embeddings, vector databases, prompt engineering, and fine-tuning.

Also explained in

Compare how 10 books explain knowledge base →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.