MATBot is an intelligent assistant designed to troubleshoot MATLAB software-related issues. The application leverages RAG (Retrieval-Augmented Generation) architecture and LLM models to provide accurate, contextual solutions to common MATLAB problems by drawing from official MathWorks documentation.
- AI-Powered Troubleshooting: Identifies and resolves MATLAB errors with step-by-step solutions
- Semantic Clustering: Organizes technical documentation into relevant clusters for better retrieval
- Interactive Chat Interface: User-friendly Streamlit-based chat interface with real-time feedback
- Model Customization: Select between different Gemini models with configurable system prompts
- Response Evaluation: Automatic quality assessment of AI responses with detailed feedback
- Structured Content Output: Presents solutions in an easy-to-follow format with problem summary, root cause, and resolution
- Self-Memory System: Learns from previous high-quality interactions to provide better responses
- Adaptive Response Style: Automatically detects whether to provide concise or detailed answers
- Visual Support: Provides relevant images to help understand complex MATLAB concepts
- Query Enhancement: Uses HyDE (Hypothetical Document Embeddings) to improve search quality
The application follows a modular architecture:
-
Data Collection & Processing:
- Web scraping of MATLAB documentation
- HTML to structured JSON conversion (
structurify.py
)
-
Knowledge Base:
- Semantic clustering of documents (
clustering.py
) - FAISS vector index for efficient similarity search
- Semantic clustering of documents (
-
RAG Engine:
- Query processing
- Relevant document retrieval
- Context-enhanced generation
-
Agent System:
- Debugger agent for problem-solving (
debugger_agent.py
) - Evaluator agent for quality assessment (
evaluator_agent.py
) - Intent agent for response type detection (
intent_agent.py
) - Concise agent for summarization (
concise_agent.py
)
- Debugger agent for problem-solving (
-
User Interface:
- Streamlit web application (
streamlit_chat_app.py
) - Interactive RAG configuration parameters
- Admin dashboard for system monitoring
- Streamlit web application (
- Python 3.10+
- Machine Learning: scikit-learn, sentence-transformers, FAISS
- LLM APIs: Google Gemini
- Web Framework: Streamlit
- Data Processing: BeautifulSoup, pandas
- Vector Database: FAISS (Facebook AI Similarity Search)
- Database: PostgreSQL (via Neon DB)
- Python 3.10+
- API key for Google Gemini
-
Clone the repository:
git clone https://github.com/yourusername/matbot.git cd matbot
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.env
file in the project root - Add your API key:
GEMINI_API_KEY=your_gemini_api_key
- Create a
Launch the chat interface:
streamlit run Landing.py
- Enter your MATLAB-related troubleshooting query in the chat input
- The system will:
- Retrieve relevant documentation from the knowledge base
- Generate a structured response with problem analysis and solution
- Evaluate the quality of the response
- Use the model parameters sidebar to configure the LLM and RAG parameters before starting the chat
/agents/
: LLM agent implementations/utils/
: Utility functions and wrappers for LLM APIs/corpus/
: Processed knowledge base (generated)/pages/
: Streamlit pages for the applicationstructurify.py
: HTML processing utilitiesclustering.py
: Document clustering implementationLanding.py
: Main entry point and authenticationrequirements.txt
: Project dependencies
- Expanded knowledge base with additional MATLAB documentation
- Integration with MATLAB for direct code analysis
- User feedback-based continuous learning
- Support for more LLM providers
- Enhanced visualization of technical solutions
- Mobile-friendly responsive design
- Fine-tuned domain-specific embeddings
This project was created as part of the HCL Tech CS671 Hackathon.