Skip to main content

Create agent

here we explain a Step-by-Step guide to generate an Agent

Step 1: Configure the Prompt and messages​

The first step in creating an agent is to configure the prompt. This is crucial for defining the agent's behavior and capabilities.

Prompt Examples​

  1. For a question-answering agent:

    You are an assistant for [organization] customers, which is dedicated to [activity]. You are focused on assisting people to [objective].
    If asked about [topic], you should respond [instructions].
    You must not respond about [prohibited topics].
    Some examples to use as reference and information: [examples].
  2. For an agent with a defined objective:

    Your objective is to gather data for [purpose]. Specifically, the points to gather are: [list of points].
    Regarding the first point, if they respond [response], you should also ask for [additional information].
    When you finish gathering the data, you must [final action].

Types of Messages to Configure​

  • Initial message: Welcome greeting in the chat. Example: "Hello, I'm the agent for [organization]. How can I help you?"
  • Forced termination message: Displayed when the user asks inappropriate questions or tries to confuse the agent. The chat will end after this message.
  • Lack of information message: Displayed when the agent doesn't have information to respond.

Conversation starters​

Conversation starters are suggested questions shown to the user as clickable bubbles above the chat input, only on the first message of a new chat. Clicking a bubble fills the input with that question. Bubbles that don't fit in the row are grouped in an options button.

They are configured in the Conversation starters field:

  • When creating an agent, in the Advanced section of the General step, with the Show in chat switch.
  • When editing an agent, at the end of the General section. To show them in the chat, turn on Conversation starters in the Features card of the Configuration section.

You can add up to 6 conversation starters, of up to 80 characters each. New agents have no conversation starters and the feature is turned off.

Step 2: Choose Generation Configuration​

Select the generation configuration for the main call and the prior call (if necessary). use prior call if you need to execute tools with LLMs prior the main call (for example generate a plan or execute a search).

Step 3: Tools Configuration​

Select the tools to make available to the language model. They can be Python scripts available in the tenant or MCP tools. You can also write your own script tool.

In case you write your own Script tool, take into account:

  • Python code with parameter definition (name, description, type, required).
  • Assignment of the "response" variable with the script result.
  • Available variables: params (parameter dictionary), chat (chat information), secrets dictionary (secrets configured in tenant).

Step 4: Search Configuration​

Select the search tools you want to make available to the language model. Searches can be created from here if you wish. Searches are associated with topics containing documents.

In case you decide to create a search, take into account: Define information retrieval modules: query techniques, reordering strategies, and reference formats.

  • Search name.
  • Topic of documents it belongs to.
  • Detailed description (important for the model to interpret when to use the search).

Step 5: Additional Configurations​

Adjustable Parameters​

  • Temperature (0-2): Controls the agent's creativity.
  • Number of interactions: Maximum number of messages in the chat.
  • Message size: Maximum length in tokens.
  • Consecutive tool calls: Maximum number allowed.
  • Additional text for user messages.

Optional Functionalities​

  • Fixed questions: For topics that require predefined answers.
  • Common questions: To load frequently asked questions and answers.
  • Self-Improvement Mode (SIM): Allows adding common questions interactively in non-production environments.
  • Lessons: Allows adding global context to agents that will apply only in relevant queries.

By following these steps, you can create a personalized and efficient agent using the Cognitive Solutions platform.