The AI Lab Assistant Chat application is a web-based tool designed to help users and administrators interact with an AI-powered assistant. The application is built using Flask for the backend and Bootstrap for the frontend. It leverages MongoDB for data storage and OpenAI for generating embeddings and processing questions.
- Chat with AI Assistant: Users can interact with an AI assistant to get answers to their questions.
- Sample Questions: Frequently asked questions are displayed as clickable samples for quick access.
- Previous Conversations: Users can view and delete their previous chat conversations.
- Add Questions and Answers: Administrators can add new question and answer pairs to the system.
- Mark Sample Questions: Administrators can mark certain questions as samples, which will then be displayed to users as frequently asked questions.
- Rich Text and Markdown Support: Answers can be formatted using markdown for rich text presentation.
- Framework: Flask
- Database: MongoDB
- AI Integration: OpenAI for generating embeddings and processing questions
- Framework: Bootstrap
- Rich Text Editor: Quill.js for the admin interface
-
Clone the repository:
git clone https://github.com/yourusername/ai-lab-assistant-chat.git cd ai-lab-assistant-chat
-
Create a virtual environment:
python3 -m venv venv
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Create a .env file in the root directory and add the following variables:
FLASK_APP=run.py
FLASK_ENV=development
MONGODB_URI=your_mongodb_uri
MONGODB_DB=your_database_name
MONGODB_COLLECTION=your_collection_name
OPENAI_API_KEY=your_openai_api_key
flask run
- app/: Contains the Flask application
- init.py: Initializes the Flask app
- routes.py: Defines the routes for the application
- utils.py: Contains utility functions for database interactions and AI processing
- templates/: HTML templates for the application
- index.html: Main user interface
- admin.html: Admin interface
- static/: Static files (CSS, JS)
- styles.css: Custom styles for the application
- chat.js: JavaScript for handling chat functionality
- config.py: Configuration file for environment variables
- run.py: Entry point for the Flask application
- Home Page: Displays information about the application and a link to start a conversation.
- Chat Page: Allows users to chat with the AI assistant and view previous conversations.
- Sample Questions: Users can click on sample questions to quickly get answers.
- Add Question: Admins can add new questions and answers, and mark them as sample questions.
- Markdown Support: Admins can use markdown to format answers.
- User Authentication: Enhance the user authentication system for better security.
- Analytics Dashboard: Add an admin dashboard to view analytics on user interactions and question trends.
- Improved UI/UX: Continuously improve the user interface and user experience based on feedback.
Fork the repository:
git clone https://github.com/yourusername/ai-lab-assistant-chat.git
cd ai-lab-assistant-chat
git checkout -b feature/your-feature-name
git commit -m "Add your feature"
git push origin feature/your-feature-name
Go to the repository on GitHub and create a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.