Concepts / Measuring Knowledge Base Size in Tokens

Measuring Knowledge Base Size in Tokens

For Claude models, the guidance recommends including the entire knowledge base in the prompt, with no need for RAG or similar methods, when the knowledge base is smaller than 200,000 tokens.

  • Programming

Two Ways to Give a Model Your Documents

Suppose you have a body of reference material, such as product manuals, policy documents, or research notes, and you want a language model to answer questions about it. You face a practical choice. You could place the whole body of material inside the prompt you send to the model, an approach often called long context. Or you could use retrieval-augmented generation, usually abbreviated RAG, where the system first searches the material for passages relevant to each question and then sends only those passages to the model.

Neither option is automatically better. The choice depends on how large the material is, and the guidance examined here ties that choice to a specific size threshold for Claude models. As you read, keep one question in mind: at what size does the decision change, and why would size be the deciding factor?

Deciding by Size Before Designing

Think of the guidance as a single yes or no question that you ask before you design anything. Start with the size of the knowledge base, measured in tokens. If it falls below 200,000 tokens, the recommended path is to include the whole thing in the prompt, with no need for RAG or similar methods. If it does not, the guidance does not give a direct instruction, so the comparison has to be made with more information.

Knowledge base sizeNmeasured in tokensN smaller than200,000 tokens?Include entireknowledge base inpromptno RAG or similar methodsneededNo direct instructionin this guidanceat or above the thresholdcompareyesno
Given a knowledge base of a specific token size, which branch do I take: put it all in the prompt, or switch to RAG? The guidance answers only the small-collection branch.

Notice the direction of the comparison. The threshold is an upper limit, so the condition is that the knowledge base is smaller than 200,000 tokens. The open branch in the diagram is open because the passage does not settle it, not because the passage recommends RAG there.

What the Model Actually Receives

The two approaches differ in what enters the model's context. With prompt inclusion, you place the whole body of material inside the prompt, so the model receives the full knowledge base along with your question. With RAG, the system first searches the material for passages relevant to each question, and only those retrieved passages are sent to the model. The model never receives the rest of the material on that request.

Whole knowledge baseSearch for relevantpassagesQuestion in the samepromptRetrieved passagesonlyQuestion sent withpassages
What does the model actually receive in each approach: the full knowledge base, or only retrieved fragments selected per query?

The 200,000-Token Threshold

Definition

For Claude models, the guidance recommends including the entire knowledge base in the prompt, with no need for RAG or similar methods, when the knowledge base is smaller than 200,000 tokens. Anthropic, the developer of the Claude models, gave this guidance in 2024.

Formula, step by step
  1. 1
    N stands for the size of the knowledge base measured in tokens.
  2. 2
    The left side is the condition: N must be strictly smaller than 200,000.
  3. 3
    The arrow reads as the guidance's recommendation when the condition holds.
  4. 4
    This is a restatement of the source's rule for Claude models, not a general law of retrieval systems.

The token count is the figure the guidance uses to draw the line. The source also gives a rough human scale: the 200,000-token figure is described as about 500 pages of material. Treat that page count only as an approximation, since it is an estimate that depends on how dense the pages are.

Tracing the Threshold on Sample Sizes

What do you think happens?

A knowledge base is exactly 200,000 tokens. Does the guidance recommend including the whole thing in the prompt?

  • Yes, because 200,000 is the threshold

  • No, because the condition requires the size to be smaller than 200,000

Reveal answer
Answer:

No. The condition is N smaller than 200,000 tokens, so a knowledge base of exactly 200,000 tokens falls outside the recommendation.

The threshold is an upper limit. A size equal to the threshold is not smaller than it, so this guidance does not apply to that case.

Worked example

Applying the rule to a 900,000-token collection

A team has a collection of about 900,000 tokens and uses a Claude model. Which approach does the guidance recommend?

  1. 1
    Read the size

    The collection is about 900,000 tokens, so N is approximately 900,000.

  2. 2
    Compare to the threshold

    The condition is N smaller than 200,000. 900,000 is well above 200,000, so the condition is not met.

  3. 3
    Choose the branch

    The guidance gives no direct instruction for this size. The team must evaluate the options using other criteria.

