|
|
--- |
|
|
license: mit |
|
|
sdk: gradio |
|
|
colorFrom: yellow |
|
|
colorTo: green |
|
|
sdk_version: 5.49.1 |
|
|
--- |
|
|
# AI Assistant - Gradio Web Application |
|
|
|
|
|
A comprehensive AI Assistant built with Gradio that combines chat functionality, notes management, reminders, document processing, and system monitoring in a single web interface. |
|
|
|
|
|
## π Features |
|
|
|
|
|
- **π¬ Smart Chat**: Intelligent conversations with AI assistance |
|
|
- **π Notes Management**: Create, edit, and organize your notes |
|
|
- **β° Reminders**: Set and manage time-based notifications |
|
|
- **π Document Processing**: Upload and analyze PDF, TXT, and Markdown files |
|
|
- **π» System Monitoring**: Real-time system performance metrics |
|
|
|
|
|
## π οΈ Technology Stack |
|
|
|
|
|
- **Frontend**: Gradio web interface |
|
|
- **Backend**: Python with integrated AI capabilities |
|
|
- **AI Integration**: Google Gemini API (configurable) |
|
|
- **Data Storage**: JSON-based local storage |
|
|
- **File Processing**: Support for multiple document formats |
|
|
|
|
|
## πββοΈ Quick Start |
|
|
|
|
|
### Local Development |
|
|
|
|
|
1. **Clone the repository** |
|
|
```bash |
|
|
git clone <your-repo-url> |
|
|
cd ai-assistant-gradio |
|
|
``` |
|
|
|
|
|
2. **Install dependencies** |
|
|
```bash |
|
|
pip install -r requirements.txt |
|
|
``` |
|
|
|
|
|
3. **Set up environment variables** (optional) |
|
|
```bash |
|
|
# Create .env file |
|
|
GEMINI_API_KEY=your_gemini_api_key_here |
|
|
OPENAI_API_KEY=your_openai_api_key_here |
|
|
``` |
|
|
|
|
|
4. **Run the application** |
|
|
```bash |
|
|
python gradio_app.py |
|
|
``` |
|
|
|
|
|
5. **Open your browser** |
|
|
Navigate to `http://localhost:7860` |
|
|
|
|
|
### Hugging Face Spaces Deployment |
|
|
|
|
|
1. **Create a new Space** on [Hugging Face Spaces](https://huggingface.co/spaces) |
|
|
2. **Select Gradio** as the SDK |
|
|
3. **Upload these files**: |
|
|
- `gradio_app.py` (main application) |
|
|
- `requirements.txt` (dependencies) |
|
|
- `README.md` (this file) |
|
|
4. **Add secrets** (if using AI APIs): |
|
|
- `GEMINI_API_KEY`: Your Google Gemini API key |
|
|
- `OPENAI_API_KEY`: Your OpenAI API key |
|
|
5. **Deploy** and your app will be live! |
|
|
|
|
|
## π± Usage Guide |
|
|
|
|
|
### Chat Interface |
|
|
- Type messages in the chat box to interact with the AI |
|
|
- Use example prompts to get started quickly |
|
|
- Chat history is automatically saved |
|
|
|
|
|
### Notes Management |
|
|
- Create notes with titles and content |
|
|
- View all notes in an organized display |
|
|
- Delete notes by exact title match |
|
|
- Notes persist between sessions |
|
|
|
|
|
### Reminders System |
|
|
- Set reminders with specific dates and times |
|
|
- Add descriptions for detailed reminders |
|
|
- Mark reminders as completed |
|
|
- View active and completed reminders |
|
|
|
|
|
### Document Processing |
|
|
- Upload PDF, TXT, or Markdown files |
|
|
- Get automatic analysis and content preview |
|
|
- Files are saved for future reference |
|
|
- Content can be queried through chat |
|
|
|
|
|
### System Monitoring |
|
|
- View real-time system performance |
|
|
- Monitor CPU, memory, and disk usage |
|
|
- Track application statistics |
|
|
- Auto-refresh every 30 seconds |
|
|
|
|
|
## π§ Configuration |
|
|
|
|
|
### Environment Variables |
|
|
|
|
|
- `GEMINI_API_KEY`: Google Gemini API key for AI responses |
|
|
- `OPENAI_API_KEY`: OpenAI API key (alternative AI provider) |
|
|
- `DEBUG`: Set to `true` for debug mode |
|
|
- `PORT`: Custom port (default: 7860) |
|
|
|
|
|
### Customization |
|
|
|
|
|
The application is designed to be easily customizable: |
|
|
|
|
|
- **AI Provider**: Modify the `_generate_mock_response` method to integrate with different AI services |
|
|
- **Storage**: Replace JSON storage with database integration |
|
|
- **UI Theme**: Customize the Gradio theme and CSS |
|
|
- **Features**: Add or remove tabs and functionality as needed |
|
|
|
|
|
## π Data Storage |
|
|
|
|
|
Data is stored locally in JSON files: |
|
|
- `data/notes.json`: User notes |
|
|
- `data/reminders.json`: User reminders |
|
|
- `data/chat_history.json`: Chat conversation history |
|
|
- `data/documents/`: Uploaded documents |
|
|
|
|
|
## π Security Notes |
|
|
|
|
|
- Data is stored locally and not shared externally |
|
|
- API keys should be kept secure and not committed to version control |
|
|
- File uploads are processed locally and stored in the data directory |
|
|
- Consider implementing user authentication for production use |
|
|
|
|
|
## π Deployment Options |
|
|
|
|
|
### Hugging Face Spaces (Recommended) |
|
|
- Free hosting for public applications |
|
|
- Automatic deployment from Git repository |
|
|
- Built-in secrets management |
|
|
- Easy sharing and collaboration |
|
|
|
|
|
### Other Platforms |
|
|
- **Streamlit Cloud**: Alternative free hosting |
|
|
- **Railway**: Easy deployment with custom domains |
|
|
- **Heroku**: Traditional cloud platform |
|
|
- **DigitalOcean**: VPS deployment |
|
|
- **Local Server**: Self-hosted solution |
|
|
|
|
|
## π€ Contributing |
|
|
|
|
|
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests. |
|
|
|
|
|
### Development Setup |
|
|
|
|
|
1. Fork the repository |
|
|
2. Create a feature branch |
|
|
3. Make your changes |
|
|
4. Test thoroughly |
|
|
5. Submit a pull request |
|
|
|
|
|
## π License |
|
|
|
|
|
This project is open source and available under the MIT License. |
|
|
|
|
|
## π Support |
|
|
|
|
|
If you encounter any issues or have questions: |
|
|
|
|
|
1. Check the [Issues](https://github.com/your-repo/issues) page |
|
|
2. Create a new issue with detailed information |
|
|
3. Join the discussion in the community |
|
|
|
|
|
## π― Roadmap |
|
|
|
|
|
Future enhancements planned: |
|
|
- [ ] User authentication and multi-user support |
|
|
- [ ] Database integration (PostgreSQL, MongoDB) |
|
|
- [ ] Advanced AI integrations |
|
|
- [ ] Mobile app companion |
|
|
- [ ] API endpoints for external integration |
|
|
- [ ] Advanced document analysis |
|
|
- [ ] Email and calendar integration |
|
|
- [ ] Voice commands and speech synthesis |
|
|
- [ ] Plugin system for extensibility |
|
|
|
|
|
--- |
|
|
|
|
|
**Built with β€οΈ using Gradio and Python** |
|
|
|
|
|
*Perfect for deployment on Hugging Face Spaces!* |