title: Ð Ð°Ð·ÑÐ°Ð±Ð¾ÑÐºÐ° Ð¸Ð½ÑÐµÐ»Ð»ÐµÐºÑÑÐ°Ð»ÑÐ½Ð¾Ð¹ ÑÐ¸ÑÑÐµÐ¼Ñ Ð½Ð° Ð±Ð°Ð·Ðµ LLM c Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸ÐµÐ¼ Ð¼ÐµÑÐ¾Ð´Ð° RAG Ð´Ð»Ñ Ð¸Ð·Ð²Ð»ÐµÑÐµÐ½Ð¸Ñ ÐºÐ¾Ð½ÑÐµÐºÑÑÐ½Ð¾Ð¹ Ð¸Ð½ÑÐ¾ÑÐ¼Ð°ÑÐ¸Ð¸ Ð¸Ð· ÑÐµÐºÑÑÐ¾Ð²ÑÑ Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ¾Ð²
title: Ð²ÑÐ¿ÑÑÐºÐ½Ð°Ñ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð°Ñ ÑÐ°Ð±Ð¾ÑÐ° Ð±Ð°ÐºÐ°Ð»Ð°Ð²ÑÐ°
titleType: Subtitle
title: Development of an Intelligent System Based on LLM with RAG Method for Contextual Information Retrieval from Text Documents
Creators: name: Ð¡ÑÑÐ¾Ð², ÐÑÑÐµÐ¼
Publisher: name: Ð¡Ð°Ð½ÐºÑ-ÐÐµÑÐµÑÐ±ÑÑÐ³ÑÐºÐ¸Ð¹ Ð¿Ð¾Ð»Ð¸ÑÐµÑÐ½Ð¸ÑÐµÑÐºÐ¸Ð¹ ÑÐ½Ð¸Ð²ÐµÑÑÐ¸ÑÐµÑ ÐÐµÑÑÐ° ÐÐµÐ»Ð¸ÐºÐ¾Ð³Ð¾
Year: 2024
Subjects: Ð¸Ð½ÑÐµÐ»Ð»ÐµÐºÑÑÐ°Ð»ÑÐ½ÑÐµ ÑÐ¸ÑÑÐµÐ¼Ñ
Ð±Ð¾Ð»ÑÑÐ¸Ðµ ÑÐ·ÑÐºÐ¾Ð²ÑÐµ Ð¼Ð¾Ð´ÐµÐ»Ð¸
Ð´Ð¾Ð¿Ð¾Ð»Ð½ÐµÐ½Ð½Ð°Ñ Ð³ÐµÐ½ÐµÑÐ°ÑÐ¸Ñ
Ð¾Ð±ÑÐ°Ð±Ð¾ÑÐºÐ° ÐµÑÑÐµÑÑÐ²ÐµÐ½Ð½Ð¾Ð³Ð¾ ÑÐ·ÑÐºÐ°
Ð¼Ð°ÑÐ¸Ð½Ð½Ð¾Ðµ Ð¾Ð±ÑÑÐµÐ½Ð¸Ðµ
Ð³ÐµÐ½ÐµÑÐ°ÑÐ¸Ñ ÑÐµÐºÑÑÐ°
intelligent systems
large language models
retrieval-augmented generation
natural language processing
machine learning
text generation

