> For the complete documentation index, see [llms.txt](https://docs.patagon.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.patagon.ai/otimizacao-do-agente/how-to-create-an-ideal-prompt.md).

# Como escrever um prompt eficaz

Seu agente segue exatamente o que está no prompt. Nada mais, nada menos. Um prompt vago gera respostas inconsistentes e qualificações erradas antes que você perceba o problema.

1. **Defina o objetivo primeiro.** Responda em uma frase: qual é a única coisa que este agente precisa fazer?
2. **Escreva o prompt completo no editor de Objetivos e Tom.** Não há campos separados. Objetivo, tom, fluxo e restrições ficam em um prompt estruturado.
3. **Use linguagem imperativa.** Escreva "Pergunte sobre o orçamento mensal" e não "O agente pode perguntar sobre orçamento."
4. **Sempre escreva os dois caminhos.** O que acontece quando o lead se qualifica e o que acontece quando não se qualifica. Um agente sem um caminho de desqualificação vai improvisar.
5. **Teste no Playground antes de salvar.** Acesse Agente > Playground, envie pelo menos 5 mensagens de teste: um lead qualificado, um que não atende aos critérios, um evasivo, uma pergunta fora do escopo e uma tentativa de injeção de prompt. Clique em Limpar entre os cenários.
6. **Altere uma coisa por vez.** Quando algo quebrar após uma atualização, você precisa saber o que causou o problema.

{% hint style="warning" %}
Não publique sem testar. Um agente com prompt incompleto pode desqualificar bons leads e qualificar leads ruins. O erro não será visível imediatamente.
{% endhint %}

## Como editar a mensagem de boas-vindas do agente

A mensagem de boas-vindas é a primeira coisa que um lead recebe ao iniciar uma conversa. Ela faz parte do seu prompt. Para editá-la:

1. Acesse Agente > Geral e clique na aba Objetivos e Tom.
2. No editor, encontre a seção que define a primeira mensagem ou saudação.
3. Edite o texto diretamente no editor.
4. Teste a nova mensagem em Agente > Playground antes de salvar.
5. Clique em Salvar.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.patagon.ai/otimizacao-do-agente/how-to-create-an-ideal-prompt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
