An elegant, AI-powered mathematics assistant that makes problem-solving a breeze.
Features • Demo • Installation • Usage • Architecture • Contributing • License
MathSolveX is an intelligent, AI-powered mathematical problem-solving assistant built with Streamlit and LangChain. Designed for students, educators, and math enthusiasts, it provides detailed, step-by-step solutions to a wide range of mathematical problems - from basic arithmetic to complex calculus and beyond.
With its intuitive chat interface and sophisticated reasoning capabilities, MathSolveX brings the power of advanced AI to mathematical problem-solving, making it accessible to everyone.
-
🧠 Intelligent Problem Solving
- Handles arithmetic, algebra, calculus, statistics, and more
- Provides step-by-step explanations with clear reasoning
- Solves complex multi-step problems with precision
-
🔍 Multiple Solving Approaches
- Calculator tool for direct computations
- Advanced reasoning tool for complex problem-solving
- Wikipedia integration for context and background information
-
💎 Elegant User Experience
- Clean, dark-themed UI with professional styling
- Intuitive chat-based interaction model
- Interactive input with real-time responses
- Responsive design with hover and focus effects
-
🔧 Technical Excellence
- Powered by Groq's Gemma2-9b-It model for fast, accurate responses
- Modular architecture for maintainability and extensibility
- Error handling for complex mathematical expressions
- Secure API key management
- Python 3.8+
- Groq API key (Get one here)
- Dependencies listed in
requirements.txt
# Clone the repository
git clone https://github.com/cyclostone/MathSolveX.git
cd MathSolveX
# Create and activate a virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt-
Clone the repository
git clone https://github.com/cyclostone/MathSolveX.git cd MathSolveX -
Set up environment
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
-
Install dependencies
pip install streamlit langchain langchain-groq python-dotenv wikipedia numexpr
-
Configure API keys Create a
.envfile in the project root:GROQ_API_KEY=your_groq_api_key_here
-
Start the application
streamlit run app.py
-
Enter your Groq API key when prompted (or it will be loaded from your
.envfile) -
Start solving problems!
- Type your mathematical problem in the chat input
- Get detailed, step-by-step solutions instantly
- Follow the reasoning process to understand the solution
MathSolveX can solve a wide variety of math problems, including:
- Basic Math: "Calculate the area of a circle with radius 5 cm"
- Algebra: "Solve for x: 2x + 5 = 17"
- Calculus: "Find the derivative of f(x) = x³ + 2x² - 5x + 3"
- Statistics: "What is the standard deviation of [4, 7, 9, 3, 8, 5]?"
- Word Problems: "If a train travels 120 miles in 2 hours, what is its speed in mph?"
- Financial Math: "Calculate the compound interest on $1000 at 5% annual rate for 3 years"
MathSolveX is built with a modular architecture designed for maintainability and extensibility:
MathSolveX/
├── app.py # Application entry point
├── requirements.txt # Project dependencies
├── .env # Environment variables (API keys)
├── src/
│ ├── __init__.py
│ ├── main.py # Main application logic
│ ├── components/
│ │ ├── __init__.py
│ │ └── ui.py # UI components and interactions
│ └── utils/
│ ├── __init__.py
│ ├── styling.py # Custom styling for Streamlit
│ └── tools.py # LangChain tools and agent setup
- LLM Integration: Leverages Groq's Gemma2-9b-It model via the LangChain framework
- Tool System: Features specialized tools for mathematical calculations, reasoning, and information lookup
- UI Framework: Built on Streamlit for rapid development and elegant interfaces
- Custom Styling: Implements a dark-themed, professional UI with responsive design elements
- Streamlit: For the interactive web interface
- LangChain: For LLM orchestration and tools
- Groq API: For fast, powerful language model inference
- Wikipedia API: For context and information lookup
- Python: Core programming language
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Please ensure your code follows our coding standards and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.
- ExamProCo: For the GenAI Course that inspired this project
- Groq: For providing the lightning-fast inference API
- LangChain: For the powerful LLM framework
- Streamlit: For the elegant UI framework
💖 Made with love by Your Name
⭐ Star this repository if you found it useful!
