en

How to build your first AI-powered chatbot

Learn how to create your first custom AI chatbot, powered by your own data, using NeuroSpace – a powerful chatbot platform for professional bot developers, marketers, agencies, and businesses.

Before you begin building your chatbot, you'll need to add either your OpenAI API key to the system or obtain a NeuroSpace API key. It's also recommended to prepare a prompt to guide your chatbot's responses.
Содержание:

API Keys

An API key is a unique identifier – a secret token used to authenticate and authorize access to the OpenAI API. It connects your AI chatbot to GPT models and tracks token usage for billing purposes. API keys are also required for creating Assistants and Vector Stores.
The NeuroSpace platform supports two types of API keys:

  • NeuroSpace API Key — used to create AI chatbots and NeuroSpace Vector Stores. This key is generated when you add funds to your NeuroSpace account for pre-billing. Learn how to obtain NeuroSpace key
  • OpenAI API Key — used to create AI chatbots, Assistants, and both NeuroSpace and OpenAI Vector Stores. You can obtain this key from the OpenAI platform. Learn how to generate an OpenAI key
If you choose to use a NeuroSpace API key, you can proceed directly to creating your first chatbot. If you already have an OpenAI API key and wish to use it, add it in the OpenAI Settings panel.
Note. We validate your OpenAI keys so an invalid one can't be added to a system. To use an OpenAI key, your OpenAI account must have a positive balance. Also make sure that you have enough dialogues (chats) your AI chatbot can manage.

Prompt for your chatbot

A prompt is an instruction that your AI-powered chatbot will follow when generating responses. It is recommended to prepare the prompt before you start building your AI chatbot.

Follow these recommendations:

Template. Use our prompt template as a starting point. Copy it and customize it to suit your business processes.

Markup. Use Markdown or JSON markup to structure the information within your prompt.

Size. AI chatbots have limitations on the amount of text they can process, which affects the maximum prompt size. We recommend keeping prompts to about 7-10 pages. If you plan to add a Vector Store to your chatbot in the future, keep the prompt minimal and include only the essential information.

In this article we cover how to craft the perfect AI prompt.

How to create a Chatbot

After logging in, you'll land on your account dashboard. Click the + New Chatbot button.
Configure your chatbot settings:
Use Assistant

If you have previously created an Assistant in the Assistants 2.0, you can add it to your chatbot. Enable the Use Assistant option and select an Assistant from the dropdown menu below.
Note. You can only add an Assistant to your chatbot when creating a new one. Once the chatbot is created, the Use Assistant option will no longer be available.
Chatbot name

Type your chatbot’s name here. Ex. NeuroSpace Chatbot
OpenAI Key

If you do not create an Assistant-based chatbot, select your API key: either the Neurospace key or the OpenAI key.
ChatGPT model used

Select one of the available general-purpose or fine-tuned GPT models. GPT models vary in pricing for request processing, response generation speed, and the number of messages they retain in memory.
Remembered messages count (Conversation context)

Specify the number of recent messages your chatbot should remember during conversations with users. The recommended conversation context is set by default, depending on the chosen GPT model.
Instruction for the bot (prompt)

Provide your chatbot with a clear and concise prompt. You can use our prompt template as a starting point. Copy the template and customize it as needed. Use Markdown or JSON markup to structure the information within your prompt. This article provides guidance on crafting effective AI prompts

Note. The current date is automatically included in every prompt on the platform using the following format:

' Current date: ' . date('Y-m-d'). ', keep this in mind when booking and making online appointments. ';

If you require assistance creating a prompt for your AI chatbot, please email us at info@neurospace.pro or contact us on Telegram.
We skip the Stages because it is a specific functionality. Read here to learn more about this →
Maximum number of tokens (response length)

Specify the maximum length of your chatbot's response in tokens. Larger values allow for longer responses but may increase generation time.
Note. A token can represent a word, part of a word, a special character, or part of an emoji. The optimal number of tokens depends on your business processes and the selected GPT model, considering the complexity of typical user requests and the desired length of the response.

For the o1 and o3-mini GPT models, a minimum of 3,000 tokens must be specified.
You can monitor token consumption in the Chatbot Dialogs panel. Navigate to the Chatbot Dialogs panel, select a dialogue, and hover your mouse over a message to view its token count.
Temperature

Temperature controls for the randomness of chatbot's responses. Set the value between 0 and 2, where:

0 — results in conservative and predictable responses closely aligned with the prompt;
2 — results in highly unpredictable and creative responses.

Choose the temperature value that achieves the desired balance between consistency and creativity for your specific use case.
Note. Different temperature settings produce different prompt data processing results. It is recommended to test your chatbot with various temperature values and adjust it or your prompt accordingly.
Maximum number of chatbot responses

Set a limit for the number of responses your chatbot will give. Once this limit is reached, the chatbot will stop participating in the conversation.

