This is a Flask-based AI-powered document management and onboarding system that helps organizations manage their internal documents and provide intelligent assistance to users through AI integration.
- Document Management: Upload, store, and organize various document types (PDF, DOCX, MD, TXT)
- AI Integration: Powered by Google Gemini AI for intelligent document analysis and user assistance
- User Management: Secure user authentication and session management
- Knowledge Base: Enhanced knowledge base with document indexing and retrieval
- File Processing: Automatic file processing and content extraction
- Web Interface: User-friendly web interface with dashboard and file management
- Document content analysis
- Intelligent Q&A based on document corpus
- Context-aware responses
- Multi-language support (including Azerbaijani)
- User authentication system
- Secure file upload handling
- Session management
- SQL injection protection
├── app.py # Main Flask application
├── config.py # Configuration settings
├── models.py # Core models (KnowledgeBase, UserManager, AIAssistant)
├── file_manager.py # File handling and processing
├── requirements.txt # Python dependencies
├── setup.py # Package setup configuration
├── .gitignore # Git ignore rules
├── documents/ # Uploaded and processed documents
├── templates/ # HTML templates
│ ├── dashboard.html # Main dashboard
│ ├── files.html # File management interface
│ └── login.html # Login page
├── test_documents/ # Sample test documents
├── simple_test_docs/ # Simple test documents
└── tests/ # Test files
├── simple_test.py
├── test_ai_integration.py
└── test_large_files.py
- Python 3.8 or higher
- Google Gemini API key
-
Clone the repository
git clone <your-repo-url> cd Python_Project_Task_A
-
Create virtual environment
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Environment Configuration Create a
.env
file in the root directory:GEMINI_API_KEY=your_google_gemini_api_key_here FLASK_SECRET_KEY=your_secret_key_here FLASK_ENV=development
-
Initialize the database
python -c "from models import UserManager; UserManager().create_tables()"
-
Run the application
python app.py
The application will be available at http://localhost:5000
GEMINI_API_KEY
: Your Google Gemini API keyFLASK_SECRET_KEY
: Secret key for Flask sessionsFLASK_ENV
: Environment mode (development/production)
- Maximum file size: 16MB
- Supported formats: PDF, DOCX, MD, TXT
- Upload directory:
documents/
- Login: Access the system through the login page
- Dashboard: View system overview and statistics
- File Management: Upload, view, and manage documents
- AI Assistant: Ask questions about your documents
GET /
: Dashboard (login required)GET /login
: User login pagePOST /login
: Process loginGET /logout
: User logoutGET /files
: File management interfacePOST /upload
: Upload new filesPOST /ask
: AI assistant Q&A
Run the test suite:
# Simple functionality test
python simple_test.py
# AI integration test
python test_ai_integration.py
# Large file handling test
python test_large_files.py
- Flask 3.0.0: Web framework
- google-generativeai 0.3.2: Google Gemini AI integration
- Werkzeug 3.0.1: WSGI utilities
- gunicorn 21.2.0: Production WSGI server
- python-dotenv 1.0.0: Environment variable management
The application uses SQLite databases:
users.db
: User authentication datafile_index.db
: Document indexing and metadata
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature
) - Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature/new-feature
) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please contact the development team.
- Initial release
- Basic document management
- AI integration with Google Gemini
- User authentication system
- Web interface implementation