{"id":31939501,"url":"https://github.com/cyprianfusi/math-problem-solver","last_synced_at":"2026-04-20T10:33:21.162Z","repository":{"id":315283191,"uuid":"1058865805","full_name":"CyprianFusi/math-problem-solver","owner":"CyprianFusi","description":"A Streamlit-based intelligent assistant that combines mathematical problem-solving capabilities with data search functionality, powered by Google's Gemma 2 model via Groq API.","archived":false,"fork":false,"pushed_at":"2025-09-20T05:44:20.000Z","size":1788,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T06:38:41.977Z","etag":null,"topics":["agentic-ai","gemma2","generative-ai","langchain","llm","reasoning","streamlit"],"latest_commit_sha":null,"homepage":"https://binati-ai.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyprianFusi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T16:49:33.000Z","updated_at":"2025-09-20T05:44:23.000Z","dependencies_parsed_at":"2025-09-17T19:39:41.353Z","dependency_job_id":"dc566b18-604b-435c-a0e4-75aa0784d624","html_url":"https://github.com/CyprianFusi/math-problem-solver","commit_stats":null,"previous_names":["cyprianfusi/math-problem-solver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CyprianFusi/math-problem-solver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fmath-problem-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fmath-problem-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fmath-problem-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fmath-problem-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyprianFusi","download_url":"https://codeload.github.com/CyprianFusi/math-problem-solver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyprianFusi%2Fmath-problem-solver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32043071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","gemma2","generative-ai","langchain","llm","reasoning","streamlit"],"created_at":"2025-10-14T08:28:00.139Z","updated_at":"2026-04-20T10:33:21.148Z","avatar_url":"https://github.com/CyprianFusi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/CyprianFusi/math-problem-solver/main/assets/binati_logo.png\" alt=\"BINATI AI Logo\" width=\"75\"/\u003e\u003cstrong\u003e\u003c/strong\u003e\n\n  # Text to Math Problem Solver and Data Search Assistant\n\n  _By **BINATI AInalytics**_\n\u003c/div\u003e\n\n\nA Streamlit-based intelligent assistant that combines mathematical problem-solving capabilities with data search functionality, powered by Google's Gemma 2 model via Groq API.\n\n# Demo\n![MATH Demo](assets/ui_1.png)\n![MATH Demo](assets/ui_2.png)\n![MATH Demo](assets/ui_3.png)\n![MATH Demo](assets/ui_4.png)\n![MATH Demo](assets/ui_5.png)\n\n\n## 🌟 Features\n\n- **Mathematical Problem Solving**: Handles complex math problems with step-by-step reasoning\n- **Wikipedia Integration**: Searches and retrieves information from Wikipedia for context\n- **Logical Reasoning**: Provides detailed explanations with bullet-point breakdowns\n- **Interactive Chat Interface**: User-friendly conversational interface\n- **Real-time Processing**: Live response generation with visual feedback\n\n## 🛠️ Technology Stack\n\n- **Frontend**: Streamlit\n- **LLM**: Google Gemma 2 (9B parameters) via Groq API\n- **Framework**: LangChain for agent orchestration\n- **Tools Integration**:\n  - Wikipedia API for information retrieval\n  - Built-in calculator for mathematical computations\n  - Custom reasoning chain for logical problem-solving\n\n## 📋 Prerequisites\n\n- Python 3.8 or higher\n- Groq API key (get one from [Groq Console](https://console.groq.com/))\n\n## 🚀 Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/CyprianFusi/math-problem-solver.git\n   cd math-problem-solver\n   ```\n\n2. **Install required packages**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Run the application**\n   ```bash\n   streamlit run app.py\n   ```\n\n## 🔧 Configuration\n\n1. Launch the application\n2. Enter your Groq API key in the sidebar\n3. Start asking mathematical questions or requesting data searches\n\n## 💡 Usage Examples\n\n### Mathematical Problems\n```\nQuestion: \"I have 5 bananas and 7 grapes. I eat 2 bananas and give away 3 grapes. Then I buy a dozen apples and 2 packs of blueberries. Each pack of blueberries contains 25 berries. How many total pieces of fruit do I have at the end?\"\n```\n\n### Data Search Queries\n```\nQuestion: \"What is the population of Tokyo and how does it compare to other major cities?\"\n```\n\n### Logical Reasoning\n```\nQuestion: \"If a train travels at 60 mph for 2 hours, then 80 mph for 1.5 hours, what's the average speed for the entire journey?\"\n```\n\n## 🏗️ Architecture\n\nThe application uses a multi-agent architecture with three specialized tools:\n\n1. **Wikipedia Tool**: Searches Wikipedia for factual information\n2. **Calculator Tool**: Performs mathematical calculations using LangChain's LLMMathChain\n3. **Reasoning Tool**: Provides logical step-by-step problem-solving\n\nThese tools are orchestrated by a ZERO_SHOT_REACT_DESCRIPTION agent that determines which tool to use based on the user's query.\n\n## 🎯 Key Components\n\n- **Agent Initialization**: Sets up the multi-tool agent with Wikipedia, calculator, and reasoning capabilities\n- **Session Management**: Maintains conversation history using Streamlit's session state\n- **Real-time Callbacks**: Provides live feedback during response generation\n- **Error Handling**: Robust parsing error management\n\n## 🔒 Security Notes\n\n- API keys are handled securely through Streamlit's sidebar input\n- No API keys are stored permanently in the application\n- Users must provide their own Groq API credentials\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nThis project is open source and available under the [MIT License](https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE).\n\n## 🐛 Troubleshooting\n\n**Common Issues:**\n\n1. **API Key Error**: Ensure you have a valid Groq API key\n2. **Package Installation**: Make sure all dependencies are installed correctly\n3. **Port Issues**: If default port is busy, Streamlit will suggest an alternative\n\n**Error Messages:**\n- \"Please add your Groq API key to continue\" → Enter your API key in the sidebar\n- Package import errors → Run `pip install -r requirements.txt`\n\n## 📞 Support\n\nIf you encounter any issues or have questions, please open an issue in the GitHub repository.\n\n## 🎉 Acknowledgments\n\n- Google for the Gemma 2 model\n- Groq for providing fast inference API\n- LangChain team for the excellent framework\n- Streamlit for the intuitive web app framework\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprianfusi%2Fmath-problem-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyprianfusi%2Fmath-problem-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyprianfusi%2Fmath-problem-solver/lists"}