When this is needed: This feature is useful for preventing your chatbot from engaging in endless message exchanges, especially to block interactions between your chatbot and spam bots, thereby saving tokens.
Pause before chatbot response (in seconds)

Specify the duration in seconds for the pause that the chatbot should maintain before sending a response to the client.

When this is needed: The pause is necessary when the user asks questions in several consecutive messages. It allows the chatbot to combine responses to these questions into a single message.
Top P

Also known as nucleus sampling, this parameter controls the diversity of the generated text. It determines which tokens are considered when the model predicts the next word, influencing the balance between coherence and randomness.

  • 1 — the model considers all possible options for continuing the text and generates a more unpredictable response;
  • 0 — the model will choose from the smallest possible set of words. This is necessary when you need to obtain more specific and focused information.

Ex.: when Top P is set to 0.1, the chatbot selects the more popular words.
Frequency penalties

The frequency penalty parameter is a value between -1 and 1. It controls the likelihood of selecting more frequent or rare words during text generation. A higher value encourages the model to choose less frequent words, while a lower value promotes the use of more common words.

Ex.: when the frequency penalty is set to 2, the model selects from a wide range of words, avoiding repetitions.
Presence penalties

The presence penalty parameter ranges from -2.0 to 2.0 and affects how the AI agent selects new tokens (words and phrases) that have already been used in a conversation. A higher value encourages the model to choose new words and phrases, avoiding repetitions.

  • 2: encourages the model to select new words and phrases, avoiding repetitions.
  • -2: encourages the model to repeat words and phrases that have already been used in the conversation.

Ex.: when the presence penalty is set to 1, the model tries to use new words instead of repeating what has already been said.
Words to block a chatbot

Specify a command that will immediately disable your chatbot. Simply send this command to your AI bot via WhatsApp or Instagram Direct. The case of the command (uppercase or lowercase) does not matter.

Example of a block command: stopbot

Purpose: Use this command when you notice that your AI bot is not conducting the conversation appropriately.

Where to use: This command is applicable only in WhatsApp and Instagram Direct.

Who can block the bot by a command: the operator or the AI-bot itself (if the Use blocking words in ChatGPT replies option is enabled).
Note. If a block command is specified you can choose a locking period.
Locking period

If you have specified a block command in the Words to block a chatbot field, select a duration from the Locking period dropdown menu during which your chatbot will be disabled: 60 minutes, 12 hours, or permanently.
We skip the Chatbots work by trigger words option because it is a specific functionality. Learn how to trigger chatbot conversations using specified words here →
Response split type (segmentation)

This parameter specifies the segmentation of chatbot responses into sentences or paragraphs. It makes the conversation with AI-bots more human-like. It may be more convenient for a client to receive a reply if it is divided into small segments of text.
When choosing segmentation responses into sentences or paragraphs, a new field appears below. Specify the number of sentences or paragraphs that the chatbot should divide its response into.
If you do not want your chatbot to divide responses into segments set to No.

More options

You can use additional options when customizing your chatbot. Here, we highlight the key options available for creating a simple chatbot.
Whisper

This is the speech recognition feature that enables the chatbot to convert audio messages it receives into text and generate responses.
Remove special characters

Enable this option if your prompt includes markup special characters like *# and you want to eliminate them from your chatbot's responses.
Example of a response with markup special characters:

Hi! We would like to offer you the following tours:

1. **Paris** - $2,107
2. **London** - $5,000
3. **Italy** - $1,874
Example of a response without markup special characters:

Hi! We would like to offer you the following tours:

1. Paris - $2,107
2. London - $5,000
3. Italy - $1,874
Remove brackets

Enable this option if your prompt contains round or square brackets and you want to remove them from your chatbot's responses.
Respond to images without captures

New GPT models, such as GPT-4o-mini, can recognize simple images without captions, like payment receipts or pictures of sewing products. When a client sends an image during a conversation, the chatbot will provide an appropriate response.
Note. Your chatbot prompt must include relevant responses.
Image formats: .jpg, .png.
Use web search

Select this option if you want to enhance your chatbot’s responses with up-to-date information from the Internet. This feature enriches your chatbot by improving the completeness and quality of its replies.

Enable the Use web search option and choose one of the search models from the list below: gpt-4o-search-preview or gpt-4o-mini-search-preview. These models are specifically designed for online search and do not perform other chatbot functions.
How it works:

When a client asks for information not included in your prompt, the search GPT model retrieves relevant data from the Internet based on the conversation context. Once found, the search results are passed to the chatbot, which then generates a response based on the combined information: search results, prompt, and conversation context.
Example of a response using a search model:
Related articles:
Contact us
If you have any questions or difficulties, please reach out to us in any way that is convenient for you.
Contact information
Republic of Kazakhstan, Almaty,
Auezov Street, 175, building 9a