Result

The passage does not recommend an approach for this collection. It supports only the small-collection conclusion, so the team needs more information before deciding.

Worked example

Applying the rule to a 150,000-token collection

A support team has a policy collection of 150,000 tokens. Which branch applies?

  1. 1
    Read the size

    N is 150,000 tokens.

  2. 2
    Compare to the threshold

    150,000 is smaller than 200,000, so the condition N smaller than 200,000 holds.

  3. 3
    Choose the branch

    The guidance recommends including the entire policy collection in the prompt, with no need for RAG.

Result

Include the whole collection in the prompt.

40,000 tokens200,000 tokens150,000 tokens900,000 tokens
Which sample knowledge base sizes fall below the 200,000-token threshold and which fall above it?

The Boundary at Exactly 200,000 Tokens

Boundary cases are where careless reading causes errors. A collection of exactly 200,000 tokens is not smaller than the threshold, so it falls outside the recommendation. The passage does not say what to do at that size, and it should not be read as a signal either way. A reader who rounds 200,000 down to a smaller figure, or who treats the threshold as inclusive, is misreading the condition.

Mistakes When Reading the Threshold

  • Common mistake

    Treating 200,000 tokens as a general limit on any model

    What it looks like

    Applying the Claude threshold to a different model and calling the decision settled.

    Why it fails

    The guidance is specific to Claude models and gives no recommendation for other models.

    Do this instead

    Look for guidance from that model's developer or evaluate the approaches yourself.

  • Common mistake

    Reading the threshold as covering only one document

    What it looks like

    Checking a single manual that is 30,000 tokens and concluding that a 600,000-token corpus of many manuals is also covered.

    Why it fails

    The size being compared is the knowledge base as a whole, so the size of one file does not settle the question for the full collection.

    Do this instead

    Measure the total size of the knowledge base you intend to put in the prompt, then compare that total to 200,000 tokens.

  • Common mistake

    Taking the page count as the figure the guidance uses

    What it looks like

    Deciding based on a guess that 200,000 tokens is exactly 500 pages.

    Why it fails

    The source gives about 500 pages only as a rough, density-dependent approximation. The token count is the number the guidance actually uses.

    Do this instead

    Compare token counts to the threshold, and use the page figure only as a rough human scale.

  • Common mistake

    Assuming the threshold is inclusive

    What it looks like

    Deciding that a knowledge base of exactly 200,000 tokens is covered by the recommendation.

    Why it fails

    The condition is that the size is smaller than 200,000 tokens, so an exact match is outside the case described.

    Do this instead

    Use the strict comparison N smaller than 200,000.

  • Common mistake

    Assuming that a large collection means RAG is recommended, when the passage gives no direct instruction for sizes at or above the threshold

Applying the Rule to Other Models

The source notes a gap in the wider field: it would be helpful if other model developers provided similar guidance on RAG versus long context for their own models. When you meet a model without such guidance, you cannot borrow the Claude threshold and treat the decision as settled. Instead, look for guidance from that model's developer, or evaluate the two approaches yourself against the material and the questions you need answered.

Sizing a Knowledge Base Yourself

MEDIUM

A Claude-based assistant will answer questions about a product manual collection. The collection measures 185,000 tokens. Using only the guidance in this article, state which approach the guidance recommends, and explain whether the same conclusion would hold if the collection grew to 215,000 tokens.

Hints
  • Write the condition as an inequality on N before you compare.
  • Check whether 185,000 is strictly smaller than 200,000.
  • Consider what the passage says about sizes at or above the threshold, and whether it gives a direct instruction there.

Key Takeaways

  • For Claude models, the guidance recommends including the entire knowledge base in the prompt, with no need for RAG or similar methods, when the knowledge base is smaller than 200,000 tokens.
  • The threshold is an upper limit with a strict comparison: a knowledge base of exactly 200,000 tokens, or larger, falls outside the case this guidance describes.
  • The governing measure is the token count of the knowledge base. The figure of about 500 pages is only an approximate human scale that depends on page density.
  • The guidance does not give a direct instruction for larger knowledge bases, and it does not extend to other models, which need their own evaluation or guidance from their developers.

Related concepts

More concepts starting with M