TaskMind is a sophisticated AI agent that treats user prompts as tasks to be executed. It provides structured reasoning, supports multiple AI providers (OpenAI, Grok, Copilot), and includes cost tracking and performance monitoring. The project includes both a robust backend API and a professional frontend dashboard.
- Multi-Provider Support: Seamlessly switch between OpenAI, Grok (xAI), and GitHub Copilot
- Structured Reasoning: Three-step reasoning process (Analysis β Planning β Execution)
- Cost Tracking: Real-time cost estimation and monitoring
- Clean Architecture: Built with SOLID principles and design patterns
- RESTful API: Easy integration with any application
- Comprehensive Logging: Detailed execution logs and performance metrics
- Type Safety: Full TypeScript support with strict typing
- Professional UI/UX: Clean, responsive design with configurable themes
- Real-time Task Management: Submit, monitor, and review AI agent tasks
- Structured Reasoning Display: View the complete reasoning process with step-by-step breakdown
- Provider Configuration: Switch between AI providers and models
- Task History: Detailed execution history with cost tracking
- Mobile Responsive: Optimized for desktop, tablet, and mobile devices
TaskMind follows clean architecture principles with:
- Strategy Pattern: For cost calculation and provider selection
- Template Method Pattern: For the reasoning process
- Dependency Inversion: Provider-agnostic design
- Single Responsibility: Each class has one clear purpose
- Open/Closed Principle: Easy to extend with new providers
The frontend follows modern React patterns with:
- Component-Based Design: Reusable, modular components
- Type Safety: Comprehensive TypeScript interfaces
- State Management: React hooks for local state management
- API Abstraction: Clean service layer for backend communication
- Responsive Design: Mobile-first approach with Tailwind CSS
- Error Handling: Comprehensive error states and user feedback
- Node.js 18+
- npm or yarn
- API keys for your chosen providers
- Clone the repository:
git clone <repository-url>
cd TaskMind- Install dependencies:
npm install- Set up environment variables:
cp env.example .env- Configure your API keys in
.env:
# OpenAI (Required for default setup)
OPENAI_API_KEY=your_openai_api_key_here
# Grok (Optional)
GROK_API_KEY=your_grok_api_key_here
# Copilot (Optional)
COPILOT_API_KEY=your_copilot_api_key_here- Start the backend server:
npm run devThe backend will be available at http://localhost:3000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the frontend development server:
npm run devThe dashboard will be available at http://localhost:3001
- Start both services:
# Terminal 1 - Backend
npm run dev
# Terminal 2 - Frontend
cd frontend
npm run dev-
Open the dashboard: Navigate to http://localhost:3001
-
Submit your first task: Use the form to submit a prompt and see the AI agent in action
# Test OpenAI
curl -X POST http://localhost:3000/agent/task \
-H "Content-Type: application/json" \
-d '{
"prompt": "Explain quantum computing in simple terms",
"provider": "openai",
"model": "gpt-4o-mini"
}'Send provider, model, and prompt in one request:
# OpenAI
curl -X POST http://localhost:3000/agent/task \
-H "Content-Type: application/json" \
-d '{
"prompt": "Explain quantum computing in simple terms",
"provider": "openai",
"model": "gpt-4o-mini"
}'
# Grok
curl -X POST http://localhost:3000/agent/task \
-H "Content-Type: application/json" \
-d '{
"prompt": "What are the benefits of renewable energy?",
"provider": "grok",
"model": "grok-4-latest"
}'
# Copilot
curl -X POST http://localhost:3000/agent/task \
-H "Content-Type: application/json" \
-d '{
"prompt": "How does machine learning work?",
"provider": "copilot",
"model": "copilot-chat"
}'curl -X POST http://localhost:3000/agent/provider \
-H "Content-Type: application/json" \
-d '{
"provider": "grok",
"model": "grok-4-latest"
}'curl http://localhost:3000/agent/configcurl http://localhost:3000/agent/history- Submit Tasks: Easy-to-use form with provider and model selection
- Real-time Processing: Live status updates during task execution
- Task History: Complete history with detailed reasoning steps
- Cost Tracking: Real-time cost estimation and monitoring
- Multi-Provider Support: Switch between OpenAI, Grok, and Copilot
- Model Selection: Choose from available models for each provider
- Status Monitoring: Real-time provider availability status
- Configuration Management: Update settings without restart
- Responsive Design: Works on desktop, tablet, and mobile
- Professional UI: Clean, modern interface with configurable themes
- Error Handling: User-friendly error messages and recovery options
- Loading States: Smooth loading indicators for all operations
| Variable | Description | Default |
|---|---|---|
DEFAULT_PROVIDER |
Default AI provider | openai |
DEFAULT_MODEL |
Default model | gpt-4o-mini |
PORT |
Backend server port | 3000 |
LOG_LEVEL |
Logging level | info |
NEXT_PUBLIC_API_URL |
Frontend API URL | http://localhost:3000 |
OPENAI_API_KEY=your_key
OPENAI_MODEL=gpt-4o-mini
OPENAI_MAX_TOKENS=4000
OPENAI_TEMPERATURE=0.7GROK_API_KEY=your_key
GROK_MODEL=grok-4-latest
GROK_MAX_TOKENS=4000
GROK_TEMPERATURE=0.7
GROK_BASE_URL=https://api.x.ai/v1COPILOT_API_KEY=your_key
COPILOT_MODEL=copilot-chat
COPILOT_MAX_TOKENS=4000
COPILOT_TEMPERATURE=0.7
COPILOT_BASE_URL=https://api.github.com/copilot/v1
COPILOT_ORGANIZATION=your_org
COPILOT_PROJECT=your_projectTaskMind automatically tracks costs for all API calls:
{
"costEstimate": {
"inputTokens": 150,
"outputTokens": 300,
"estimatedCost": 0.000045,
"currency": "USD",
"provider": "openai",
"model": "gpt-4o-mini"
}
}- Application logs: Console output
- Agent logs:
logs/.agent-log(JSONL format) - Performance metrics: Response times, token usage, costs
curl http://localhost:3000/healthTaskMind/
βββ src/ # Backend source code
β βββ agent.ts # Core agent logic
β βββ server.ts # Express server
β βββ providers/ # AI provider implementations
β βββ strategies/ # Design pattern implementations
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
βββ frontend/ # Frontend dashboard
β βββ src/
β β βββ app/ # Next.js app directory
β β βββ components/ # React components
β β βββ lib/ # Utility functions
β β βββ services/ # API services
β β βββ types/ # TypeScript types
β βββ package.json
βββ logs/ # Application logs
βββ docs/ # Documentation
βββ tests/ # Test files
# Test OpenAI integration
npm run test-example
# Test Grok integration
npm run test-grok
# Test single request functionality
npm run test-singleThe frontend includes comprehensive error handling and user feedback:
- Connection Status: Real-time backend connectivity monitoring
- Error States: User-friendly error messages and recovery options
- Loading States: Smooth loading indicators for all async operations
- Form Validation: Client-side validation with helpful error messages
- MongoDB Integration
- Set up MongoDB connection with Mongoose
- Create data models for TaskExecution, User, Session
- Implement persistent storage for task history
- Add data migration scripts
- Implement backup and restore functionality
- Add data indexing for performance optimization
-
Expert Agent Framework
- Create specialized agent types (Code Expert, Math Expert, etc.)
- Implement agent selection based on task type
- Add agent-specific prompts and reasoning strategies
- Create agent marketplace/registry system
- Implement agent chaining and collaboration
- Add agent performance metrics and ratings
-
Advanced Reasoning
- Implement multi-step reasoning chains
- Add context memory and conversation history
- Create tool integration system (web search, file operations)
- Implement knowledge base integration
- Add reasoning visualization and explanation
-
Docker Containerization
- Create Dockerfile for backend
- Create Dockerfile for frontend
- Set up docker-compose for full stack
- Add MongoDB container configuration
- Implement health checks and monitoring
- Create production-ready Docker images
-
Deployment & CI/CD
- Set up GitHub Actions for automated testing
- Create deployment scripts for cloud platforms
- Implement environment-specific configurations
- Add monitoring and logging infrastructure
- Set up SSL/TLS certificates
-
User Management
- Implement user authentication and authorization
- Add user profiles and preferences
- Create team collaboration features
- Implement usage quotas and billing
-
Advanced Analytics
- Create detailed usage analytics dashboard
- Implement cost optimization recommendations
- Add performance benchmarking tools
- Create custom reporting features
-
API Enhancements
- Add GraphQL support
- Implement WebSocket for real-time updates
- Create API rate limiting and throttling
- Add API versioning and documentation
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Clone your fork
git clone https://github.com/your-username/TaskMind.git cd TaskMind - Install dependencies
# Backend npm install # Frontend cd frontend npm install
- Set up environment
cp env.example .env # Add your API keys to .env - Start development servers
# Terminal 1 - Backend npm run dev # Terminal 2 - Frontend cd frontend npm run dev
- Create a feature branch
git checkout -b feature/your-feature-name
- Submit a pull request
- Follow our Code Style Guide
- Write tests for new features
- Update documentation
- Use conventional commit messages
- Ensure all tests pass before submitting
- π Documentation
- π Report a Bug
- π‘ Request a Feature
- π¬ Start a Discussion
This project is licensed under the MIT License - see the LICENSE file for details.
This project demonstrates professional software engineering practices, with focus on clean architecture, modern technologies, and developer-friendly tooling β reinforcing my personal brand as a software engineer.
- Full-Stack Development: Complete backend API and frontend dashboard
- Clean Architecture: Well-structured, maintainable codebase
- Modern Technologies: Latest React, Next.js, TypeScript, and Node.js
- Professional UI/UX: Polished, responsive design
- Developer Experience: Excellent tooling and documentation
- Scalability: Modular design for easy extension
- Best Practices: Type safety, error handling, and testing
Ali Salem - admin@alisalem.me
This project demonstrates professional software engineering practices, with focus on clean architecture, modern technologies, and developer-friendly tooling β reinforcing my personal brand as a software engineer.
- OpenAI for GPT models
- xAI for Grok models
- GitHub for Copilot
- Contributors who help improve TaskMind
Built with β€οΈ using TypeScript, Node.js, React, Next.js, and modern design patterns