Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/applications/productivity/ai.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Below are some common requests that the *Ask AI* agent can assist with:

ai/apikeys
ai/agents
ai/default_prompts
ai/document_sort
ai/fields
ai/webpage
Expand Down
6 changes: 6 additions & 0 deletions content/applications/productivity/ai/agents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Sources can be in the following formats:
If the :guilabel:`Restrict to Sources` option is enabled on an agent, the agent can **only**
utilize information from the uploaded and active sources.

<<<<<<< 87eb9a70195ce4e896823ec9b2c62543104e2f8e
Uploaded files
--------------

Expand Down Expand Up @@ -171,6 +172,11 @@ the default prompts to use them, or enter a custom one in the message window.
In this case, the agent’s responses are grounded in the file currently being previewed, in
combination with any other sources assigned to the agent.

||||||| 8049862f459aea707947bbd99806f9f50a218018
=======
.. _ai/create-agent:

>>>>>>> b19faf2ff9cd8d6d0a5ba5a296b9a9589759462d
Create a new agent
==================

Expand Down
88 changes: 88 additions & 0 deletions content/applications/productivity/ai/default_prompts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
==================
AI default prompts
==================

.. |AI| replace:: :abbr:`AI (artificial intelligence)`

*Default prompts* define how |AI| behaves when a user opens a conversation from a specific model in
Odoo. They allow users to:

- Automatically call a specific |AI| agent
- Apply contextual instructions
- Display predefined action buttons
- Adapt |AI| behavior depending on the model

Default prompts are model-specific, though they can be applied to all models. This means the |AI|
can behave differently depending on where it is launched in the system.

When a user opens an |AI| conversation from a record, Odoo provides the full context of that record
to the |AI| agent. This includes field values and relevant metadata.

Each conversation is context-bound. When opened from a lead, the |AI| receives information about
that Lead. When opened from an invoice, the |AI| receives accounting context. The conversation is
isolated and reset once closed.

Configuration
=============

Before configuring a default prompt, create or configure the |AI| :ref:`agent <ai/create-agent>` in
the **AI** application.

.. note::
The **AI** application comes with pre-configured agents, and default prompts. These vary based on
the other applications installed on the database.

Navigate to :menuselection:`AI app --> Configuration --> Default Prompts` and click :guilabel:`New`.
Create a :guilabel:`Rule Name`, then select an action in the :guilabel:`When users need to` field.

Next, select a model in the :guilabel:`On the Model` field. This controls what records this rule
applies to. For example, if the rule is specific to *Helpdesk* tickets, select *Helpdesk Tickets*
from the drop-down menu. Multiple selections can be made in this field. To allow this rule to be
used by any model, leave the field blank.

In the :guilabel:`Call the Agent` field, select which agent this rule should apply to. Next, add the
:guilabel:`Instructions` for the rule.

.. note::
While the agent may already have an existing prompt that defines their behavior, the instructions
in the default prompt define the actions in the context of the current model. See
:ref:`Understanding AI prompt structure <ai/prompt-structure>` below for additional information.

.. image:: default_prompts/default-prompt-rule.png
:alt: A default prompt rule record in the AI app.

Buttons
-------

Within each default prompt, buttons can be configured with predefined prompts. While users have the
option to write out a prompt, they can also click one of the buttons to begin the conversation.

On the *Buttons* tab, click :guilabel:`Add a line`, then enter a prompt in the :guilabel:`AI Prompt`
field.

These prompts are then available for a user to select in a conversation.

.. image:: default_prompts/ai-chatter.png
:alt: AI prompts configured as buttons in a conversation with an agent.

.. _ai/prompt-structure:

Understanding AI prompt structure
=================================

|AI| conversations in Odoo are structured using multiple configuration layers.

- Each :ref:`agent <ai/agents/prompts-in-odoo>` has a prompt that defines the global identity and
behavior of an AI agent. It is configured directly on the |AI| agent record and applies wherever
the agent is used. The Agent Prompt defines who the AI is.

- A default prompt configures how an |AI| agent behaves when launched from a specific model. Default
prompt instructions adapt the agent's behavior to the functional context of the model. The default
prompt defines how the AI should behave in this specific context.

- Button prompts represent predefined user requests within an |AI| chat window. They appear as
clickable buttons when a conversation is opened. Button prompts do **not** redefine the agent's
identity or contextual behavior. Instead, they specify what the |AI| should do at that moment.

.. seealso::
:doc:`agents`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.