A powerful Arabic chatbot application that answers questions based on text content loaded from files using Google's Gemini 1.5 Pro AI model.
- Natural Arabic Conversation: Interactive chatbot with support for Egyptian Arabic dialect
- Context-Aware Responses: AI answers based solely on the loaded text content
- Beautiful UI/UX: Rich, responsive user interface with modern design elements
- Real-time Interaction: Dynamic conversation interface with typing indicators
- Conversation History: Save and load conversation sessions
- Optimized for Arabic: Full RTL (Right-to-Left) support and Arabic-optimized design
Check out the live demo: المساعد الذكي
- Python 3.9+
- Flask for API endpoints
- LangChain & LangGraph for AI conversation management
- Google Gemini 1.5 Pro AI model
- Python-dotenv for environment variable management
- Pure HTML, CSS, and JavaScript
- Interactive particle system for dynamic background
- Responsive design for all device sizes
- Modern animations and UI effects
- Python 3.9 or higher
- A Google API key for Gemini 1.5 Pro access
-
Clone the repository:
git clone https://github.com/A11Veles/answerfrompdf.git cd answerfrompdf -
Create a virtual environment and activate it:
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.envfile in the project root with your Google API key:GOOGLE_API_KEY=your_google_api_key_here -
Create a directory for your Arabic text content:
mkdir content_arabic
-
Add your text files (in UTF-8 encoding) to the
content_arabicdirectory.
-
Start the Flask server:
python api.py
-
Open your browser and navigate to:
http://localhost:5000 -
Start chatting with the AI assistant in Arabic!
answerfrompdf/
├── api.py # Flask API for serving the frontend and handling requests
├── main.py # Core chatbot logic with Gemini AI integration
├── index.html # Frontend user interface
├── requirements.txt # Python dependencies
├── .env # Environment variables (not in repo)
└── content_arabic/ # Directory for text files to be processed
GOOGLE_API_KEY: Your Google API key for accessing Gemini 1.5 Pro
- Fork this repository
- Create a new project in Vercel
- Link your GitHub repository
- Set the following:
- Build Command:
pip install -r requirements.txt - Output Directory:
./ - Install Command:
pip install -r requirements.txt
- Build Command:
- Add your environment variables in the Vercel dashboard
- Deploy!
This project is provided as-is. Feel free to use and modify as needed.
For any questions or feedback, please open an issue on GitHub.
Built with ❤️ using Google Gemini 1.5 Pro