LLM Based Multi-Agent Generation of Semi-structured Documents from Semantic Templates in the Public Administration Domain
Emanuele Musumeci1,
Michele Brienza1,
Vincenzo Suriani1,
Daniele Nardi1,
Domenico D. Bloisi2
1 Department of Computer, Control and Management Engineering, Sapienza University of Rome, Rome, Italy, 3 International University of Rome UNINT, Rome, Italy
By loading a semi-structured document into this framework, you can generate a personalized document with your data while leveraging the structure of the original template. This pipeline efficiently processes templates, extracts semantic cues, and produces a complete document tailored to your needs, leveraging the power of LLMs.
- Multi-Agent Architecture:
- Semantics Identification Agent: Extracts semantics and instructions from template sections.
- Information Retrieval Agent: Retrieves and validates required data from the accumulated prompt.
- Content Generation Agent: Creates document sections conforming to semantic instructions.
- Incremental Prompt Refinement: Continuously improves prompts for better context and output.
- Template-Driven Workflow: Processes document sections sequentially to maintain structure and semantics.
- Interactive User Feedback: Requests user input only when critical information is missing.
Clone this repo
git clone https://github.com/michelebri/multi_agent_document_generation
Create a conda environment
conda create -n nome_env python=3.8 && conda activate nome_env
pip install -r requirements.txt
Follow the guide to create an adobe API key:
https://developer.adobe.com/document-services/docs/overview/pdf-services-api/quickstarts/python/
Create you openai api key
Run the code with
python generate.py
Upload a PDF from your local files to begin the creation process. After providing a prompt, you can optionally start without any input by clicking "Start the Creation Process." On the right, you will see the document's sections, where you can choose to modify or skip each section. In the first text box, you'll find suggestions from the Information Retrieval Agent. You can add the requested information and customize the document with your own data.
