Create assistant
here we explain a Step-by-Step guide to generate an Assistant
Step 1: Configure the Prompt and messages
The first step in creating an assistant is to configure the prompt. This is crucial for defining the assistant's behavior and capabilities.
Prompt Examples
-
For a question-answering assistant:
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]. -
For an assistant 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 assistant for [organization]. How can I help you?"
- Forced termination message: Displayed when the user asks inappropriate questions or tries to confuse the assistant. The chat will end after this message.
- Lack of information message: Displayed when the assistant doesn't have information to respond.
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 assistant'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 assistants that will apply only in relevant queries.
By following these steps, you can create a personalized and efficient assistant using the Cognitive Solutions platform.