This project showcases the analysis of lease PDF documents through a Quarkus microservice integrated with Google AI Gemini, extracting structured metadata information from lease agreements.
This application is a web-based tool that extracts key information from lease agreements using Google's Gemini AI model. It provides a simple interface where users can:
- Upload PDF lease documents
- Get structured analysis of lease terms including:
- Agreement date
- Lease term start and end dates
- Development term end date
- Landlord and tenant names
- Property size in acres
The application is built using:
- Quarkus - A Kubernetes-native Java framework
- LangChain4j - Java bindings for LangChain to interact with LLMs
- Google Gemini AI - For PDF document analysis and information extraction
- RESTEasy - For handling multipart file uploads
- HTML/JavaScript frontend - Simple UI for file upload and results display
The backend processes the PDF through these steps:
- Accepts PDF upload via multipart form data
- Converts PDF content to base64 encoding
- Sends to Gemini AI with a structured JSON schema for response formatting
- Returns parsed lease information in a standardized format
- Displays results in a tabular format on the web interface
The main components are:
LeaseAnalyzerResource
- REST endpoint for PDF analysisLeaseReport
- Data structure for lease information- Web interface for file upload and results display
A prerequisite to running this example is to provide your Google Gemini API key. You can get one for free, see more details here: https://ai.google.dev/gemini-api/docs/api-key
export GOOGLE_AI_GEMINI_API_KEY=<your-google-ai-gemini-api-key>
Then, simply run the project in Dev mode:
mvn quarkus:dev
Open the application at http://localhost:8080 and click Upload
then Analyze
.