Agents
AI agents allow you to isolate the logic and data sources for performing different tasks. Suppose, we have the following problem: we need to separate access to data sources depending on the language the question was asked in. If the question was asked in English, we want the chatbot to look the answer in the data sources A and C, whereas if the question was asked in French, we want that chatbot only looks in the data source F. Another use case is "We want the chatbot behaves differently depending on the user - if he/she is already our client we want to use one prompt, and if not yet, another prompt".
Before introducing agents, it was not possible to separate the logic or/and data sources for different cases, now you can create scenarios covering many complex use cases.
Please note that using Agents is not 100% reliable as it's controlled by the main prompt. It's the very first step to expand the chatbot possibilities but in some cases, the logic may not work.
Adding a new agent
To add a new agent, open an existing project and select the Agents menu:
Then click the Add a new agent button:
The drawer with a new agent's properties will open on the right:
Let's review the agent's properties:
Enable/disable agent
Please note that a new agent is disabled by default. To use an agent you need to enable it. The disabled agents are not participating in the workflow.
Agent name
Just a short name that will be shown on the agent's card. The name is not shared with the users.
Please note that the agent name can't have spaces, so they are replaced with underscore automatically:
Agent description
Describes what it's for, what it does
In this field, you have to describe what is this agent for, when it should be called. So, this is instruction for the AI to make a proper decision on calling (or not calling) this agent. Here is the good example:
Useful for responding in english. If the user is speaking english, you should use this tool.
Agent prompt
Give the instructions on HOW to handle the query
Every agent may have their own prompt. You can add whatever you want but don't make the prompt too long as long prompts may be confusing for the AI. The best practices are the same as for the chatbot, please refer our article on mastering prompts (opens in a new tab).
Linked data sources
Expand to see the list of available data sources. If you don't have any data sources yet, you will see the warning message:
To add a data source click the Add button:
and if you later would like to unlink the data source, click the Remove button:
Deleting an agent
To delete an agent, simply open the list of agents and click the Delete button.
Number of agents
The number of agents you can create, depends on your plan. The free plan allow you to create one agent, for the exact amount of agents please refer the pricing page (opens in a new tab). You always can check the numbers of agents (how many you can create and how many you alrady have) on the Limits/Usage page:
How to control and manage agents
Every agent has its own description and prompt and can be called even if you project's custom prompt doesn't mentioned them. So, for example, if your agent answer the questions about orders, it will be used as soon as user asks about an order. But if you want an agent to be called conditionally, you need to mention it in the project's custom prompt. For example, you may write "If a user query is in French language, call the Agent_FR. If a user query is in English language, call the Agent_EN".
How to make sure that agent was called
Now, when you test the chatbot in the Interactions window, you can see that an agent was called and how many OpenAI token were spent. This information is shown on the right of the stat information:
Frequently Asked Questions about Agents
How is number of messages calculated when using an agent?
It's calculated in the same way as using the chatbot: every single question/text/whatever sent to the chatbot (even if it's processed by an agent, internally) considered as one message.