DOI: 10.18419/darus-4605
title: Replication Data for: Advanced System Integration: Analyzing OpenAPI Chunking for Retrieval-Augmented Generation

description: &lt;p&gt;Integrating multiple (sub-)systems is essential to create advanced Information Systems (ISs). Difficulties mainly arise when integrating dynamic environments across the IS lifecycle, e.g., services not yet existent at design time. A traditional approach is a registry that provides the API documentation of the systems’ endpoints. Large Language Models (LLMs) have shown to be capable of automatically creating system integrations (e.g., as service composition) based on this documentation but require concise input due to input token limitations, especially regarding comprehensive API descriptions. Currently, it is unknown how best to preprocess these API descriptions. Within this work, we (i) analyze the usage of Retrieval Augmented Generation (RAG) for endpoint discovery and the chunking, i.e., preprocessing, of state-of-practice OpenAPIs to reduce the input token length while preserving the most relevant information. To further reduce the input token length for the composition prompt and improve endpoint retrieval, we propose (ii) a Discovery Agent that only receives a summary of the most relevant endpoints and retrieves specification details on demand. We evaluate RAG for endpoint discovery using the RestBench benchmark, first, for the different chunking possibilities and parameters measuring the endpoint retrieval recall, precision, and F1 score. Then, we assess the Discovery Agent using the same test set. With our prototype, we demonstrate how to successfully employ RAG for endpoint discovery to reduce token count. While revealing high values for recall, precision, and F1, further research is necessary to retrieve all requisite endpoints. Our experiments show that for preprocessing, LLM-based and format-specific approaches outperform naïve chunking methods. Relying on an agent further enhances these results as the agent splits the tasks into multiple fine granular subtasks, improving the overall RAG performance in the token count, precision, and F1 score.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Content:&lt;/b&gt;&lt;/p&gt;

&lt;dl&gt;
 &lt;dt&gt;&lt;code&gt;code.zip&lt;/code&gt;:&lt;/dt&gt;&lt;dd&gt;Python source code to perform the experiments.
 &lt;ul&gt;
 &lt;li&gt;&lt;code&gt;evaluate.py&lt;/code&gt;: Script to execute the experiments (Uncomment lines to select the embedding model).&lt;/li&gt;
 &lt;li&gt;&lt;code&gt;socrag/*&lt;/code&gt;: Source code for the RAG.&lt;/li&gt;
 &lt;li&gt;&lt;code&gt;benchmark/*&lt;/code&gt;: RestBench specification.&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/dd&gt;
 &lt;dt&gt;&lt;code&gt;results.zip&lt;/code&gt;:&lt;/dt&gt;&lt;dd&gt;Results of the RAG experiments (in the folder &lt;code&gt;/results/data/&lt;/code&gt; inside the zip file).
 &lt;ul&gt;
 &lt;li&gt;Experiment results for the RAG: &lt;code&gt;results_{embedding_model}_{top-k}.json&lt;/code&gt;.&lt;/li&gt;
 &lt;li&gt;Experiment results for the Discovery Agent: &lt;code&gt;results_{embedding_model}_{agent}_{refinement}_{llm}.json&lt;/code&gt;.&lt;/li&gt;
 &lt;li&gt;FAISS store (intermediate data required for exact reproduction of results; one folder for each embedding model): &lt;code&gt;bge_small&lt;/code&gt;, &lt;code&gt;nvidia&lt;/code&gt; and &lt;code&gt;oai&lt;/code&gt;.&lt;/li&gt;
 &lt;li&gt;Intermediate data of the LLM-based refinement methods required for the exact reproduction of results: &lt;code&gt;*_parser.json&lt;/code&gt;.&lt;/li&gt;
 &lt;/ul&gt;
 &lt;/dd&gt;
&lt;/dl&gt;