Skip to main content

Creating effective instructions for AI Agents

Learn how to write clear, contextual, and effective instructions to get reliable and powerful results from your AI Agents.

Product Team avatar
Written by Product Team
Updated over 2 weeks ago

👤 For pipe admins

🔐 Available on all plans

🎯 For those who want to harness the power of artificial intelligence to enhance their processes with a digital workforce.

Creating a powerful AI Agent depends on the quality of its instructions. Clear, logical, and contextual instructions help the agent perform tasks reliably and predictably. Use this guide to learn best practices for writing effective instructions for your automations.

This guide helps you:

  • Create reliable and predictable AI agents

  • Reduce errors and unexpected AI behavior

  • Build more powerful agents to handle complex tasks.


Best practices for writing instructions

Everything you set up is a form of instruction for the AI. To get the best results, follow these key principles.

1. Be clear and direct

Use simple, straightforward language. Start your commands with a clear action verb to tell the agent exactly what to do.

  • Instead of: "I want to know who the customer is"

  • Try this: "Extract the customer's full name from the email body"

  • Instead of: "Check if the deal is important"

  • Try this: "If the 'Deal Value' field is greater than $10,000, update the 'Priority' field to High"

ℹ️ Note: In this example, "Update" is an action command using / or clicking the + button to add dynamic information from Fields or Actions of your process.

2. Provide context

An AI Agent doesn't know anything about a card unless you provide it with information. Use multiple sources of context to guide the AI:

Add Knowledge: Use contextual information such as documents or access to pipe data.

Dynamic Fields: Insert live data from your card (like form fields, card properties, outputs of previous actions, etc.) directly into your instructions.

To do this, use the dynamic field selector to add the desired field, instead of typing it manually.

Example: The instruction Summarize the following email: {{Last email}} is the result of you typing "Summarize the following email:" and then selecting the Last email dynamic field from the Start Form phase, from the UI.

3. Provide examples

Whenever possible, include a brief example of the expected output directly in your instructions. This helps the AI understand the format and type of response you need.

Example: "Extract the ticket ID from the email subject. The ID is always a 7-digit number. For example: 9876543."

4. Be specific about the outcome

Avoid vague commands. The more specific you are, the more accurate the result will be. This includes the names of your output fields.

  • Vague: "Update the card with the info"

  • Specific: "Update the 'Contact Name' field with the customer's full name found in the 'Email Body' field"

ℹ️ Tip: Ensure the names of the fields you select for the results are clear and descriptive (e.g., use "Customer Full Name" instead of "Text Field 1"). The field names themselves are instructions for the AI.

5. Test and refine

Your first instruction may not be perfect. Run tests on a few cards with different scenarios to see how the agent behaves. If the result isn't what you expected, adjust the wording, add more context or simplify the command until it works reliably.


How the AI executes instructions

The AI Agent executes actions sequentially, in the exact order you write them. It reads from top to bottom.

Imagine you have these two instructions:

  1. If the 'State' field is 'California', update the 'Sales Region' field to 'West'.

  2. Move the card to the 'Regional Review' phase.

The agent will always check the condition in the first instruction before it attempts to execute the second instruction.

✅ If the condition is met (the state is California), the agent will first update the 'Sales Region' field and then move the card.

❌ If the condition is not met, the agent will skip the action from the first instruction and proceed directly to the second one, moving the card.


❗ Limits

Instruction Text Limit: You can write up to 10,000 characters of fixed text for your instructions.

Dynamic Fields Limit: You can add up to 30 dynamic fields to provide context to the agent.

Supported File Formats: When using AI agents for data extraction or interpretation of images or documents, the supported formats are PDF, PNG and JPG.


🛠️ Troubleshooting

Symptom: The AI agent isn't performing the correct action or behaves unpredictably.

Possible Cause: The instructions may be ambiguous or lack context.

How to Fix:

  • Check for clarity: Is there a simpler, more direct way to phrase the command? Read your instructions aloud to see if they make logical sense.

  • Verify context: Ensure your dynamic fields, output field names and field descriptions are clear and provide the right information.

  • Review the order: Confirm that the sequence of your actions is logical. Remember, the agent performs them one after the other.


Related Articles

Did this answer your question?