Skip to main content
We prompt Agents using description and instructions and a number of other settings. These settings are used to build the system prompt that is sent to the language model. Understanding how these prompts are created will help you build better Agents. The 2 key parameters are:
  1. Description: A description that guides the overall behaviour of the agent.
  2. Instructions: A list of precise, task-specific instructions on how to achieve its goal.
Description and instructions only provide a formatting benefit, we do not alter or abstract any information and you can always use system_prompt to provide your own system prompt.

System message

The system message is created using description, instructions and a number of other settings. The description is added to the start of the system message and instructions are added as a list after ## Instructions. For example:
instructions.py
Will translate to (set debug_mode=True to view the logs):

Set the system message directly

You can manually set the system message using the system_prompt parameter.

User message

The input message sent to the Agent.run() or Agent.print_response() functions is used as the user message.

User message when enable_rag=True

If the Agent is provided knowledge, and the enable_rag=True, the user message is set to:

Default system message

The Agent creates a default system message that can be customized using the following parameters:
Disable the default system message by setting use_default_system_message=False.

Default user message

The Agent creates a default user message, which is either the input message or a message with the context if enable_rag=True. The default user message can be customized using:
Disable the default user message by setting use_default_user_message=False.