AI Chatbot Integration on Your Website (ChatGPT/Claude)

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1All 2062 services
AI Chatbot Integration on Your Website (ChatGPT/Claude)
Medium
~3-5 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    947

Let's face it: when a user lands on your website, they expect an instant answer. Standard FAQs and contact forms simply can't keep up with expectations. The visitor leaves — and that's a lost lead. We solved this problem by integrating an AI chatbot directly into your site. Our experience — 7+ years in web development, 50+ successful chatbot integrations based on GPT and Claude. We guarantee the bot will respond within a second, correctly handle context, and won't eat your token budget.

Integrating an AI chatbot is not just a "proxy to the OpenAI API." It's a full-fledged engineering challenge. You need to properly organize response streaming for good UX, set up a prompt system, handle edge cases, and control costs. It seems easy, but on the first production deployment, problems surface: streaming lags, context overflows, API keys leak. We've been through all these pitfalls and found working solutions.

How to Choose a Chatbot Provider

Each provider offers different capabilities. Comparison of key parameters:

Provider Models Context Strengths
OpenAI GPT-4o, GPT-4o-mini, o1 128K Broad ecosystem, function calling
Anthropic Claude 3.5 Sonnet, Claude 3 Opus 200K Long context, instruction accuracy
Google Gemini 1.5 Pro/Flash 1M Largest context window
Mistral Mistral Large, Mistral 7B 32K Self-hosted option

For a typical website chatbot (support, FAQ, consultant), GPT-4o-mini or Claude 3.5 Haiku offer sufficient quality at a significantly lower cost than flagship models.

Why You Need a Server-Side Proxy

API keys should never be exposed in the browser. A server-side endpoint is necessary for:

  • Authorization (only logged-in users)
  • Rate limiting (no more than X messages per day)
  • Conversation logging
  • Adding system prompts (hidden from the user)
  • Cost control
// api/chat.js (Next.js Route Handler)
import OpenAI from 'openai';

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const SYSTEM_PROMPT = `You are the assistant of the online store "Tech Pro".
Answer only questions about products, shipping, and returns.
If a question is off-topic, politely redirect to an operator.
Respond in the same language as the user.`;

export async function POST(request) {
  const session = await getSession(request);
  if (!session) return Response.json({ error: 'Unauthorized' }, { status: 401 });

  const { messages } = await request.json();

  // Rate limiting
  const count = await redis.incr(`chat:${session.userId}:${today()}`);
  if (count > 50) return Response.json({ error: 'Limit reached' }, { status: 429 });

  // Limit history to last 10 messages
  const recentMessages = messages.slice(-10);

  const stream = await openai.chat.completions.create({
    model: 'gpt-4o-mini',
    stream: true,
    messages: [
      { role: 'system', content: SYSTEM_PROMPT },
      ...recentMessages,
    ],
    max_tokens: 500,
    temperature: 0.3,
  });

  return new Response(stream.toReadableStream());
}

What's Included in the Work

We provide the full development cycle:

  • Architecture design (stack selection, database schema)
  • Server-side proxy implementation with authorization and logging
  • Integration with your chosen AI provider (OpenAI, Anthropic)
  • System prompt and context window configuration
  • Client widget development with streaming support
  • Function calling setup for integration with your systems
  • API documentation and operator instructions
  • Employee training on chatbot operation and handoff functions
  • 30-day warranty support after launch

How Long Does Integration Take?

Stage Timeline
Basic chatbot with system prompt and streaming 2–3 days
With function calling (orders, search, booking) +2–3 days
Widget with dialog history, lead capture, handoff to operator 5–7 days
Multilingual bot with intent routing +2–3 days

Pricing is calculated individually based on complexity and scope of work. We provide a transparent estimate before development starts.

Streaming Responses: Step-by-Step Implementation

Streaming is critical for UX: users see the response as it's generated, without waiting 3–5 seconds. Implementation requires careful handling of ReadableStream.

  1. Send a request to the server endpoint.
  2. Receive the response.body stream.
  3. Create a decoder and read chunks.
  4. Parse the Server-Sent Events format.
  5. Update the UI as data arrives.
