# Attach and retrieve knowledge

Attach ready workspace documents to an agent, choose how their content enters a conversation, and verify the result in test chat.

## Attach documents

Open the agent's Knowledge section and select documents from the workspace library. An agent configuration can reference up to 50 documents. Every selected document must still exist and have status `ready` when the configuration is published.

![Agent Knowledge Base with a ready synthetic support document attached in Search it mode](/docs/product/knowledge-base-attachment.webp)

Attachment stores document references in the draft. It does not duplicate the documents, and it does not affect the active version until Main is published.

## Choose a retrieval mode

In `auto` mode, Operade searches the indexed content for each turn. The default configuration retrieves up to five chunks and accepts a maximum vector distance of `0.6`. Smaller maximum distances are stricter matches.

In `prompt` mode, Operade includes the selected document text directly instead of performing per-turn retrieval. The configured combined document-text limit is 50,000 characters. Use this mode only when the full selected material should be present on every turn.

Knowledge content is untrusted context. Uploaded text cannot replace the system prompt or become a system instruction merely by containing instruction-like language.

## Verify retrieval

1. Wait until every selected source is ready.
2. Save the agent draft and start [test chat](/docs/agents/test-chat) with the draft enabled.
3. Ask a question whose answer appears in one selected source.
4. Ask a second question that the source does not answer and confirm the agent follows the prompt's missing-information rule.
5. Publish Main only after the draft behaves as intended.

If a source cannot be selected or publishing rejects it, inspect [limits and troubleshooting](/docs/knowledge/limits-and-troubleshooting).
