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

# Retrieval Instructions

> Shape how the AI answers questions: tone, scope, context prioritization, and behavioral rules.

`instructions` are sent to the AI assistant at the start of every MCP session and prepended to every response from the `along` tool. They define the AI's persona, scope constraints, answer style, and behavioral rules when working with a Safe's knowledge.

Unlike `ingestionInstructions`, which run once when content is added, retrieval instructions are active throughout every AI interaction — they travel with the data.

## When to use retrieval instructions

Use `instructions` when you need the AI to:

* Stay focused on a specific topic area and decline out-of-scope questions
* Maintain a particular tone or persona (formal, technical, accessible)
* Always cite sources or use a specific citation format
* Follow formatting conventions (bullet points, structured summaries, prose)
* Apply hard behavioral rules (never speculate, always ask for clarification when ambiguous)

## Parameters

| Field      | Value                                                                                                    |
| ---------- | -------------------------------------------------------------------------------------------------------- |
| Type       | `string`                                                                                                 |
| Max length | 100,000 characters                                                                                       |
| Evaluated  | At session initialization (sent as MCP server instructions) and prepended to every `along` tool response |
| Default    | `null` — no custom instructions                                                                          |

## What you can control

* **Tone and persona** — define whether the AI is formal or informal, expert-facing or accessible
* **Scope constraints** — restrict answers to a specific topic domain
* **Context prioritization** — prefer recent documents, primary sources, or specific content types
* **Answer format** — bullet points, prose, structured templates, citation style
* **Behavioral rules** — hard constraints like "never speculate" or "always ask for clarification"

## How instructions are delivered

When a user connects to a Safe via MCP, Along sends the `instructions` field as MCP server instructions during the `initialize` handshake. This means the AI assistant receives the instructions before any tool is called.

Every subsequent response from the `along` tool also prepends the instructions as a context header — `[Instructions: ...]` — at the start of the tool's output. This ensures the instructions remain in scope for the AI throughout the session, even in long conversations where early context might otherwise be pushed out.

## Examples

### Customer success team

```text theme={null}
You are a customer success assistant for Acme Corp. Only answer questions about customer accounts, product usage, and support history in this Safe.

Always cite the source document when providing information (format: [Document Title, Date]).

If you cannot find a definitive answer in the knowledge base, say so clearly rather than speculating. Do not infer account status or customer sentiment beyond what is explicitly documented.
```

### Sales team

```text theme={null}
This Safe contains sales intelligence. Prioritize recent deal notes and CRM data over older documents.

When discussing competitors, present only factual information sourced from recorded calls or documents — do not infer competitive positioning.

Format all deal summaries with these fields:
- Stage
- Key contacts
- Last activity
- Next steps

If a field is not documented, write "Not recorded" rather than omitting it.
```

### Engineering knowledge base

```text theme={null}
Answer technical questions concisely. Prefer precision over completeness — a shorter accurate answer beats a longer uncertain one.

When referencing architecture decisions, always note the date of the decision document.

Flag any information older than 12 months as potentially outdated: append "(Note: sourced from [date] — verify current state)" to the relevant claim.

Do not answer questions outside the scope of this knowledge base. If asked about something not covered, say "That's not documented in this Safe."
```

<Note>
  Safe API keys can also carry their own `instructions` field. When a request is made using a Safe API key that has its own instructions, those instructions are appended after the Safe's instructions — separated by a horizontal rule. This lets different teams or integrations use the same Safe with different behavioral contexts, without needing to create separate Safes.
</Note>