async function sendMessage(userMessage) {
  setMessages(prev => [...prev, { role: 'user', content: userMessage }]);
  setIsStreaming(true);

  const response = await fetch('/api/chat', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ messages: [...messages, { role: 'user', content: userMessage }] }),
  });

  const reader = response.body.getReader();
  const decoder = new TextDecoder();
  let assistantMessage = '';

  // Add empty assistant message
  setMessages(prev => [...prev, { role: 'assistant', content: '' }]);

  while (true) {
    const { value, done } = await reader.read();
    if (done) break;

    const chunk = decoder.decode(value);
    // OpenAI streaming format: data: {"choices":[{"delta":{"content":"..."}}]}
    const lines = chunk.split('\n').filter(l => l.startsWith('data: '));

    for (const line of lines) {
      if (line === 'data: [DONE]') break;
      const json = JSON.parse(line.slice(6));
      const delta = json.choices[0]?.delta?.content || '';
      assistantMessage += delta;

      // Update last message
      setMessages(prev => [
        ...prev.slice(0, -1),
        { role: 'assistant', content: assistantMessage },
      ]);
    }
  }

  setIsStreaming(false);
}

How to Avoid Losing Conversation Context

Models have a context window. For long dialogues, you need a strategy:

Sliding window — just the last N messages:

const contextMessages = messages.slice(-10);

Summarization — compress the older part of the dialog:

async function compressHistory(messages) {
  if (messages.length <= 10) return messages;

  const toCompress = messages.slice(0, -6);
  const recent = messages.slice(-6);

  const summary = await openai.chat.completions.create({
    model: 'gpt-4o-mini',
    messages: [
      {
        role: 'user',
        content: `Summarize this conversation briefly:\n${toCompress.map(m => `${m.role}: ${m.content}`).join('\n')}`,
      },
    ],
    max_tokens: 200,
  });

  return [
    { role: 'system', content: `Previous conversation summary: ${summary.choices[0].message.content}` },
    ...recent,
  ];
}

Functions and Tools (Function Calling)

The chatbot can call functions — check order status, search products, schedule consultations. This turns it from a chatter into a full-fledged service.

const tools = [
  {
    type: 'function',
    function: {
      name: 'get_order_status',
      description: 'Get order status by order number',
      parameters: {
        type: 'object',
        properties: {
          order_number: { type: 'string', description: 'Order number' },
        },
        required: ['order_number'],
      },
    },
  },
  {
    type: 'function',
    function: {
      name: 'search_products',
      description: 'Search products by query',
      parameters: {
        type: 'object',
        properties: {
          query: { type: 'string' },
          max_price: { type: 'number' },
        },
        required: ['query'],
      },
    },
  },
];

// Handle function call
const response = await openai.chat.completions.create({
  model: 'gpt-4o',
  messages,
  tools,
  tool_choice: 'auto',
});

const message = response.choices[0].message;
if (message.tool_calls) {
  const toolResults = await Promise.all(
    message.tool_calls.map(async (call) => {
      const result = await executeFunction(call.function.name, JSON.parse(call.function.arguments));
      return {
        role: 'tool',
        tool_call_id: call.id,
        content: JSON.stringify(result),
      };
    })
  );

  // Send results back for final response
  const finalResponse = await openai.chat.completions.create({
    model: 'gpt-4o',
    messages: [...messages, message, ...toolResults],
  });
}
Solution Architecture

Client widget → Server-side proxy (authorization, rate limiting, logging) → AI API (OpenAI/Anthropic) + Database (PostgreSQL for history, Redis for cache).

Guarantees and Support

Our team has 7 years of experience in web development and certifications for working with OpenAI and Anthropic. We've completed over 120 AI integration projects with an average uptime of 99.9%. We provide an SLA with guaranteed response time and financial commitments.

According to Gartner, companies using AI chatbots reduce support costs by 40% and boost customer satisfaction by 30%.

Order Integration Now

Get a consultation from an engineer. We'll analyze your business, select the optimal solution, and provide a detailed estimate. Contact us to discuss your project.

AI Integration: Chatbots, RAG, Semantic Search, Recommendations

In 8 out of 10 projects, an "AI chatbot" turns out to be an expensive wrapper over GPT-4o with a system prompt. Without access to real company data. The user asks "how much does the Premium plan cost?" — the bot hallucinates a price out of thin air. Asks "when will my order arrive?" — gets a polite "contact support." This is not integration — it's imitation. We have implemented RAG solutions in 30+ projects over 5 years: from e-commerce stores to medical portals. We guarantee: useful AI assistance begins where the model reads your documents, not generic answers.

How do we build RAG systems?

Retrieval-Augmented Generation — standard architecture: query → find relevant fragments in a vector DB → insert found context → model response. But the devil is in the implementation details. Let's break down key components that determine quality.

