Agent Instructions Prompt
Fine-tune agents to follow specific instructions
Custom instructions empower agents to operate within specific organizational contexts or project requirements. This guide outlines how to set up these instructions effectively.
Overview: Agents can be configured to understand and execute tasks based on dynamic organizational contexts or specific project requirements. This is done by providing clear, step-by-step instructions in natural language. The agent then interprets and follows these instructions to complete the task.
Best Practices:
Clarity and Precision: Ensure that each instruction is clear and precise. Avoid ambiguity to prevent misunderstandings.
Sequential Order: Present instructions in a logical, step-by-step order. This helps the agent to follow the process without confusion.
Contextual Details: Include any necessary context that might help the agent understand the broader scope of the task.
Verification Steps: Incorporate steps where the agent verifies its actions with the user, ensuring alignment with expectations.
Feedback Mechanism: Provide a way for the agent to ask questions or seek clarifications if instructions are unclear.
Example:
To illustrate, consider the task of creating a Terraform module for an AWS SQS queue. Here’s how you might set custom instructions for an agent:
Define the Task: Your main task is to create a Terraform module which creates an SQS queue in AWS.
Repository Interaction: Clone the repository:
https://github.com/terraform-aws-modules/terraform-aws-sqs
.Navigation: Cd into the cloned repository.
Research and Understanding: Read the
variables.tf
file to understand the required variables.User Interaction: Ask the user to provide the required variables, focusing on the mandatory ones.
File Creation: After the user provides the variables, create a
terraform.tfvars.json
file with the variables (use jq to create the file).Initialization: Run
terraform init
.Planning: Run
terraform plan
.Communication: Show the user the plan in both Terraform format and a human-readable format.
User Confirmation: Ask the user to confirm the plan.
Execution: Run
terraform apply
after the user confirms the plan.
Conclusion:
By following these guidelines and using the provided example as a template, you can effectively set custom instructions for agents to handle a wide range of tasks, tailored to your specific organizational or project needs.
Last updated