MMOOZZGG.com

How to build an AI agent

How to add an AI agent to your website yourself: from widget to CRM request

5 min read7 sources

How to add an AI agent to your website yourself: you need a chat window, a model and an answer base built from your pages, and the agent passes each request to a manager. The window and the base are built in an open-source builder in a week. Collecting contacts in a chat falls under 152-FZ, Russia’s personal data law: since 1 September 2025, consent to data processing is given separately from other documents.

On this page · 4 sections

Build it yourself in a week

Widget and model

A widget is a chat window in the corner of the page. Behind it stand the builder where the agent is assembled and the model that writes the answers.

The shortest path is Flowise, a visual agent builder with a ready website widget. An agent built in it goes onto a page with one script.

1. Build the agent in Flowise and take the embed code: a script that calls Chatbot.init with the agent ID (chatflowid) and the address of your Flowise server (apiHost).

2. Paste the script into the HTML of your pages between the opening and closing body tag.

3. Set the look of the window with the theme parameter: the button, the tooltip, the window title, colors and starter questions.

4. If the browser reports a CORS error (the server did not allow a request from another site), the Flowise documentation advises setting the CORS_ORIGINS and IFRAME_ORIGINS variables on the server.

n8n gives another path. The Chat Trigger node, with the Make Chat Publicly Available option on and the Embedded Chat mode, accepts messages from your chat window, for example from the n8n widget that ships as the @n8n/chat package.

Choose the model before you build. If visitors’ questions must not leave the country, take an open model on your own server in Russia and connect it in the builder.

Answer base from the website

The answer base is your pages split into fragments. Before each answer, the agent searches the fragments for the question and answers from them. This approach is called RAG; Lewis and co-authors described it in 2020, and the model is not trained for it.

1. Add the Cheerio Web Scraper loader (it collects text from pages) to Flowise and enter the site address in the URL field.

2. In the Get Relative Links Method field, choose collection by the XML sitemap or by following links from the given page. The sitemap is more precise: it has only the pages you gave to search engines yourself.

3. Check the Get Relative Links Limit field. By default the loader takes 10 links, and a value of zero removes the limit. Without this setting, on a site of a hundred pages the agent learns only about the first ten.

Besides the pages, the base gets what the site lacks: terms for wholesale clients, the return process, answers to common questions from email. How such a base works is covered on the page on the RAG agent.

Before launch, ask the agent 10 questions whose answers are surely on the site and 3 questions that have no answer there. To the second kind, the agent must say plainly that it does not know and offer to contact a manager, not make up terms.

The base is updated together with the site. If a price changed on the page but the old one stayed in the base, the agent will quote the old one.

Request and consent to data

As soon as the agent asks for a name and a phone number, it collects personal data. From that moment the chat falls under 152-FZ just like a request form.

Since 1 September 2025, consent to personal data processing is given separately from other information and documents: Law 156-FZ of 24 June 2025 added this to Article 9 of the law. In a chat, this is a separate step: a link to the consent text and an action by the visitor before they leave a contact. The consent box is never ticked in advance.

The data of Russian citizens is collected and stored in databases in Russia, and before a transfer abroad the operator files a notice with Roskomnadzor, the Russian data protection regulator. If the model or the builder runs abroad, the chat with the customer’s phone number goes there too.

The price of a mistake has grown. Since 30 May 2025, a company pays 1–3% of revenue for a repeat personal data leak, but no less than $300,000 and no more than $6 million.

A review of the law for AI agents is in the article on 152-FZ, and our storage rules are on the page on data security. Check the consent and policy texts for your own site with a lawyer.

CRM integration

A request from the chat brings money when it reaches a manager at once: in the CRM, with the chat text and the page the customer came from.

For this, the agent gets a tool, that is, an action it calls by itself, for example create a deal. The tool gets a CRM access key only for creating deals and contacts, with no rights to delete or export the database.

Until the CRM link exists, start simpler: the agent sends the request by email or as a message to a manager in a messenger. This does not replace a CRM, but a request from a night chat is no longer lost until morning.

This is where the simple scenario ends. Next you need duplicate checks, distribution of requests among managers, a log of the agent’s actions and a ban on creating a deal without the customer’s consent. We connect such links to amoCRM and Bitrix24.

We launch a ready AI agent for a website with a CRM link as a pilot: from $1,499, 14 days, with the metric in the contract. What it does on the site and what it costs is described on the page on the AI agent for a website.

Sources and fact-checking

Checked by the editors on 16 October 2026.

  1. arXiv 2005.11401, 22 May 2020 (arxiv.org)
  2. Brace Law Firm, 9 July 2023 (brace-lf.com)
  3. ppt.ru, 30 November 2024 (ppt.ru)
  4. Garant, What changed in personal data for online business from 1 September 2025, 4 September 2025 (harant.ru)
  5. Flowise documentation: Embed, checked 16 October 2026 (docs.flowiseai.com)
  6. Flowise documentation: Cheerio Web Scraper, checked 16 October 2026 (docs.flowiseai.com)
  7. n8n documentation: Chat Trigger node, checked 16 October 2026 (docs.n8n.io)

Found a mistake? Tell us

Publications

Contact us