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

# System prompt

An agent's system prompt is set through the `instruction` parameter, which
governs the model's behavior, tone, and how it answers.

## Set instruction

The simplest form is a plain string:

```python lines theme={null}
from veadk import Agent

agent = Agent(
    name="assistant",
    instruction="You are a professional support assistant. Answer concisely and politely.",
)
```

## Dynamic prompts

When the prompt needs to vary with runtime context, there are two options.

**Placeholders**: use `{variable_name}` in the string; at runtime it is filled
from the matching value in session state.

```python lines theme={null}
agent = Agent(
    instruction="You are serving user {user_name}. Answer concisely and politely.",
)
```

**InstructionProvider**: pass a function that receives the runtime context and
returns the prompt string, letting you read session state to build the prompt
yourself. The function can also be an `async` function.

```python lines theme={null}
from google.adk.agents.readonly_context import ReadonlyContext
from veadk import Agent

def build_instruction(ctx: ReadonlyContext) -> str:
    user_name = ctx.state.get("user_name", "there")
    return f"You are serving {user_name}. Answer concisely and politely."

agent = Agent(instruction=build_instruction)
```

`ctx` also exposes `user_id`, `user_content`, and `session`; session state is
written by the session and tools during a run.

## instruction vs. description

* `instruction`: the system prompt that guides how the model reasons and answers.
* `description`: a short summary of the agent's capabilities, used mainly for
  routing and selection in multi-agent scenarios — it does not act as the system
  prompt.