description: Ð Ð´Ð°Ð½Ð½Ð¾Ð¹ ÑÐ°Ð±Ð¾ÑÐµ Ð¸Ð·Ð»Ð¾Ð¶ÐµÐ½Ð° ÑÑÑÐ½Ð¾ÑÑÑ Ð¿Ð¾Ð´ÑÐ¾Ð´Ð° Ðº ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ Ð¸ ÑÐºÑÐ¿ÐµÑÐ¸Ð¼ÐµÐ½ÑÐ°Ð»ÑÐ½Ð¾Ð¼Ñ Ð¸ÑÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ ÑÑÑÐµÐºÑÐ¸Ð²Ð½Ð¾ÑÑÐ¸ Ð¸Ð½ÑÐµÐ»Ð»ÐµÐºÑÑÐ°Ð»ÑÐ½Ð¾Ð¹ ÑÐ¸ÑÑÐµÐ¼Ñ Ð½Ð° Ð¾ÑÐ½Ð¾Ð²Ðµ Ð¼ÐµÑÐ¾Ð´Ð° Ð´Ð¾Ð¿Ð¾Ð»Ð½ÐµÐ½Ð½Ð¾Ð¹ Ð³ÐµÐ½ÐµÑÐ°ÑÐ¸Ð¸ (Retrieval-Augmented Generation, RAG) Ð´Ð»Ñ Ð¸Ð·Ð²Ð»ÐµÑÐµÐ½Ð¸Ñ ÐºÐ¾Ð½ÑÐµÐºÑÑÐ½Ð¾Ð¹ Ð¸Ð½ÑÐ¾ÑÐ¼Ð°ÑÐ¸Ð¸ Ð¸Ð· ÑÐµÐºÑÑÐ¾Ð²ÑÑ Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ¾Ð². Ð Ð°ÑÑÐ¼Ð¾ÑÑÐµÐ½Ñ Ð¾ÑÐ½Ð¾Ð²Ð½ÑÐµ Ð°ÑÐ¿ÐµÐºÑÑ Ð¾Ð±Ð»Ð°ÑÑÐ¸ Ð¾Ð±ÑÐ°Ð±Ð¾ÑÐºÐ¸ ÐµÑÑÐµÑÑÐ²ÐµÐ½Ð½Ð¾Ð³Ð¾ ÑÐ·ÑÐºÐ° (Natural Language Processing, NLP) Ð¸ Ð¾ÑÐ¾Ð±ÐµÐ½Ð½Ð¾ÑÑÐ¸ Ð±Ð¾Ð»ÑÑÐ¸Ñ ÑÐ·ÑÐºÐ¾Ð²ÑÑ Ð¼Ð¾Ð´ÐµÐ»ÐµÐ¹ (Large Language Models, LLM). ÐÑÑÐ²Ð»ÐµÐ½Ñ ÐºÐ°Ðº Ð´Ð¾ÑÑÐ¸Ð¶ÐµÐ½Ð¸Ñ, ÑÐ°Ðº Ð¸ Ð¾Ð³ÑÐ°Ð½Ð¸ÑÐµÐ½Ð¸Ñ ÑÐ¾Ð²ÑÐµÐ¼ÐµÐ½Ð½ÑÑ LLM, Ð²ÐºÐ»ÑÑÐ°Ñ Ð¸Ñ ÑÐºÐ»Ð¾Ð½Ð½Ð¾ÑÑÑ Ðº Ð³ÐµÐ½ÐµÑÐ°ÑÐ¸Ð¸ Ð½ÐµÐ´Ð¾ÑÑÐ¾Ð²ÐµÑÐ½Ð¾Ð¹ Ð¸Ð½ÑÐ¾ÑÐ¼Ð°ÑÐ¸Ð¸ Ð¸ ÑÑÑÐ´Ð½Ð¾ÑÑÐ¸ Ñ Ð¾Ð±ÑÐ°Ð±Ð¾ÑÐºÐ¾Ð¹ ÑÐ·ÐºÐ¾ÑÐ¿ÐµÑÐ¸Ð°Ð»Ð¸Ð·Ð¸ÑÐ¾Ð²Ð°Ð½Ð½ÑÑ Ð·Ð°Ð¿ÑÐ¾ÑÐ¾Ð². ÐÑÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð° Ð¸ ÑÐ¿ÑÐ¾ÐµÐºÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð° Ð°ÑÑÐ¸ÑÐµÐºÑÑÑÐ° Ð¸Ð½ÑÐµÐ»Ð»ÐµÐºÑÑÐ°Ð»ÑÐ½Ð¾Ð¹ ÑÐ¸ÑÑÐµÐ¼Ñ Ð½Ð° Ð¾ÑÐ½Ð¾Ð²Ðµ Ð¼ÐµÑÐ¾Ð´Ð° RAG. Ð Ð°Ð·ÑÐ°Ð±Ð¾ÑÐ°Ð½Ð° ÐºÐ¾Ð½ÐºÑÐµÑÐ½Ð°Ñ Ð¸Ð½ÑÐµÐ»Ð»ÐµÐºÑÑÐ°Ð»ÑÐ½Ð°Ñ ÑÐ¸ÑÑÐµÐ¼Ð° Ð½Ð° ÑÐ·ÑÐºÐµ Python Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸ÐµÐ¼ Ð¼Ð¾Ð´ÐµÐ»ÐµÐ¹ Gemini AI. ÐÐ¿ÑÐµÐ´ÐµÐ»ÐµÐ½Ñ Ð³Ð¸Ð¿ÐµÑÐ¿Ð°ÑÐ°Ð¼ÐµÑÑÑ, Ð¿Ð¾Ð·Ð²Ð¾Ð»ÑÑÑÐ¸Ðµ Ð°Ð´Ð°Ð¿ÑÐ¸ÑÐ¾Ð²Ð°ÑÑ ÑÐ¸ÑÑÐµÐ¼Ñ Ð¿Ð¾Ð´ ÑÐ°Ð·Ð»Ð¸ÑÐ½ÑÐµ ÑÑÐµÐ½Ð°ÑÐ¸Ð¸ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ. ÐÑÐ¾ÑÐµÑÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¾ Ð¾Ð±ÑÐµÐµ Ð±ÑÑÑÑÐ¾Ð´ÐµÐ¹ÑÑÐ²Ð¸Ðµ ÑÐ¸ÑÑÐµÐ¼Ñ. ÐÑÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð° ÑÐºÐ¾ÑÐ¾ÑÑÑ ÑÐ°Ð±Ð¾ÑÑ API Ð¼Ð¾Ð´ÐµÐ»ÐµÐ¹ Ð¿ÑÐ¸ Ð²Ð°ÑÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ð¸ ÑÐ°Ð·Ð¼ÐµÑÐ° Ð²ÑÐ¾Ð´Ð½ÑÑ Ð´Ð°Ð½Ð½ÑÑ. ÐÑÐ¾Ð²ÐµÐ´ÐµÐ½Ð¾ Ð°Ð²ÑÐ¾Ð¼Ð°ÑÐ¸ÑÐµÑÐºÐ¾Ðµ ÑÐµÑÑÐ¸ÑÐ¾Ð²Ð°Ð½Ð¸Ðµ ÑÐ¸ÑÑÐµÐ¼Ñ Ð½Ð° ÑÐ¸Ð½ÑÐµÑÐ¸ÑÐµÑÐºÐ¸Ñ Ð¸ ÑÐ·ÐºÐ¾ÑÐ¿ÐµÑÐ¸Ð°Ð»Ð¸Ð·Ð¸ÑÐ¾Ð²Ð°Ð½Ð½ÑÑ Ð´Ð°Ð½Ð½ÑÑ. ÐÑÐ¿Ð¾Ð»Ð½ÐµÐ½Ð° ÑÑÐ°ÑÐ¸ÑÑÐ¸ÑÐµÑÐºÐ°Ñ Ð¾Ð±ÑÐ°Ð±Ð¾ÑÐºÐ° Ð¿Ð¾Ð»ÑÑÐµÐ½Ð½ÑÑ ÑÐµÐ·ÑÐ»ÑÑÐ°ÑÐ¾Ð² Ð¸ Ð¸Ð·Ð»Ð¾Ð¶ÐµÐ½Ñ Ð²ÑÐ²Ð¾Ð´Ñ Ð¿ÑÐ¸Ð¼ÐµÐ½Ð¸Ð¼Ð¾ÑÑÐ¸ Ð¼ÐµÑÐ¾Ð´Ð° RAG Ð´Ð»Ñ Ð¿Ð¾Ð²ÑÑÐµÐ½Ð¸Ñ ÐºÐ°ÑÐµÑÑÐ²Ð° Ð¸ ÑÐµÐ»ÐµÐ²Ð°Ð½ÑÐ½Ð¾ÑÑÐ¸ Ð¾ÑÐ²ÐµÑÐ¾Ð² LLM Ð¿ÑÐ¸ ÑÐµÑÐµÐ½Ð¸Ð¸ Ð·Ð°Ð´Ð°Ñ Ð¸Ð·Ð²Ð»ÐµÑÐµÐ½Ð¸Ñ Ð¸Ð½ÑÐ¾ÑÐ¼Ð°ÑÐ¸Ð¸ Ð¸Ð· ÑÐµÐºÑÑÐ¾Ð²ÑÑ Ð´Ð¾ÐºÑÐ¼ÐµÐ½ÑÐ¾Ð².
description: This work presents the essence of the approach to creating and experimentally studying the effectiveness of an intelligent system based on the Retrieval-Augmented Generation (RAG) method for extracting contextual information from text documents. The main aspects of Natural Language Processing (NLP) and the features of Large Language Models (LLM) are examined. Both the achievements and limitations of modern LLMs are identified, including their tendency to generate inaccurate information and difficulties in handling specialized queries. The architecture of an intelligent system based on the RAG method is proposed and designed. A specific intelligent system is developed in Python using Gemini AI models. Hyperparameters are defined to adapt the system for various usage scenarios. The overall performance of the system is tested, and the speed of the models API operation is studied with varying input data sizes. Automated testing of the system on synthetic and specialized data is conducted. Statistical processing of the obtained results is performed, and conclusions are drawn regarding the applicability of the RAG method to improve the quality and relevance of LLM responses in tasks of extracting information from text documents.