/GenerativeBackend

Generative Backend. Part of the contact center automation service.

Primary LanguagePythonOtherNOASSERTION

Contributors Forks Stargazers Issues MIT License


Logo

Generative Backend

(Part of the contact center automation service)



Report Bug · Request Feature

Table of Contents / Содержание
  1. About The Project / О проекте
  2. Getting Started / Начало
  3. License
  4. Contact / Контакты

About The Project / О проекте

Link to project in GitHub: https://github.com/RomiconEZ/GenerativeBackend

= ENG =

This Backend service is part of the contact center automation system for the tour business.

He is the link between chatbots for clients and for agents.

The main purpose of the Backend is to generate text and audio answers to user questions, as well as redirect users to agents.

To respond to user requests, a locally deployed LLM is used: IlyaGusev/saiga_mistral_7b_gguf using LM studio and RAG.

RAG: "intfloat/multilingual-e5-large-instruct" is used as the embedding model. Chroma is used to create and use a vector representation of text data. LangChain is used for processing and managing text data. The knowledge base contains a file with information about the tour operator (all matches are random).

To provide asynchronous processing of heavy tasks (LLM request, sound generation) , the ARQ library (Asynchronous Redis Queue) is used, which uses Redis as a message broker to manage task queues.

Solving problems using the service takes place in 2 stages:

  1. Request to queue a task and get its id
  2. Requests for the status of the task with its id

= RU =

Данный Backend сервис является частью системы автоматизации контакт-центра для тур-бизнеса.

Он является связующим звеном между чат-ботами для клиентов и для агентов.

Основная цель Backend-а - генерация текстовых и звуковых ответов на вопросы пользователя, а также перенаправление пользователей к агентам.

Для ответов на запросы пользователя используется локально развернутая LLM: IlyaGusev/saiga_mistral_7b_gguf с помощью LM studio и RAG.

RAG: В качестве модели для эмбеддингов используется "intfloat/multilingual-e5-large-instruct". Chroma используется для создания и использования векторного представления текстовых данных. LangChain используется для обработки и управления текстовыми данными. База знаний содержит файл с информацией о туроператоре (все совпадения случайны).

Для обеспечения асинхронной обработки тяжелых задач (запрос LLM, генерация звука) используется библиотека ARQ (Asynchronous Redis Queue), которая использует Redis в качестве брокера сообщений для управления очередями задач.

Решение задач с помощью сервиса происходит в 2 этапа:

  1. Запрос на постановку задачи в очередь и получение ее id
  2. Запросы о статусе выполнения задачи с указанием ее id

(back to top)

Built With / Технологический стек

  • Python
  • Fastapi
  • Docker
  • lc_ch

(back to top)

Getting Started / Начало

Prerequisites

Installation / Установка

  1. Clone the repository.

  2. Copy the .env.example file in the directory and change the name to .env. Customize the env file for your project.

  3. Launch the server in LM studio

LMstudio

  1. In the terminal, navigate to the root directory of the cloned repository. Build the Docker containers with the following command:
    docker compose up
    If an error occurred when starting the containers when creating databases, run the command again:
    docker compose up

Additionally

License

This project is licensed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license. See the LICENSE file for details.

Creative Commons License

Contact / Контакты

Roman Neronov:

(back to top)