An AI-powered personal assistant and email summarizer built with Python, Flask, and Groq. The application uses a large language model to answer user questions and summarize lengthy emails through a simple web interface.
- Answers user questions using an AI language model.
- Provides helpful responses through an interactive web interface.
- Uses the Groq API with the
openai/gpt-oss-20bmodel.
- Summarizes lengthy emails into concise, easy-to-understand summaries.
- Generates summaries in approximately 2–3 sentences.
- Helps users quickly understand the main points of an email.
- Simple and user-friendly interface built with HTML and CSS.
- Flask handles backend requests and AI responses.
- Uses JSON responses to communicate with the frontend.
- Language: Python
- Backend: Flask
- AI Model:
openai/gpt-oss-20b - LLM Provider: Groq
- API Client: OpenAI Python SDK
- Frontend: HTML, CSS, JavaScript
- Environment Variables: python-dotenv
AI_Assistant/
│
├── static/
│ └── style.css
│
├── templates/
│ └── index.html
│
├── .gitignore
├── main.py
└── README.md
Follow these steps to run the project locally.
git clone https://github.com/Taha254511/AI-Assistant.git
cd AI-Assistantpython -m venv .venvActivate the environment on Windows using Git Bash:
source .venv/Scripts/activateInstall the required Python packages:
pip install flask python-dotenv openaiCreate a .env file in the root directory and add your Groq API key:
GROK_API_KEY=your_groq_api_keyReplace your_groq_api_key with your actual API key.
You can obtain an API key through the official Groq Console.
Start the Flask development server:
python main.pyOpen the local address displayed in your terminal, typically:
http://127.0.0.1:5000/
You can now interact with the AI assistant and use the email summarization feature.
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Renders the main web interface |
/ask |
POST | Processes user questions and returns AI-generated answers |
/summarize |
POST | Summarizes email text and returns the summary |
Both POST endpoints return JSON responses containing the generated text.
- Store API keys in environment variables.
- Keep
.envout of version control. - Never expose API keys in source code or screenshots.
- Disable Flask debug mode when deploying the application publicly.
- Add conversation history.
- Improve error handling for API failures.
- Support multiple AI models.
- Add copy-to-clipboard functionality for generated responses.
- Deploy the application for public access.
Taha Hussain
Built with Python, Flask, and Groq to make everyday tasks easier with AI.