October 26, 2026
Automated Generation of Knowledge Base in Help Desk using RAG-Based AI
Marcelo Daudt; Daniele Aparecida Cicillini Pimenta
DOI: 10.22167/2675-6528-202601164
Article prepared by the ResumeAI tool, an artificial intelligence solution developed by the Pecege Institute focused on synthesis and writing.
Summary
An Artificial Intelligence model based on the Retrieval-Augmented Generation (RAG) technique was developed to automate the creation and maintenance of a Knowledge Base in Help Desk systems. The objective was to transform historical technical support ticket records into structured knowledge, aiming to increase the efficiency of support services. The adopted methodology was based on the CRISP-DM framework and applied ETL pipelines, embedding generation, the use of large language models (LLMs), and storage in a vector database. Five experiments with different configurations were conducted and evaluated by the RAGAS framework. Initial results indicated that, despite the good capacity for retrieving relevant contexts, the relevance of the generated answers was unsatisfactory. Based on this analysis, improvements were implemented in the pipeline, including filters by similarity score, reduction in the number of retrieved contexts, and refinement of the prompt sent to the LLM. These modifications resulted in a new configuration with superior performance, showing significant gains in the relevance and fidelity metrics of the answers. It was concluded that the proposed RAG model adds strategic value to Help Desk systems, speeding up technical diagnosis and contributing to the continuous improvement of services by converting historical records into knowledge assets.
Keywords: Vector Databases; CRISP-DM; Embeddings; Prompt Engineering; Language Models.
1. Introduction
The contemporary business scenario is profoundly shaped by the rapid and continuous advancement of Information and Communication Technologies (ICTs). Currently, it is rare to find ventures that do not depend on information technology and computing in an almost vital way for their daily operations. This growing dependence, in turn, generates an equally growing demand for specialized technical support in the use of these technologies.
In this context, the “Help Desk” department assumes a strategic role. As observed by Cohen (2008), when an employee from any sector of an organization becomes inoperative due to technological doubts or problems, the technical support provided by the Help Desk becomes crucial. Its function is to mitigate the impact of unproductivity, ensuring that employees remain productive and satisfied. Historically, the concept of Help Desk has evolved since the “mainframe” era, expanding its responsibilities from a simple “help” to a comprehensive “service”, which often involves software and hardware support, in addition to functions such as quality assurance and asset management (Cohen, 2008).
To optimize the management and effectiveness of a Help Desk, the implementation of information systems is fundamental. Laudon and Laudon (2004) highlight that an information system aims to collect, store, and disseminate data about an organization’s internal and external environment, supporting operational functions, decision-making, communication, coordination, control, analysis, and information visualization. Pressman (2011) complements that software, or an information system, transcends the mere condition of code, positioning itself as a strategic tool to support business operations. Among the essential resources that an information system can offer is the Knowledge Base, which functions as a library of formalized, recorded, and stored information, allowing the Help Desk team to quickly access the necessary solutions for the demands presented, increasing the quality and efficiency of support (Cohen, 2008). However, the central problem that permeates this context lies in the difficulty of creating and maintaining an updated and structured Knowledge Base in Help Desk environments.
Data Science (DS) emerges as a promising area to assist in the task of automatic creation and maintenance of Knowledge Bases. According to Carvalho, Menenzes, and Bonidia (2024), DS is a multidisciplinary field dedicated to the application of principles and techniques, implemented by algorithms, with the objective of extracting relevant and useful information from large volumes of raw data. By integrating DS, it is possible to transform a Help Desk system into an intelligent system, capable of processing and using information more autonomously and effectively.
In this sense, Artificial Intelligence (AI), a subfield of Data Science, plays a crucial role. Gabriel Filho (2023) explains that AI seeks to endow machines with the capacity for intelligence inherent in humans, allowing information systems to answer specific questions for which they were not directly programmed. Through subfields such as Machine Learning (ML) and Deep Learning (DL), systems become capable of generating answers (Valiant, 2000). In recent years, Large Language Models (LLMs) have been widely adopted, but they face limitations regarding the breadth of human knowledge, especially in specific domains and information that is not continuously updated. To overcome these limitations, the Retrieval-Augmented Generation (RAG) model emerges. This approach allows LLMs to use proprietary and contextually relevant information, retrieved from an institutional knowledge base, to enrich the generated responses. Thus, RAG contributes significantly to reducing “hallucinations” and increasing the accuracy and reliability of responses.
The relevance of this study is highlighted by the need to optimize technical support in Help Desk environments. By converting the vast volume of historical ticket records into structured knowledge assets, it is possible to expedite technical diagnosis and promote continuous improvement of services. Thus, the present research is justified by the search for innovative solutions that enhance Knowledge Management in Help Desk. The objective of this work is to develop an Artificial Intelligence model based on the Retrieval-Augmented Generation (RAG) technique to automate the creation and maintenance of a Knowledge Base in Help Desk systems, transforming historical technical ticket records into structured knowledge and, consequently, increasing the efficiency of support services.
2. Material and Methods
This work consisted of a case study, with an integrated methodological approach between Software Engineering (SE) and Data Science (DS). The research followed the CRISP-DM (Cross Industry Standard Process for Data Mining) framework, which guided the development of an Artificial Intelligence (AI) model based on the Retrieval Augmented Generation (RAG) technique. The objective was to automate the creation and maintenance of a Knowledge Base in Help Desk systems, transforming historical technical support tickets into structured knowledge.
The CRISP-DM methodology was applied in its six stages: Business Understanding, Data Understanding, Data Preparation, Training (Modeling), Evaluation, and Deployment. This process facilitated the transformation of raw data into useful knowledge, focusing on agile project management. The source of the data for model development was a production relational database of an existing Ticketing System, built with the Laravel framework, with extraction performed on November 18, 2025.
For the extraction, three tables were identified in the Ticket System database: “queues”, “tickets”, and “comments”, with their respective attributes and number of records. The data processing followed the ETL (Extract, Transform, Load) approach. In the transformation phase, the data were analyzed, processed, and selected, focusing on four key attributes from the “tickets” and “comments” tables: “subject”, “description”, “notes”, and “comment”.
Plain text (TXT) documents generated from the processed data were separated by service queues and fragmented into “chunks” (smaller pieces). These “chunks” were then converted into numerical vectors, called “embeddings”, using an embedding model. Subsequently, these vectors were stored in a cloud-based Vector Database (VDB), Pinecone, where each vector was associated with a unique identifier and metadata for traceability and organization.
The implemented RAG pipeline began with the formulation of a natural language query, which was converted into a representative vector by an embedding model. This vector was used to search for semantically similar vectors in the BDV, employing the Cosine similarity metric. The `k` most similar records, or “retrieved contexts”, were then concatenated with the original “query” and a structured “prompt”, and sent to a Large Language Model (LLM) to generate the final answer.
For the development of the AI model application, the Python language was used with the FastAPI framework for the “backend” services. The environment was packaged with Docker to ensure portability and consistency. The main Ticketing System was developed in Laravel. OpenAI APIs were employed for the embedding and LLM models, and Pinecone as the Vector Database.
Systematic experiments were conducted to optimize the model, varying “chunking” strategies (“sliding window” and “document aware”), “chunk” size, “overlap”, and the number of retrieved contexts (`k`, with values of 3, 5, and 10). These variations resulted in 20 distinct configurations, with five indexes created in BDV Pinecone. The evaluation was performed with the RAGAS (Retrieval-Augmented Generation Assessment) framework, using a set of five questions representative of the institutional domain and metrics such as Context Precision, Context Recall, Faithfulness, and Answer Relevance.
After analyzing the initial results, improvements were implemented in the RAG model pipeline. The modifications included applying filters by similarity “score” and “re-ranking” to select contexts with a score equal to or greater than 0.60, reducing the number of contexts (k=3) sent to the LLM, and refining the LLM “prompt”. These changes aimed to optimize the relevance and fidelity of the model’s generated responses.
3. Results and Discussion
The evaluation of the proposed Retrieval-Augmented Generation (RAG) model, developed to automate the creation and maintenance of a Knowledge Base in Help Desk systems, revealed important insights into the performance and challenges inherent in integrating Large Language Models (LLMs) with institutional databases. Initial results, obtained from twenty distinct experimental configurations, indicated a clear behavior regarding the variation of the `k` parameter, which represents the quantity of retrieved contexts. It was observed that increasing this value directly impacted the relevance of the retrieved context, but paradoxically, compromised the quality of the responses generated by the LLM, while fidelity fluctuated.
In the initial experiments, the analysis of the RAGAS framework evaluation metrics showed that, when configuring the parameter `k` to three retrieved contexts, the response fidelity was 0.6425 and the response relevance reached 0.9604, with a context precision of 1.0000 and a context recall of 0.3800. However, when the value of `k` was increased to five, fidelity rose to 1.0000, but response relevance dropped drastically to 0.3679, and context recall decreased to 0.1200. With `k` equal to ten, fidelity was 0.8762, response relevance was 0.1898, context precision remained at 1.0000, and context recall increased to 0.6200. These data highlighted a “trade-off” between the amount of retrieved information and the quality of the final response, a crucial finding for model refinement.
The detailed analysis of the experiments revealed that the main problem did not lie in the ability to retrieve relevant contexts, but rather in the way the LLM processed and utilized these contexts. An information overload was identified, where the inclusion of an excessive number of contexts, many of them containing noise or tangential information, led the LLM to mix the data and, consequently, to generate low-quality responses. This finding was fundamental to directing subsequent improvements in the RAG pipeline, seeking to optimize the selection and presentation of contexts to the language model.
Among the twenty configurations tested in the first five experiments, the one that presented the best overall balance was that of experiment four with the value of `k` equal to three. This configuration demonstrated robust performance, avoiding LLM collapse and providing a solid foundation for future optimizations. The “sliding window chunking” strategy, used in the first four experiments, focused on the continuity of thoughts, with “chunk” sizes varying between 500 and 2000 “tokens” and an “overlap” of 20%, which allowed exploring different context granularities.
In contrast, the fifth experiment adopted the strategy of “document aware chunking”, where each technical call generated a single “chunk”, without overlap. This approach aimed to verify the impact of call integrity on context retrieval and response generation. Although this strategy resulted in high “context recall” values, indicating a good ability to retrieve relevant information, there was no corresponding improvement in the “answer relevancy” metric. This suggested that, even with more potentially useful content, the volume and granularity of the data made it difficult for the model to identify the most pertinent snippets, reinforcing the need for quality control mechanisms over the retrieved contexts.
Given the limitations observed in the initial experiments, significant structural improvements were implemented in the RAG model pipeline. The main changes included the implementation of filters by similarity “score”, which now retrieves a fixed set of ten contexts, ordered by their respective “scores”. Subsequently, a “re-ranking” step was applied, selecting only contexts with a “score” greater than or equal to 0.60. Additionally, the number of contexts sent to the LLM was reduced to the three most relevant (k=3), aiming to avoid information overload. Finally, the “prompt” sent to the LLM was refined, with the cleaning of contextual texts and the improvement of instructions, according to the literature on structured prompt engineering (Gabriel Filho, 2023).
With the application of these improvements, a second experimental stage was conducted, comprising experiments six to ten. The results obtained in these new configurations demonstrated significant gains in the evaluation metrics. Experiment six, in particular, stood out as the best overall configuration, presenting an “answer relevancy” of 0.9477, a “faithfulness” of 0.7950, a “context precision” of 1.0000, and a “context recall” of 0.6200. These values indicated that the generated answers were highly aligned with the questions, with little to no hallucination and a useful and relevant context.
Results
The results obtained from the RAGAS evaluation, which analyzed twenty experimental configurations, showed a clear pattern: increasing the value of `k`, which represents the quantity of retrieved contexts, improved context recall, but, conversely, answer relevancy worsened. The faithfulness metric showed oscillations, indicating that the coherence of the answer with the retrieved context was not linearly affected by the amount of information provided. This initial observation was crucial for understanding the model’s behavior and guiding the optimization steps.
The detailed analysis of experiments one to five, according to the recorded data, revealed that for experiment one, with `k=3`, the fidelity was 0.6425 and the response relevance was 0.9604, while the context recall was 0.3800. Increasing `k` to five, fidelity reached 1.0000, but response relevance dropped to 0.3679, and context recall to 0.1200. With `k=10`, fidelity was 0.8762, response relevance 0.1898, and context recall 0.6200. In all these scenarios, context precision remained at 1.0000, indicating that the retrieval system captured relevant contexts, but the LLM had difficulty utilizing them effectively.
This dynamic suggested that the problem did not lie in the ability to retrieve contexts, but rather in how the LLM processed them. Information overload, with the inclusion of noise and less relevant contexts, led the model to get lost in prioritization, resulting in low-quality responses. This interpretation was corroborated by diagnostic analysis, which pointed to an “LLM collapse” in configurations with higher `k`, where the model could no longer discern the priority information to generate a coherent and useful response.
The best overall configuration identified among the initial experiments was that of experiment four with `k` equal to three. This combination of parameters provided a satisfactory balance, avoiding LLM collapse and establishing a promising foundation for optimizations. The “document aware chunking” strategy, employed in experiment five, although it demonstrated excellent “context recall”, did not translate into improvements in “answer relevancy”, reinforcing the hypothesis that the amount of context did not, by itself, guarantee response quality.
Based on these observations, improvements were made to the RAG pipeline. The main changes included applying similarity “score” filters to order and select the most relevant contexts, a “re-ranking” process to further refine this selection, reducing the number of contexts sent to the LLM to only three, and refining the “prompt” to guide the language model more effectively. These modifications aimed to mitigate information overload and noise, factors that compromised the relevance and fidelity of the responses.
The results of the new experiments, from six to ten, after the implementation of the improvements, demonstrated a positive evolution. Experiment six, for example, achieved an “answer relevancy” of 0.9477, a “faithfulness” of 0.7950, a “context precision” of 1.0000, and a “context recall” of 0.6200, being classified as the “best overall”. In contrast, experiments such as eight and nine presented “total failure” in all metrics, indicating that, even with the improvements, some configurations were still not effective. However, the comparison with previous experiments revealed that, with filtered contexts and the refined prompt, the RAG model started to generate higher quality answers.
Discussion
The conduction of the first five experiments revealed an inherent “trade-off” behavior in the RAG model, where increasing the parameter `k`, which defines the quantity of retrieved documents, directly impacted the evaluation metrics. It was observed that, although raising `k` tended to increase the coverage of relevant information, reflected in the “context recall” metric, this expansion was accompanied by a decrease in response quality, measured by “answer relevancy”. This phenomenon suggests that the LLM, upon receiving a larger volume of contexts, faced difficulties in discerning the most pertinent information, introducing noise and compromising precision.
In scenarios where `k` was set to three, the model demonstrated good answer relevancy and acceptable levels of faithfulness. This indicates that a smaller, more focused set of contexts favored the generation of more precise answers aligned with the query. However, context recall proved limited in these configurations, suggesting that, although the answers were of high quality, the model might have been missing some relevant information that was not retrieved due to the restriction of `k`.
When the value of `k` was raised to five and ten, it was observed that “context recall” increased, indicating greater coverage of relevant information. However, this expansion occurred at the expense of the quality of the generated response. In several cases, the “answer relevancy” metric dropped drastically, approaching zero. This pattern revealed that the inclusion of a larger volume of information, even if potentially relevant, introduced noise into the context sent to the LLM, compromising the model’s ability to generate a precise and contextualized final response, according to the literature on prompt engineering (Gabriel Filho, 2023).
A relevant and consistent aspect observed was the high “context precision”, frequently equal to 1.0. Although, at first glance, this could indicate high quality in retrieval, in practice, this metric revealed limitations in adequately penalizing the presence of noise in the retrieved contexts. Variations in the “faithfulness” metric also indicated that, even when the model maintained coherence with the provided contexts, this did not guarantee the usefulness or adherence of the response to the user’s question, reinforcing the need to improve the context selection and filtering process.
The comparative analysis between the different indexing strategies and the size of the “chunks” also demonstrated their influence on performance. The “document aware chunking” strategy, which associated each “chunk” with a complete call record, presented high values of “context recall”. This indicated a good ability to retrieve relevant information from the Knowledge Base. However, this approach did not result in a corresponding improvement in “answer relevancy”, suggesting that the volume and granularity of the data, even if useful, made it difficult for the model to identify the most pertinent passages, corroborating the need to refine how the LLM interacts with the context.
In general, initial experiments showed that, although some scenarios presented a better balance between fidelity and coverage, others suffered from a sharp drop in the relevance of the responses. This finding was crucial to identify that the problem was not limited only to the language model, but was strongly rooted in the retrieval and processing stage of the contexts. These analyses were fundamental to justify the need to implement additional quality control mechanisms on the retrieved contexts in the RAG pipeline, aiming to optimize the interaction between the knowledge base and the LLM.
Based on these limitations, structural improvements were implemented in the system, including the introduction of filters by similarity “score”, the reduction of the number of retrieved contexts (`k`), the application of “re-ranking” strategies, and the refinement of the “prompt” sent to the language model. These changes were designed to reduce noise, increase the relevance of the retrieved snippets, and guide the model more effectively in generating responses. The implementation of these new configurations resulted in a second experimental stage, where significant gains were observed in the “answer relevancy” and “faithfulness” metrics, as well as greater stability in the results, confirming the effectiveness of the proposed improvements.
The results obtained in the second experimental stage, especially in experiment six, demonstrated that the adjustments made, such as similarity filtering, “re-ranking”, and “prompt” refinement, resulted in significant improvements in the relevance and fidelity of the responses. “Answer relevancy” increased considerably, “faithfulness” stabilized, and “context precision” remained consistent, directly impacting the overall quality of the RAG model. This evolution validates the incremental optimization approach and the importance of a well-tuned RAG pipeline for converting historical call records into structured knowledge, increasing the efficiency of support services.
4. Conclusion
This study aimed to develop an Artificial Intelligence model based on the Retrieval-Augmented Generation (RAG) technique to automate the creation and maintenance of a Knowledge Base in Help Desk systems, converting historical technical support tickets into structured knowledge and, thus, improving the efficiency of support services. It was observed in initial experiments that increasing the amount of retrieved contexts (parameter k) improved context recall but significantly compromised the relevance of the responses generated by large language models (LLMs). This dynamic indicated an information overload, where the LLM faced difficulties in prioritizing the most pertinent data. Consequently, improvements were implemented in the pipeline, including similarity score filters, re-ranking, reduction of the number of contexts sent to the LLM, and prompt refinement. These modifications resulted in significant gains in the relevance and fidelity metrics of the responses, with a specific configuration demonstrating superior performance and greater stability. The proposed RAG model adds strategic value to Help Desk systems, optimizing technical support by speeding up diagnosis and contributing to the continuous improvement of services.
Despite the advances achieved, a limitation identified was the low adherence to filling out the notes field in technical calls, which restricts the potential for enriching the Knowledge Base. For future studies, the implementation of conversational memory mechanisms is suggested to avoid redundant queries and reduce computational costs. The development of a chat interface for direct service to end-users is also recommended, expanding the model’s application to first-level support. Additionally, awareness actions for the correct completion of the notes field can improve the quality and quantity of stored knowledge, positively impacting the RAG model’s performance.
Bibliographic References
Carvalho, A.C.P.L.F.; Menezes, A.G.; Bonidia, R.P. 2024. Ciência de dados: fundamentos e aplicações. LTC Editora, Rio de Janeiro, RJ, Brasil.
Cohen, R. 2008. Implantação de Help-Hesk e Service Desk. Novatec Editora, São Paulo, SP, Brasil.
Gabriel Filho, O. 2023. Inteligência artificial e aprendizagem de máquina: aspectos teóricos e aplicações. Blucher, São Paulo, SP, Brasil.
Laudon, K.C.; Laudon, J.P. 2004. Sistemas de informação gerenciais: administrando a empresa digital. Prentice Hall, São Paulo, SP, Brasil.
Pressman, R.S. 2011. Engenharia de software. AMGH, Porto Alegre, RS, Brasil.
Valiant, L.G. 2000. Robust Logics. Artificial intelligence, 121(1-2): 1-27.
Article originating from the Final Course Work of the Specialization in Software Engineering of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform