Lease AI Chatbot
The Lease AI Chatbot is a Streamlit-based web application that enables users to upload
lease agreement PDFs, query document content using natural language, and perform
targeted edits such as deleting or modifying specific lines or paragraphs using AI.
Features
• PDF Upload: Users can upload lease agreement documents in PDF format for
processing.
• Natural Language Question Answering: The application supports semantic
queries, allowing users to ask questions about the lease (e.g., "What is the lease
term?" or "Is there a renewal clause?").
• AI-Assisted Editing: Users can issue natural language commands to modify the
document, such as “Delete line 2 in paragraph 5” or “Change lease duration to 24
months.”
• Text Parsing and Contextual Understanding: The system parses the PDF into
paragraphs or line segments, enabling precise targeting for both question
answering and editing tasks.


Technology Stack
• Streamlit – User interface and web framework
• Python – Backend and core logic
• OpenAI API / LangChain – Natural language processing and AI-driven functionality
• PDFplumber / PyMuPDF – PDF extraction and layout analysis
• Optional: FAISS or ChromaDB for embedding-based document indexing


Installation
1. Clone the repository:
bash
CopyEdit
git clone https://github.com/your-username/lease-ai-chatbot.git
cd lease-ai-chatbot
2. Install dependencies:
bash
CopyEdit
pip install -r requirements.txt
3. Set your OpenAI API key as an environment variable:
bash
CopyEdit
export OPENAI_API_KEY= “sk-proj-9uBkohI821M4fGOi-5tuVQ0BBhVe8iUe6-
GVuuY96Ni-
6QNVWSxEJ2lOaBZAb9r9BGB0Y2CQOGT3BlbkFJ2S6ipEoIxUnN8bp7wLTWB9pSJJqvBVE8IQhc
xfMdUJy-xyY7kzIwf5Xr8LtIlkBLFsSxI7Py0A"
4. Launch the application:
bash
CopyEdit
streamlit run app.py


How It Works
1. 2. 3. The user uploads a lease PDF.
The document is parsed into text segments (e.g., paragraphs or lines).
User queries and edit commands are interpreted using an LLM (via OpenAI).
4. The system returns relevant answers or applies the requested modifications to the
document text.


Roadmap
Planned enhancements include:
• Exporting edited documents
• In-app version control for changes
• User roles and permissions
• UI enhancements for in-place editing and clause navigation


License
This project is licensed under the MIT License.


Contributions
Contributions are welcome. For major changes, please open an issue to discuss proposed
modifications before submitting a pull request.