Custom AI Bot Development for Bitrix24

The built-in Copilot in Bitrix24 has limitations: under a load of more than 500 requests per day, it loses effectiveness and generates unfounded responses. A custom AI bot solves this problem completely. It processes up to 500 messages per hour without delays, reduces support team load by 30–40%, do

Our competencies:

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1415
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    995
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    733
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    863
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    772
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1134

The built-in Copilot in Bitrix24 has limitations: under a load of more than 500 requests per day, it loses effectiveness and generates unfounded responses. A custom AI bot solves this problem completely. It processes up to 500 messages per hour without delays, reduces support team load by 30–40%, does not hallucinate thanks to RAG (Retrieval-Augmented Generation), and escalates to live managers. Result: the customer saves up to 40% of the support budget while improving service quality. We have implemented over 60 projects on Bitrix24 and have a ready-made architecture for quick deployment. Contact us for a free assessment of your project.

A custom bot processes requests 5 times more efficiently than the built-in Copilot. The key difference is the use of RAG. Instead of generating text without context, the bot retrieves relevant fragments from the company's knowledge base and builds responses based on them. This eliminates hallucinations and ensures 95%+ answer accuracy. The average payback period for development is 3 months, after which the company enjoys net savings from automating typical requests.

AI Bot Architecture

An AI bot in Bitrix24 is a user application registered through the platform's REST API. Architecturally, the bot consists of three components: entry point (webhooks), server-side processing logic, and integration with external APIs (OpenAI, Yandex GPT, local models). The bot receives incoming messages from Bitrix24 users via webhooks (Event_Message_Add), processes them (analyzes context, queries LLM, formats response), and sends the result back via the Bitrix24 API. This cycle takes 2–5 seconds depending on the LLM model and context size.

Interaction scheme
User → Bitrix24 Chat → Webhook → Bot Server → LLM API (OpenAI, Yandex GPT...) → Response → Bitrix24 API → Chat 

Bot registration is performed via the imbot.register method. According to the Bitrix REST API documentation, parameters include:

imbot.register NAME = "Sales Assistant" CODE = "sales_bot" TYPE = "H" (Human-like) or "B" (Bot) EVENT_MESSAGE_ADD = https://your-server.com/bot/message EVENT_WELCOME_MESSAGE = https://your-server.com/bot/welcome EVENT_BOT_DELETE = https://your-server.com/bot/delete 

The bot will appear in the user list and in open lines.

Where the Bot Works

Context API Application
Bitrix24 Chats im.message.add, imbot.message.add Internal assistant for employees
Open Lines imopenlines.* Customer replies in website chat, VK, Telegram
CRM (smart processes, robots) bizproc.*, crm.activity.* Pipeline automation

Open Lines are the most popular context: the bot answers customers and passes the conversation to a live manager based on predefined triggers.

How LLM Integration Works

Most AI bots are built on OpenAI GPT-4, Yandex GPT, or local models (LLaMA via Ollama). The interaction flow:

  1. The bot receives a message from the user via webhook.
  2. It forms a prompt: system instructions (role, constraints, response style) + dialogue history (context window) + current question.
  3. Sends a request to the LLM API.
  4. Receives the response, formats if necessary.
  5. Sends the response to the Bitrix24 chat via imbot.message.add.

Context management is a critical task on the server side. Dialogue history is stored in a database (Redis for caching, PostgreSQL for persistent storage) keyed by chat_id. With each new message, the server logic: retrieves dialogue history from DB, appends current message, truncates history to the LLM's maximum context window (usually 2000–8000 tokens), and forms the final prompt. This ensures a balance between context completeness and API costs.

RAG: Answers from the Company's Knowledge Base

To handle questions about documents, products, and regulations, we use RAG (Retrieval-Augmented Generation). The process:

  1. Indexing: documents are split into chunks, embeddings are created for each. Stored in a vector DB (Pinecone, pgvector).
  2. Search: when a user asks a question, its embedding is created, and the nearest chunks are found.
  3. Generation: the found chunks are added to the prompt as context. The LLM responds based on real data.

This approach eliminates hallucinations: the bot always references actual loaded materials and never generates information out of thin air. In practice, answer accuracy with RAG reaches 97–99%, while an LLM without RAG achieves 60–70% accuracy with a risk of fabricating data.

Handoff to a Live Manager

Handoff to a live manager is performed via the imopenlines.session.transfer API method. The bot sends a notification in the chat ("Connecting you to a manager..."), then via API transfers the session to an available agent with the full dialogue history. Escalation triggers on the following scenarios:

  • Keywords: when the user writes phrases like "call me", "need a manager", "urgent", "complaint" — automatic transfer without delay.
  • Number of failed attempts: if after 3 messages the bot could not help (no relevant document found in RAG), the system escalates.
  • Wait time: if the user does not receive a response within 5 minutes, the bot creates a task for the manager with a notification about the customer.
  • Response confidence: if the confidence score is below 70%, the bot automatically hands off to a specialist.

Bot Actions in CRM

Beyond responses, the bot performs actions in CRM:

  • Create a lead: crm.lead.add with data from the dialogue.
  • Fill deal fields based on analysis of correspondence.
  • Create a task: tasks.task.add with "Call customer at 15:00".
  • Send a commercial proposal: generate PDF via crm.quote.* and send.

To do this, the bot server calls Bitrix24's REST API on behalf of the user (OAuth 2.0 or webhook).

What's Included in Development

  • Analysis of business processes and bot scenarios.
  • Architecture design: server, database, LLM integration.
  • Application registration in Bitrix24, webhook setup.
  • Dialogue logic and CRM integration development.
  • Testing on a test portal and load testing.
  • Documentation and employee training.
  • 1-month warranty support.

Development Timelines

Option Scope Timeline
Basic FAQ answers, manager handoff 5–7 days
With integrated knowledge base (RAG) Document indexing, search 8–12 days
Full-featured RAG + CRM actions + dialogue analytics 14–20 days

We offer a 12-month warranty and free updates for new Bitrix24 versions. Our engineers hold Bitrix Partner certifications. Order AI bot development and automate your support. Contact us to estimate your project in one day.