Skip to main content

How to Write Effective Instructions for the Pipefy AI Assistant and Prevent Hallucinations

This guide will teach you how to configure the AI Assistant and write a robust prompt that unifies its functions, preventing "hallucinations" and ensuring high-quality performance.

Product Team avatar
Written by Product Team
Updated this week

🛠️ The 3 Pillars of Your AI Assistant's Configuration

  • Pillar #1: The Welcome Message

This is the user's first interaction with the AI. A good welcome message is crucial for setting expectations, introducing the assistant, and clarifying its capabilities from the very beginning.

This helps guide the user and reduces the chance of out-of-scope questions, thereby preventing hallucinations.

What to do: In the assistant's configuration, add a clear and objective greeting that explains who it is and what it does.

Example Welcome Message:

Hello! 👋 Welcome! I'm Pipefy's virtual assistant, and I'm here to help you with anything you need, from information about our products and services to support with questions and processes.

How can I help you today?

  • Pillar #2: The Form as a Script (For Creating Cards)

When the assistant's function is to start a process (create a card), the form is the foundation for everything.

  • The Form (Fields and Conditionals): It's the script of the conversation. It defines WHAT to ask and in what order, using clear fields and conditional logic to create a structured flow.

For more information, read:

  • Pillar #3: "Custom Instructions (Prompt)" and Knowledge Skills (For Answering Questions)

The assistant can be trained to answer questions based on your documents (internal policies, manuals, FAQs).

For more information, read:

  • The Custom Instructions (Prompt): This is the acting direction. It defines HOW the assistant should behave—its tone of voice (formal, friendly?), its personality, and general interaction guidelines.

The most common error that causes "hallucinations" or unexpected behavior is trying to put the script inside the acting direction. For this function, follow the best practice of not replicating the logic of conditional fields in the prompt.

❌ What Not to Do: Replicating Logic in the Prompt

Let's analyze a real-world example of a prompt that confuses the AI. The intent is good, but the execution creates conflicts.

Example of a problematic prompt:

> "_Were there visible marks on the property (e.g., burns, stains, or perforations) caused by the lightning strike?_" > Answer: Yes | No

If YES:

After the process is complete, you will receive an email with instructions for sending images of the marks.

If NO:

"Was the electric company contacted?" Answer: Yes | No → If YES: "Do you have the service protocol number from the electric company? If so, please provide it."

Why is this a problem?

  1. Redundancy: The AI Assistant already knows which fields are in your form. If you have a field named "Was the electric company contacted?", you do not need to tell the AI to ask this question in the prompt. The field's name is the instruction.

  2. Logic Conflict: The entire "If YES, do X; If NO, do Y" structure must be controlled by the form's conditional field rules, not the prompt. By placing this logic in the instructions, you create two sources of truth, and the AI can become confused about which one to follow.

✅ The Right Way: Let the Form Guide the Conversation

The correct approach is to drastically simplify the prompt and build all the data collection intelligence directly into your Pipe's form.

  • Step 1: Structure Your Form Correctly

In your form editor, drag the necessary fields into the creation area. Use clear and direct field names, as they will serve as the questions the AI will ask.

For more information, read:

  • Field 1: Were there visible marks on the property caused by the lightning strike? (Type: Single-select - Yes/No)

  • Field 2: Was the electric company contacted? (Type: Single-select - Yes/No)

  • Field 3: What is the service protocol number from the electric company? (Type: Short text)

  • Field 4 (Informational): Use an "Instruction" field type with the message about sending photos.

  • Step 2: Apply Conditional Rules

With the fields created, use Pipefy's powerful conditional logic to create the flow. Click on a field and then on the "Field Conditionals" icon to define your rules.

  • Rule 1: IF the field Were there visible marks... is answered Yes, THEN display Field 4 (with the instruction about photos).

  • Rule 2: IF the field Were there visible marks... is answered No, THEN display the field Was the electric company contacted?.

  • Rule 3: IF the field Was the electric company contacted? is answered Yes, THEN display the field What is the service protocol number....

  • Step 3: Write a Clean and Focused Prompt

Now that all the logic resides in the form, your custom instructions can focus solely on the AI's behavior.

🏆 Advanced Prompt Example: Uniting Tasks and Knowledge

The "Custom Instructions" (the prompt) bring all the pillars together, defining the assistant's personality and rules of engagement.

Master Prompt Template:

You are a virtual assistant for the Pipefy company and must act as a professional and trustworthy extension of the brand.

Your communication should be clear, courteous, and efficient. Use a human-like, accessible, and direct tone of voice, always demonstrating empathy and a focus on resolving the user's needs.

Avoid excessive formality, but maintain a respectful and attentive standard in all interactions.

Your role is to provide accurate information about the company's products, services, processes, and policies, based on the skills you have configured; always use them to find context for your answers.

Whenever possible, anticipate the user's needs and deliver useful, well-structured, and unambiguous guidance.

When you do not know the answer or when the request requires human intervention, acknowledge this transparently and escalate the user with politeness and clarity.

You must not give personal opinions, make promises on behalf of the company, or share confidential or speculative data.

Do not engage in conversations about politics, religion, or any topic outside the scope of the company's business.

Your focus must be on offering effective support, maintaining user trust, and representing the organization's values in all responses.

🔬 Dissecting the Advanced Prompt: Why It Works

  1. Clear Persona and Tone: Defines who the AI is and how it should communicate.

  2. Explicit Main Directive: The instruction to act "based on the skills you have configured" is key. It directs the assistant to always consult its knowledge base (Skills) before answering.

  3. Robust Guardrails: The boundaries teach the assistant how to act safely: what to do when it doesn't know something, what it is forbidden to say, and which topics to avoid.

Behavior and Process

Your role is to provide accurate information about the company's products, services, processes, and policies, based on the skills you have configured—always use them to find context for your answers. Whenever possible, anticipate the user's needs and deliver useful, well-structured, and unambiguous guidance.

Rules and Guardrails

  • DO NOT FABRICATE INFORMATION: Never promise timelines, amounts, approvals, or next steps that are not explicitly written in an "instruction" type field within the form.

  • OUT-OF-SCOPE QUESTIONS: If the user asks a question you cannot answer (e.g., "When will my repair be approved?"), respond politely: "I do not have access to that information, but the responsible team will review your request and contact you with all the details."

  • FOCUS ON THE FORM: Your sole task is to fill out the fields in the form. Do not deviate from this purpose.

By following these guidelines—with a well-structured form and a clean prompt—you will have a much more predictable, efficient, and hallucination-free AI Assistant.

Did this answer your question?