π English Version | π§π· VersΓ£o em PortuguΓͺs
ExplicaAI is an offline mathematics education application specifically designed for Brazilian public schools, built to operate completely offline using Google's Gemma 3n model. The system provides step-by-step problem solving, collection management for study organization, and advanced pedagogical features.
Many Brazilian public schools have computer labs with limited or unstable internet connectivity. Mathematics teachers need digital tools that function offline while providing educational explanations to support the teaching-learning process.
An offline-first web application was developed that runs locally, utilizing the Gemma 3n model via Ollama to provide:
- Step-by-step mathematical problem resolution
- Collection system for organizing content by topics
- Complete offline functionality
- Intuitive interface suitable for school environments
- History of solved problems
- Generation of similar exercises for practice
- Framework: Express.js
- Database: SQLite (for offline portability)
- AI Integration: Ollama API with Gemma 3n
- Structure: RESTful API with specialized endpoints
- Framework: React 18 with Hooks
- Styling: Tailwind CSS
- Animations: Framer Motion
- Build: Integrated within backend structure
- Model: Google Gemma 3n (gemma3n:e4b)
- Runtime: Local Ollama
- Configuration: Optimized for mathematical problem solving
- Automatic complexity detection (simple, medium, complex)
- Specialized prompts for each difficulty level
- Validation and automatic retry to ensure consistent formatting
- Detailed pedagogical explanations
- Automatic organization by mathematical categories
- Custom collections for different topics
- Favorites system for important problems
- Intelligent categorization based on content analysis
- Design adapted for school environments
- Interactive mascot representing Gemma 3n
- Customizable visual themes (static and animated gradient)
- Visual feedback during processing
For detailed step-by-step installation instructions, including troubleshooting and school environment configuration, see:
π install_guide.md - Complete Installation Guide
# Clone repository
git clone [REPOSITORY_URL]
cd explicaai
# Install dependencies
npm install
# Initialize database
npm run init-db
# Start Ollama service (separate terminal)
ollama serve
# Start backend (terminal 2)
npm start
# Start frontend (terminal 3)
cd front
npm run dev
ExplicaAI follows a monorepo structure: explicaai/ βββ server.js # Backend entry point βββ package.json # Backend dependencies βββ routes/ # API routes βββ services/ # Backend services βββ front/ # Frontend application β βββ package.json # Frontend dependencies β βββ src/ # React components β βββ public/ # Static assets βββ database/ # SQLite database
Running the application requires three terminals:
- Ollama Service:
ollama serve
- Backend API:
npm start
(root folder) - Frontend:
npm run dev
(front folder)
- Node.js (version 16 or higher)
- Ollama installed and configured
- Gemma 3n model downloaded via Ollama
- Access
http://localhost:3000
- Verify the application detects Ollama online
- Test with simple problem: "2 + 2"
- Lesson Preparation: Create thematic collections with specific problems
- Demonstration: Use the system to explain concepts in real-time
- Exercises: Generate similar problems for student practice
- Guided Resolution: Input problems and follow step-by-step solutions
- Directed Study: Access collections organized by topic
- Practice: Request generation of similar exercises
- Review: Consult history of solved problems
A system was implemented that analyzes mathematical problems and determines the resolution approach:
- Simple Problems: Basic operations solved in 1-2 direct steps
- Medium Problems: Equations and calculations requiring 3-6 steps
- Complex Problems: Advanced concepts with 5-10 detailed steps
Quality mechanism implementation that:
- Validates structured response format
- Executes automatic retry with stricter prompts
- Provides fallback in case of persistent failures
The application was specifically optimized for the Gemma 3n model:
- Prompts adjusted for model characteristics
- Temperature parameters configured for mathematics
- Specific handling of multimodal responses
explicaai/
βββ server.js # Main server
βββ routes/ # API endpoints
β βββ problems.js # Problem resolution
β βββ collections.js # Collection management
β βββ status.js # System status
βββ services/ # Core services
β βββ ollamaService.js # Ollama/Gemma integration
β βββ categorizationService.js # Automatic categorization
βββ models/ # Data models
β βββ Problem.js # Problem model
β βββ Collection.js # Collection model
βββ utils/ # Utilities
β βββ mathParser.js # Mathematical response parser
β βββ helpers.js # Helper functions
βββ front/ # React frontend
β βββ src/components/ # React components
β βββ src/service/ # Frontend services
β βββ public/ # Static resources
βββ database/ # Database files
βββ explicaai.db # SQLite database
- Processor: Intel i3 or AMD equivalent
- RAM: 8GB
- Storage: 5GB free space
- OS: Windows 10/11, macOS 10.15+, Ubuntu 20.04+
- Processor: Intel i5 or AMD Ryzen 5
- RAM: 16GB
- GPU: Optional (improves Gemma 3n speed)
- Democratization: Access to educational AI without internet dependency
- Pedagogy: Step-by-step explanations improve comprehension
- Autonomy: Students can practice independently
- Inclusion: Works in schools with limited infrastructure
- Mathematics laboratories in public schools
- Reinforcement and tutoring classes
- Home study without internet
- Assessment preparation
- OCR Integration: Problem solving via image recognition
- Voice Synthesis: Audio explanations
- Accessibility: Brazilian Sign Language (LIBRAS) support
- Authentication: Individual user system
- Portability: Collection import/export
- Backend: Node.js, Express, SQLite
- Frontend: React, Tailwind CSS, Framer Motion
- AI: Ollama, Google Gemma 3n
- Build Tools: Webpack, Babel
- Testing: Jest (planned)
This project was developed for the Google Gemma 3n Impact Challenge with focus on educational and social impact. The code is available under a license that permits educational use and modification for similar purposes.
For technical questions, consult the repository documentation or contact through official project channels.
Developed with focus on Brazilian public education and utilizing Google Gemma 3n to democratize access to educational artificial intelligence.