LLM Based Multi-Agent Generation of Semi-structured Documents from Semantic Templates in the Public Administration Domain
Emanuele Musumeci, Michele Brienza, Vincenzo Suriani, Daniele Nardi,Domenico Daniele Bloisi
LLM Based Multi-Agent Generation of Semi-structured Documents from Semantic Templates in the Public Administration Domain
Emanuele Musumeci, Michele Brienza, Vincenzo Suriani, Daniele Nardi,Domenico Daniele Bloisi
In the last years’ digitalization process, the creation and management of documents in various domains, particularly in Public Administration, have become increasingly complex and diverse. This complexity arises from the need to handle a wide range of document types, often characterized by semi-structured forms. Semi-structured documents present a fixed set of data without a fixed format. For instance, in the same type of document, the same information may appear in different places or different terms may be used for the same information. As a consequence, a template-based solution cannot be used, as understanding a document requires the extraction of the data structure. The recent introduction of Large Language Models (LLMs) has enabled the creation of customized text output satisfying user requests. Recent iterations of LLMs proved to generate better outputs in few-shot demonstrations, where one or more examples of the desired output are provided to obtain the desired result in contextual specifications regarding the required content and style. In this work, we propose a novel approach that combines the LLMs, as foundation models, with advanced techniques in prompt engineering and multi-agent systems for generating new documents that follow the structure of the input documents provided to the system. The work’s main contribution concerns replacing the commonly used manual prompting with a task description generated by semantic retrieval from an LLM. The potential of this approach is demonstrated through a series of experiments and case studies, showcasing its effectiveness in real-world Public Administration scenarios