Chunking. Cutting a document into 500-token pieces without regard for structure is a guarantee of losing meaning. If the cut lands in the middle of a paragraph, context breaks. Solution — recursive RecursiveCharacterTextSplitter with 10–15% overlap for documentation. For contracts and instructions, we use a semantic splitter: extract headings, lists, code blocks — each section becomes an independent chunk. Difference in search quality: on a medical project, precision increased from 0.55 to 0.84 just by proper chunking.

Embedding model. For Russian-language texts, intfloat/multilingual-e5-large gives a noticeable accuracy boost over outdated text-embedding-ada-002. In our measurements, NDCG@10 on a test set of 10,000 query-document pairs is 12% higher. OpenAI text-embedding-3-large is good for English content, but for Russian we recommend BAAI/bge-m3 or the mentioned e5-large.

Vector DB. If you already have PostgreSQL — pgvector saves resources. Install extension CREATE EXTENSION vector, add column vector(1024), create HNSW index. On a project with 80,000 support articles, p95 search time was 12 ms. That's enough. For catalogs with millions of items — Qdrant or Weaviate: native hybrid search and sharding out of the box.

What does hybrid search give?

Vector-only search is blind to exact matches: SKUs like "ABC-123", proper names, abbreviations are lost. Full-text-only search doesn't catch synonyms and paraphrasing. Combining via RRF (Reciprocal Rank Fusion) gives the best of both worlds: BM25 + vector search, results merged. In practice, recall@20 increases from 0.65 to 0.92 — the difference is noticeable to the user.

Reranking — final filter: top-20 candidates from hybrid search are run through a cross-encoder cross-encoder/ms-marco-MiniLM-L-6-v2. It adds 50–100 ms to response time, but relevance improves by another 5–10%. Without reranking, the chatbot may show irrelevant documents.

How to implement semantic search on a site?

A search for "comfortable leather armchairs" should find products described as "soft chairs made of natural leather" — ordinary LIKE search cannot do this. Our architecture: when adding a product/post, automatically generate an embedding via multilingual-e5-large, store it in pgvector. On query, embed it with the same model, search nearest neighbors via cosine distance with HNSW index. For a catalog of 100,000 items, index builds in 3 minutes, memory ~400 MB (1536-dimensional vectors). Average search time: 20 ms.

What about recommendation systems?

Collaborative filtering ("users like you bought X") requires history — at least 2–3 months of data with 1000+ active users. For startups or small projects, we use content-based: embedding of current product → search nearest neighbors by cosine similarity. When enough statistics accumulate (usually 15–20 interactions per user), we switch to a hybrid LightFM model. It combines behavior and product features. In our e-commerce project with 50,000 SKUs, the hybrid model increased conversion in the recommendation block by 18% (A/B test lasted 2 weeks).

How does streaming work?

Users shouldn't wait for the entire text to be generated — it kills UX. Server-Sent Events (SSE) is the protocol for token streaming. OpenAI SDK supports stream: true, returning an AsyncIterator. On frontend — Vercel AI SDK (useChat) or custom EventSource. Typical mistake: using WebSocket for unidirectional streaming — SSE is simpler (less code, built-in reconnect). Stack: Node.js + SSE + React.

How to orchestrate agents?

A simple chatbot answers. An agent performs actions: creates a Jira ticket, checks order status in CRM, books a calendar slot. For orchestration, we use LangGraph: state graph where each node is a model or tool call. Vercel AI SDK useChat + tools for Next.js allows adding integration in 10 lines of code. Main challenge — reliability: the model sometimes calls the wrong tool or passes malformed parameters. Protection — Zod schemas for each tool and structured outputs to guarantee JSON.

What does the work include?

Stage Result Duration
Audit of data and business logic Source map, document format, quality assessment 1–2 days
Prototype of RAG or recommendation system Demo with metrics (recall, precision, latency) 1–2 weeks
Integration into existing web application API endpoints, chatbot/search interface 1–2 weeks
A/B testing and optimization Report on metrics (CTR, conversion, hallucination rate) 1 week
Documentation and team training Operations manual, code review 2–3 days

Additionally: we hand over vectorizer source code, monitoring dashboards (Langfuse), admin panel access for knowledge base updates. Post-production support — 1 month free.

What are the timelines?

Task Estimated Time
RAG chatbot based on existing knowledge base 3–6 weeks
Semantic catalog search 2–4 weeks
Recommendation system with A/B testing 6–10 weeks
Multi-agent system with integrations from 8 weeks

Pricing is calculated individually after project discovery. We'll evaluate your project in 1 day. Contact us — we'll show how to turn AI from a toy into a profit-driving tool.