Case Study

How I Developed an AI Chatbot

Vincent Kilchherr October 20, 2025 Updated: November 16, 2025 6 min read

Technical deep dive: From requirements analysis to launch. All learnings and technical decisions at a glance.

Introduction

With the rapid advancement of artificial intelligence (AI), companies face new opportunities to optimise their customer communication. A promising approach is the implementation of AI chatbots that can support visitors in real time. This technology enables companies to work more efficiently and improve their customer relationships. In this case study, I show how I developed an intelligent FAQ assistant for WebAufbau.ch to improve the user experience whilst simultaneously reducing operating costs. The focus is on utilising cutting-edge technologies and adapting them to the Swiss market.

Problem

The development of an AI chatbot for WebAufbau.ch involved several challenges that we need to examine in detail. The complexity of this task arises from several key areas that had to be carefully addressed:

Context Management

  • The AI needs sufficient context to generate meaningful responses without overloading the prompt. A balance between the amount of information and processing power is crucial. The integration of multilingual content for Swiss customers posed an additional challenge.
  • Considering Swiss multilingualism, particularly German, French and Italian, is crucial for the acceptance of the chatbot.

Response Quality

  • The relevance and accuracy of responses is essential to provide value to users and build trust in the chatbot. Responses must be precise and linguistically appealing to meet user expectations.
  • It is important to avoid incorrect or incomplete information to not jeopardise user trust.

Performance

  • Minimising latency through optimised API calls is necessary to ensure a smooth user experience. The selection of the right server locations is particularly important to meet the requirements of the Swiss market.
  • Fast response times are crucial for maintaining customer satisfaction and making the service seamless.

Costs

  • The use of the OpenAI API must be designed cost-effectively to stay within the financial framework, particularly regarding CHF costs. This requires a precise analysis of API usage and the implementation of cost control mechanisms.
  • Considering the specific cost structure in Switzerland is essential to stay within budget.

Solution

To overcome these challenges, I implemented a RAG approach (Retrieval Augmented Generation), which is explained in various aspects. This approach makes it possible to efficiently use existing data and meaningfully integrate AI technology.

1. Contextual Information Processing

  • First, relevant information is extracted from existing FAQ articles. This is done through a database query on MySQL/MariaDB, which identifies the most relevant articles. These articles serve as the basis for contextualising user queries.
  • The database structure was optimised to quickly and efficiently access frequently asked questions. This is particularly important for minimising response times and reducing server load.
  • The implementation of a multilingual database structure enables efficient processing of queries in the various national languages of Switzerland.

2. Integration of AI Technology

  • The extracted information is sent as context to the OpenAI GPT-4 API to generate precise responses. This integration requires careful configuration of API parameters to achieve the best possible response quality.
  • Special attention was paid to handling multilingual queries to meet the different language needs of Swiss customers.
  • The API configuration was adapted to consider specific cultural and linguistic characteristics of the Swiss market.

3. Performance Optimisation

  • By caching frequently asked questions and their answers, API calls can be reduced, which decreases latency and lowers costs. This was achieved through the implementation of a Redis cache, which significantly improved response times.
  • Additionally, a load balancer was deployed to distribute requests evenly across multiple servers, increasing reliability.
  • Using local servers, e.g. from providers like Cyon or Hostpoint, contributes to minimising latency.

4. Cost Management

  • Intelligent use of the API, based on the RAG approach, helps control costs. This is supported by careful analysis of necessary API calls. Dynamic scaling of API resources ensures that costs only accrue when requests are actually being processed.
  • Regular reviews and adjustments of the API strategy help maximise efficiency and minimise expenditure.
  • Additionally, specific optimisation strategies are implemented to monitor and optimise costs in CHF.

Implementation Details

A concrete code example shows how response generation works. The implementation follows best practices in software development to ensure maintainability and extensibility:

public function askQuestion(string $question): array
{
    // 1. Search relevant FAQs
    $relevantFaqs = $this->searchFaqs($question);

    // 2. Build context
    $context = $this->buildContext($relevantFaqs);

    // 3. OpenAI API Call
    $response = $this->callOpenAI($question, $context);

    return [
        'answer' => $response,
        'sources' => $relevantFaqs
    ];
}

This code snippet shows the essential steps of context processing and API interaction required for providing precise responses.

Benefits

The developed AI chatbot offers numerous advantages for WebAufbau.ch that contribute significantly to optimising business processes:

  • Improved user experience through instant responses to frequently asked questions. This reduces waiting times and increases user satisfaction.
  • Cost savings through reduced support enquiries and efficient API usage. This enables the company to allocate resources elsewhere.
  • Scalability that makes it possible to expand the chatbot for additional topic areas. This is particularly important for companies that are growing and expanding their services.
  • Increased customer satisfaction through fast and precise information. This strengthens customer loyalty and promotes trust in the brand.
  • Compliance with Swiss data protection regulations, which is essential for the legally compliant processing of customer data.
  • The ability to seamlessly integrate the chatbot into existing systems without requiring extensive modifications.

Practical Example

A practical example of using the AI chatbot could be a Swiss e-commerce company that wants to handle its customer enquiries more efficiently. Suppose a customer asks about the payment options the company offers. The AI chatbot can immediately respond and indicate that both Twint and PostFinance are available as payment methods. This saves the customer time and the company resources. Additionally, the chatbot could specifically highlight the advantages of Twint for mobile payments, thereby promoting the use of this payment method.

Another example could be a telecommunications company like Swisscom that uses the chatbot to answer frequently asked questions about tariffs and services. The chatbot could efficiently handle customer enquiries about new mobile phone offers or internet services and provide relevant information.

Conclusion

Developing an AI chatbot is a complex but worthwhile task that brings significant advantages for businesses. The combination of cutting-edge AI technology and a well-thought-out implementation strategy makes it possible to elevate customer communication to a new level. With the right planning and execution, it is possible to successfully integrate such a chatbot into production and revolutionise customer service. The focus on the Swiss market ensures that all legal and cultural requirements are met.

Interested in your own AI chatbot?More information here

In this technical deep dive, I would like to explain in more detail how I developed the AI chatbot to optimally adapt it to the needs of my clients. Developing such a tool requires not only technical know-how but also a deep understanding of human-machine interaction. Through the implementation of intelligent algorithms, I was able to ensure that the chatbot not only responds precisely to common questions but also continuously learns and improves to provide users with an optimal experience.

To develop an effective AI chatbot, I analysed various technologies and frameworks to find the best solution for the specific requirements of WebAufbau.ch. User-friendliness played a decisive role in ensuring that the chatbot is intuitive and helpful. Through the integration of machine learning, I was able to give the chatbot the ability to learn from interactions and continuously improve its responses, thereby increasing customer satisfaction.

Was this article helpful?

Vincent Kilchherr
Vincent Kilchherr

Fullstack & AI Entwickler

Informatiker EFZ Applikationsentwicklung mit Berufsmaturität - Informatikmittelschule Basel (IMS)

Get in touch

Related Articles

Case Study
10 Years of WebAufbau: A Look Back at a Decade of Web Development

On 16 January 2026, WebAufbau celebrates its 10th anniversary. A personal look back at a decade o...

Jan 16, 2026
Case Study
How I Built the AI Integration Landing Page - A Technical Deep Dive

From the first idea to launch: How I built the AI integration landing page for WebAufbau with mod...

Nov 7, 2025