> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getvirtualbrain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Sources: Inline vs. Retrieval

> The single most important concept on the platform: how a block knows what it knows, plus Brains vs. uploads and the golden rule of retrieval

Everything a block knows arrives through exactly one of two mechanisms.

## Inline vs. Knowledge Source

| Dimension                   | Inline `/variable`                                                                                | Knowledge Source                                                   |
| --------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| **What the Mainframe sees** | The complete text, inside the prompt                                                              | Only extracts retrieved by a search                                |
| **Best for**                | Short, targeted content (1,000 words or fewer): user answers, choices, concise upstream summaries | Long content: uploaded documents, Brains, verbose upstream outputs |
| **Listed in the prompt?**   | Yes, under "Inputs" as `/variable_name`                                                           | No, attached at block level, never listed as a variable            |
| **Needs search guidance?**  | No, the text is already there                                                                     | Yes, the prompt must say what to look for                          |
| **Risk if misused**         | Long text blows the prompt budget and dilutes instructions                                        | Vague prompts retrieve the wrong extracts                          |

<Warning>
  The two failure modes are mirror images. Inline content that is too long crowds out your instructions. A Knowledge Source searched with a vague prompt returns the wrong extracts. Match the mechanism to the content.
</Warning>

## Brains vs. Document Uploads

Ask whether the dataset changes with every run.

* **Stable and shared across runs becomes a Brain.** Methodology guides, scoring rubrics, product catalogs, regulation texts. The designer attaches it once; every run uses it.
* **Different on every run becomes a Document Upload.** The CV to screen, the contract to review, the RFP to answer. The end user provides it at runtime.

A Brain can be attached two ways:

* **Fixed at block level**: this block always searches Brain X. This is the normal case.
* **As a user-selectable input**: let the user pick one file from dataset X.

<Tip>
  Pick fixed unless the user genuinely needs to choose. A fixed Brain keeps the App deterministic; a user-selectable Brain adds a decision the runner has to make correctly on every run.
</Tip>

See [Creating Brains](/features/brains/creating-brains) to build a stable dataset, and [Connectors](/features/brains/connectors) to keep one synced from a source system.

## Every search needs context

A block that searches a Knowledge Source retrieves what the prompt asks for, nothing more. A prompt that just says "analyze the document" retrieves arbitrary extracts. Always give the retrieval something to aim at.

<CodeGroup>
  ```text Preferred: an inline upstream variable theme={null}
  Using the requirements in /job_requirements, search the candidate
  database for matching skills and experience.
  ```

  ```text Fallback: descriptive text in the prompt theme={null}
  Search the methodology guide for the scoring criteria, the
  weighting rules, and the disqualification thresholds.
  ```
</CodeGroup>

The preferred approach uses a short upstream output as the search query: the inline variable acts as the target the retrieval aims at. Use the fallback, descriptive text in the prompt, when no suitable upstream variable exists.

<Note>
  Vague prompts produce vague results here as everywhere else on the platform. See [Brains](/features/brains/overview) for how retrieval works under the hood.
</Note>

## Next

<CardGroup cols={1}>
  <Card title="Passing Data Safely Between Blocks" icon="arrow-right-arrow-left" href="/apps-academy/passing-data">
    Routing the hand-offs between blocks, and how to get them right.
  </Card>
</CardGroup>
