AI glossary Data & Retrieval
What is a corpus in AI and NLP?
← All glossary termsA collection of documents or texts used to train a model or to serve as the knowledge base an AI system retrieves from, as in RAG.
Explained
A corpus is a structured collection of documents gathered for a purpose. In AI it plays two roles: as training data, the text a language model learns from, and as a knowledge base, the documents a retrieval-augmented generation (RAG) system searches to ground its answers. In an enterprise, the corpus is usually the set of policies, manuals, contracts, tickets or product documents an assistant is allowed to use. Its quality, coverage, freshness and structure directly affect how well the system retrieves and how accurate its answers are.
Training corpus vs retrieval corpus
A training corpus shapes what a model knows and how it writes. Large language models are trained on very large corpora of web pages, books, code and other text, and that knowledge is fixed when training ends.
A retrieval corpus is consulted at answer time. In a RAG system, the documents are split into passages, indexed (often as embeddings in a vector database) and searched for each question. Updating it does not require retraining: add or remove documents and the answers change.
What makes a good enterprise corpus
- Coverage: the documents actually contain the answers users will ask for.
- Freshness: outdated versions are removed or clearly marked, so the system does not cite superseded rules.
- Structure and metadata: titles, dates, owners and document types help retrieval and filtering.
- Clean text: tables, scans and attachments are converted well, without broken layouts or duplicates.
- Permissions: each document carries who may see it, so the assistant does not reveal what a user should not read.
Common problems
Many weak RAG results trace back to the corpus rather than the model: contradictory versions of the same policy, scanned PDFs with no readable text, documents chunked in a way that splits the answer, or important knowledge that was never written down. Curating the corpus, with clear ownership and a review cycle, is often the cheapest way to improve answer quality.
Frequently asked questions
What is a corpus in NLP?
In natural language processing, a corpus is a body of text collected to study language or train models, such as news articles, books or transcripts. Its size and composition determine what a model can learn from it.
What is the difference between a corpus and a dataset?
A corpus is a type of dataset made mainly of documents or text. Dataset is the broader term and includes tables, images, labelled examples and other data.
What is a corpus in RAG?
It is the collection of documents the RAG system is allowed to search. For each question, the system retrieves the most relevant passages from that corpus and gives them to the model to ground its answer.
How big should a RAG corpus be?
There is no fixed size. What matters is that it covers the questions users ask, is current and is well structured. A small, curated corpus usually gives better answers than a large one full of duplicates and outdated versions.
Where it shows up at Thinkia
Further reading
Related terms
Sources
- Lewis et al. · Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (arXiv)
- Brown et al. · Language Models are Few-Shot Learners (arXiv)
- Sketch Engine · Glossary: Corpus
Updated: 2026-10-21