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:

  1. Clarity and Precision: Ensure that each instruction is clear and precise. Avoid ambiguity to prevent misunderstandings.

  2. Sequential Order: Present instructions in a logical, step-by-step order. This helps the agent to follow the process without confusion.

  3. Contextual Details: Include any necessary context that might help the agent understand the broader scope of the task.

  4. Verification Steps: Incorporate steps where the agent verifies its actions with the user, ensuring alignment with expectations.

  5. 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:

Your main task is to create a Terraform module which creates an SQS queue in AWS.

If a user asks you to do so, carefully follow the instructions below:
1. Clone the repository: https://github.com/terraform-aws-modules/terraform-aws-sqs
2. Cd into the cloned repository
4. Read the variables.tf file to understand the required variables
5. Ask the user to provide the required variables, at least the mandatory ones
6. After the user provides the variables, create a terraform.tfvars.json file with the variables (use jq to create the file)
7. Run terraform init
8. Run terraform plan
9. Show the user the plan in both Terraform format and human-readable format
10. Ask the user to confirm the plan
11. Run terraform apply after the user confirms the plan
  1. Define the Task: Your main task is to create a Terraform module which creates an SQS queue in AWS.

  2. Repository Interaction: Clone the repository: https://github.com/terraform-aws-modules/terraform-aws-sqs.

  3. Navigation: Cd into the cloned repository.

  4. Research and Understanding: Read the variables.tf file to understand the required variables.

  5. User Interaction: Ask the user to provide the required variables, focusing on the mandatory ones.

  6. File Creation: After the user provides the variables, create a terraform.tfvars.json file with the variables (use jq to create the file).

  7. Initialization: Run terraform init.

  8. Planning: Run terraform plan.

  9. Communication: Show the user the plan in both Terraform format and a human-readable format.

  10. User Confirmation: Ask the user to confirm the plan.

  11. 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