
cognitive math agent
A math agent-based chrome extension built using cognitive layers framework.
Repository Info
About This Server
A math agent-based chrome extension built using cognitive layers framework.
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Math AI Agent Chrome Extension
A sophisticated Chrome extension that leverages a cognitive AI architecture to solve mathematical problems. The agent uses a layered cognitive approach inspired by human cognitive processes to understand, analyze, and solve mathematical queries.
Features
-
Cognitive Architecture: Implements a multi-layer cognitive system:
- Perception Layer: Analyzes and structures user input
- Memory Layer: Maintains context and conversation history
- Decision Layer: Determines next actions based on current state
- Action Layer: Executes decided actions and generates responses
-
Chrome Extension Integration: Easy-to-use browser interface for quick access to the math solving capabilities
-
Asynchronous Processing: Built with async/await for efficient request handling
-
Robust Error Handling: Graceful fallbacks and error management throughout the system
Architecture
The system is built with a modular architecture consisting of:
-
Core Cognitive Components:
main.py: Orchestrates the cognitive workflowperception.py: Handles input analysismemory.py: Manages conversation statedecision.py: Implements decision-making logicaction.py: Executes actions based on decisions
-
Support Systems:
llm.py: Language model integrationmodels.py: Data models and structureshelpers.py: Utility functionsprompts.py: System prompts and templates
-
API Layer:
fastapi_server.py: REST API endpointsmcp_server.py: Message control protocol server
Installation
- Clone the repository:
git clone [repository-url]
- Install dependencies:
uv sync
-
Set up environment variables: Create a
.envfile with necessary configurations -
Install the Chrome Extension:
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
extensiondirectory
- Open Chrome and navigate to
Usage
- Click the Math Agent icon in your Chrome browser
- Enter your mathematical query in the popup window
- The agent will process your query through its cognitive layers
- View the solution and explanation in the response
Technical Requirements
- Python 3.11+
- Chrome Browser
- Required Python packages (specified in uv.lock)
- Local server running on port 8000 for API communication
Development
To run the development server:
python main.py
The extension communicates with a local FastAPI server that needs to be running:
uvicorn fastapi_server:app --reload
Architecture Diagram
User Query (Chrome Extension)
↓
Perception Layer
↓
Memory Layer
↓
Decision Layer
↓
Action Layer
↓
Response
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License
Quick Start
Clone the repository
git clone https://github.com/aviban15/cognitive-math-agentInstall dependencies
cd cognitive-math-agent
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.