PDF Insight Analyzer is an advanced AI-powered application that transforms static PDF documents into interactive knowledge bases. Built with Python and Flask, this tool leverages OpenAI's GPT and embedding models along with Qdrant's vector search capabilities to provide intelligent insights from your documents.
-
AI-Powered Q&A: Ask natural language questions about your PDF content
-
Semantic Search: Find relevant information using meaning-based search
-
Document Intelligence: Extract and understand complex document structures
-
Knowledge Discovery: Uncover hidden insights across multiple documents
-
π PDF Upload & Processing: Securely upload and process PDF documents
-
π Vector Embedding: Convert text to semantic vectors for intelligent search
-
π¬ Natural Language Interaction: Ask questions in plain English
-
π§ AI-Powered Insights: Get accurate answers from document content
-
ποΈ Document Management: Organize and select documents from dropdown
-
Advanced Vector Search: Qdrant Cloud for efficient similarity search
-
State-of-the-Art AI: OpenAI GPT-3.5 Turbo for natural language understanding
-
Modern Web Interface: Responsive design with intuitive UX
-
Secure Architecture: Local processing of sensitive documents
-
Scalable Backend: Flask-based API ready for production deployment
| Component | Technology | Purpose |
|-------------------|-------------------------------|------------------------------------------|
| **Framework** | Flask 3.0 | Web application framework |
| **AI Models** | OpenAI API | Natural language processing |
| **Vector DB** | Qdrant Cloud | Semantic search and storage |
| **Embeddings** | OpenAI text-embedding-3-small | Text to vector conversion |
| **PDF Processing**| PyPDF2 | Text extraction from PDFs |
| Component | Technology | Purpose |
|-----------------|---------------------|----------------------------------|
| **UI Framework**| HTML5/CSS3 | Application interface |
| **Styling** | CSS Animations | Interactive user experience |
| **Icons** | Font Awesome 6 | Visual elements |
| **Layout** | CSS Grid/Flexbox | Responsive design |
pdf-insight-app/
βββ app.py # Main Flask application
βββ config.py # Configuration settings
βββ requirements.txt # Dependencies
βββ README.md # Documentation
βββ .gitignore # files and folders to ignore(not track)
βββ utils/
β βββ db_utils.py # Qdrant database operations
β βββ pdf_utils.py # PDF processing functions
β βββ ai_utils.py # OpenAI API interactions
βββ templates/
β βββ index.html # Main UI template
βββ static/
βββ style.css # CSS styles
-
Python 3.9+
-
Pip package manager
-
OpenAI API account (sign up)
-
Qdrant Cloud account (sign up)
-
- Clone the repository
git clone https://github.com/abuawaish/pdf-insight-analyzer.git
cd pdf-insight-analyzer-
- Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows-
- Install dependencies
pip install -r requirements.txt-
- Configure environment variables
Create
.envfile with your credentials:
- Configure environment variables
Create
OPENAI_API_KEY=your_openai_api_key
QDRANT_URL=your_qdrant_cloud_url
QDRANT_API_KEY=your_qdrant_api_key-
- Initialize the application
python app.py-
- Access the application
Open your browser to: http://localhost:5002
-
Click "Browse Files" or drag-and-drop a PDF
-
Select your PDF document
-
Click "Process Document"
-
Watch as the system extracts and indexes content
-
Select your document from the dropdown
-
Enter your question in natural language
-
Click "Get Insights"
-
Receive AI-generated answers based on document content
-
"What are the main findings in this report?"
-
"Summarize the key points from section 3"
-
"List all recommendations mentioned"
-
"Explain the methodology used in this paper"
-
"What dates are important in this document?"
| Endpoint | Method | Description | Parameters |
|--------------|--------|--------------------------|----------------------------------------------------|
| `/` | GET | Main application UI | None |
| `/upload` | POST | Process PDF upload | `pdf` (file) |
| `/query` | POST | Handle document queries | JSON: `{ "pdf_name": string, "query": string }` |
{
"pdf_name": "annual-report-2023.pdf",
"query": "What were the key financial metrics?"
}
{
"response": "The key financial metrics included a 15% YoY revenue growth..."
}
graph TD
A[User Interface] -->|Upload PDF| B[Flask Server]
B --> C[PDF Processing]
C --> D[Text Extraction]
D --> E[Text Chunking]
E --> F[Vector Embedding]
F --> G[Qdrant Vector DB]
A -->|Query| H[Query Processing]
H --> I[Query Embedding]
I --> J[Semantic Search]
J --> K[Context Retrieval]
K --> L[OpenAI API]
L --> M[AI Response Generation]
M --> A