Skip to content

Repository files navigation

Sabi - AI-Powered Learning Companion

Sabi is an intelligent desktop application that transforms how you learn by providing personalized, multimodal AI assistance directly integrated into your workflow. Built with Electron and TypeScript, Sabi combines advanced AI processing, browser automation, and adaptive learning to create a seamless educational experience that guides you from initial concepts to production-ready implementations.

🌟 Overview

Sabi is designed to be your personal learning assistant that understands your goals, adapts to your learning style, and provides contextual guidance across multiple input modalities. Whether you're learning to code, exploring new technologies, or working on complex projects, Sabi provides intelligent support tailored to your needs without requiring you to write code.

Key Features

  • πŸ€– Multimodal AI Processing: Support for text, voice, and image inputs with intelligent intent analysis
  • 🎯 Adaptive Learning Paths: Personalized learning experiences that adapt to your skill level and progress
  • 🌐 Browser Automation: Seamless integration with web-based AI building tools using Playwright and browser-use
  • πŸ“Š Progress Analytics: Comprehensive tracking and visualization of your learning journey
  • πŸ”„ Real-time Feedback: Instant guidance and corrections as you work
  • πŸ“š Documentation Management: Intelligent organization and retrieval of learning materials
  • 🎨 Modern UI: Clean, intuitive interface with overlay capabilities and contextual guidance
  • ⚑ Performance Monitoring: Built-in caching, metrics collection, and auto-updater system

πŸ—οΈ Architecture

Core Components

Main Application (Electron)

  • Learning Orchestrator: Central coordination of all learning activities with event-driven architecture
  • Multimodal Processor: Handles text, speech, and image inputs with AI analysis
  • Browser Controller: Automated web interaction using Playwright for seamless tool navigation
  • Session Manager: Manages learning sessions with progress tracking and state persistence
  • Analytics Engine: Comprehensive learning analytics and performance insights

AI Processing Pipeline

  • Intent Analyzer: Understands user goals and learning objectives from natural language
  • Learning Path Generator: Creates personalized learning sequences based on objectives and skill level
  • Adaptive Instructor: Provides contextual guidance and adapts teaching style based on progress
  • Speech Processor: Voice input processing with speech-to-text conversion
  • Image Processor: Visual content analysis and understanding for multimodal learning

Browser Integration

  • Tool Navigator: Intelligent navigation of web-based AI building tools (Builder.io, Firebase Studio, Lovable, Bolt.new, Replit)
  • Action Recorder: Records and explains user interactions for learning reinforcement
  • Action Explainer: Provides real-time context and explanations for automated actions
  • Error Recovery: Graceful handling of browser automation failures with alternative approaches

Companion Projects

Web Interface (sabi-web/)

  • Next.js-based web interface for remote access and mobile learning
  • Real-time synchronization with desktop application
  • Responsive design with Tailwind CSS for learning on-the-go

Backend API (sabi-backend/)

  • Express.js server for data synchronization and cloud features
  • RESTful API for cross-platform integration
  • User session management and progress synchronization

Browser Extension (sabi-extension/)

  • Chrome extension for enhanced web integration
  • Context-aware assistance while browsing learning resources
  • Seamless data collection and analysis integration

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Git
  • Python (3.8+ for native dependencies)
  • Build tools for your platform (see INSTALLATION.md for details)

Quick Installation

  1. Download Pre-built Installer (Recommended)

    • Visit the releases page
    • Download the installer for your platform (Windows, macOS, or Linux)
    • Run the installer and follow the setup wizard
  2. Build from Source

    git clone https://github.com/jsodeh/Sabi-master.git
    cd Sabi-master
    npm install
    npm run build
    npm start

Development Setup

  1. Install development dependencies

    npm install --dev
  2. Run in development mode

    npm run dev
  3. Run tests

    npm test

Building for Production

Build for all platforms:

npm run dist

Platform-specific builds:

npm run dist:mac    # macOS
npm run dist:win    # Windows
npm run dist:linux  # Linux

🎯 Usage

First Launch

  1. Initialize Learning Profile: Set up your learning preferences and skill levels
  2. Configure AI Services: Connect your preferred AI providers (OpenAI, Google Cloud, Anthropic)
  3. Browser Integration: Allow Sabi to integrate with your web browsers for automation
  4. Tool Connections: Connect to AI building tools (Builder.io, Firebase Studio, Lovable, Bolt.new, Replit)
  5. Start Learning: Begin with a simple objective to explore Sabi's capabilities

Core Workflows

Text-Based Learning

// Example: Learning web development
"I want to learn React hooks and build a todo app"

Voice Input

// Activate voice mode and speak your learning objective
"Help me understand async/await in JavaScript"

Visual Learning

// Upload screenshots or images for analysis
// Sabi will analyze UI elements and provide guidance

Advanced Features

Custom Learning Paths

  • Create personalized learning sequences with adaptive difficulty
  • Set skill level targets and learning milestones
  • Track progress across multiple topics and technologies

Browser Automation

  • Automated setup of development environments
  • Guided tutorials with real-time interaction and explanation
  • Code deployment and testing workflows with step-by-step guidance

Analytics Dashboard

  • Learning velocity and progress metrics with visual charts
  • Skill development visualization and competency tracking
  • Personalized recommendations based on learning patterns

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory:

# AI Service Configuration
OPENAI_API_KEY=your_openai_key
GOOGLE_CLOUD_KEY=your_google_cloud_key
ANTHROPIC_API_KEY=your_anthropic_key

# Application Settings
ENVIRONMENT=development
LOG_LEVEL=info
AUTO_UPDATE=true

# Browser Automation
HEADLESS_BROWSER=false
BROWSER_TIMEOUT=30000

# Performance Settings
CACHE_SIZE_MB=512
MAX_CONCURRENT_SESSIONS=3

User Preferences

Sabi stores user preferences and learning data in:

  • macOS: ~/Library/Application Support/Sabi/
  • Windows: %APPDATA%/Sabi/
  • Linux: ~/.config/Sabi/

πŸ§ͺ Testing

Test Suite Structure

src/
β”œβ”€β”€ __tests__/
β”‚   β”œβ”€β”€ integration/     # Integration tests
β”‚   └── e2e/            # End-to-end tests
β”œβ”€β”€ ai/__tests__/       # AI component tests
β”œβ”€β”€ browser/__tests__/  # Browser automation tests
└── core/__tests__/     # Core system tests

Running Tests

# Run all tests
npm test

# Run specific test suites
npm run test:unit
npm run test:integration
npm run test:e2e

# Run tests with coverage
npm run test:coverage

πŸ“ Project Structure

Sabi-master/
β”œβ”€β”€ src/                     # Main application source
β”‚   β”œβ”€β”€ main.ts             # Electron main process entry point
β”‚   β”œβ”€β”€ core/               # Core system components
β”‚   β”‚   β”œβ”€β”€ LearningOrchestrator.ts    # Central learning coordinator
β”‚   β”‚   β”œβ”€β”€ LearningSessionManager.ts  # Session management
β”‚   β”‚   β”œβ”€β”€ WindowManager.ts           # Window and overlay management
β”‚   β”‚   β”œβ”€β”€ PerformanceMonitor.ts      # Performance monitoring
β”‚   β”‚   β”œβ”€β”€ CacheManager.ts            # Caching system
β”‚   β”‚   β”œβ”€β”€ AutoUpdater.ts             # Auto-update functionality
β”‚   β”‚   └── preload.ts                 # Secure IPC bridge
β”‚   β”œβ”€β”€ ai/                 # AI processing components
β”‚   β”‚   β”œβ”€β”€ MultimodalProcessor.ts     # Text, voice, image processing
β”‚   β”‚   β”œβ”€β”€ IntentAnalyzer.ts          # Learning intent analysis
β”‚   β”‚   β”œβ”€β”€ LearningPathGenerator.ts   # Adaptive path creation
β”‚   β”‚   β”œβ”€β”€ AdaptiveInstructor.ts      # Personalized instruction
β”‚   β”‚   └── processors/               # Specialized processors
β”‚   β”œβ”€β”€ browser/            # Browser automation
β”‚   β”‚   β”œβ”€β”€ BrowserController.ts       # Playwright integration
β”‚   β”‚   β”œβ”€β”€ ToolNavigator.ts          # AI tool navigation
β”‚   β”‚   β”œβ”€β”€ ActionRecorder.ts         # Action recording
β”‚   β”‚   └── ActionExplainer.ts        # Real-time explanations
β”‚   β”œβ”€β”€ renderer/           # Frontend UI components
β”‚   β”‚   β”œβ”€β”€ index.html               # Main UI
β”‚   β”‚   β”œβ”€β”€ main.js                  # Renderer process logic
β”‚   β”‚   └── components/              # UI components
β”‚   β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ learning.ts              # Learning system types
β”‚   β”‚   β”œβ”€β”€ ai.ts                    # AI processing types
β”‚   β”‚   β”œβ”€β”€ browser.ts               # Browser automation types
β”‚   β”‚   └── documentation.ts         # Documentation types
β”‚   └── utils/              # Utility functions
β”œβ”€β”€ sabi-web/               # Next.js web interface
β”œβ”€β”€ sabi-backend/           # Express.js backend API
β”œβ”€β”€ sabi-extension/         # Chrome browser extension
β”œβ”€β”€ assets/                 # Application assets and icons
β”œβ”€β”€ dist/                   # Compiled output
└── INSTALLATION.md         # Detailed installation guide

πŸ”Œ API Reference

Core APIs

Learning Orchestrator

interface LearningRequest {
  id: string;
  userId: string;
  objective: string;
  inputType: 'text' | 'voice' | 'image';
  context?: LearningContext;
}

interface LearningResponse {
  sessionId: string;
  learningPath: LearningStep[];
  estimatedDuration: number;
  recommendations: string[];
}

Multimodal Processing

interface ProcessedInput {
  processedText: string;
  intent: LearningIntent;
  confidence: number;
  suggestions: string[];
}

Browser Automation

interface BrowserAction {
  type: 'click' | 'type' | 'navigate' | 'scroll' | 'highlight';
  target: ElementSelector;
  value?: string;
  explanation: string;
  reasoning: string;
  expectedResult: string;
}

IPC Communication

Sabi uses Electron's IPC for secure communication between processes:

// Renderer to Main
window.sabiAPI.learning.startSession(request)
window.sabiAPI.learning.pauseSession(sessionId)
window.sabiAPI.learning.resumeSession(sessionId)
window.sabiAPI.learning.stopSession(sessionId)
window.sabiAPI.learning.submitInput(input)
window.sabiAPI.learning.getSessionStatus(sessionId)

// Main to Renderer (events)
window.sabiAPI.learning.onSessionUpdate(callback)
window.sabiAPI.learning.onStepComplete(callback)
window.sabiAPI.performance.onMetricsUpdate(callback)
window.sabiAPI.updater.onUpdateAvailable(callback)

🀝 Contributing

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
    npm test
  6. Commit your changes
    git commit -m "Add amazing feature"
  7. Push to your branch
    git push origin feature/amazing-feature
  8. Open a Pull Request

Code Style

  • TypeScript: Strict mode enabled with comprehensive type definitions
  • ESLint: Configured for TypeScript and Electron best practices
  • Prettier: Automatic code formatting
  • Conventional Commits: Use conventional commit messages

Testing Guidelines

  • Write unit tests for all new functions and classes
  • Add integration tests for new features and workflows
  • Ensure E2E tests cover critical user workflows
  • Maintain test coverage above 80%

πŸ› Troubleshooting

Common Issues

App Stuck on Initialization Screen

# Check console for errors
# Open Developer Tools: Cmd+Alt+I (Mac) or F12
# Look for JavaScript errors in Console tab

Browser Automation Not Working

# Ensure Playwright browsers are installed
npx playwright install

# Check browser permissions
# Verify system accessibility permissions (macOS)

AI Services Not Responding

# Verify API keys in .env file
# Check network connectivity
# Review rate limiting and quotas

Debug Mode

Enable debug logging:

DEBUG=sabi:* npm start

Log Files

Application logs are stored in:

  • macOS: ~/Library/Logs/Sabi/
  • Windows: %USERPROFILE%/AppData/Roaming/Sabi/logs/
  • Linux: ~/.config/Sabi/logs/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Electron Team - For the excellent desktop application framework
  • Playwright Team - For robust browser automation capabilities
  • OpenAI - For advanced language model APIs
  • Google Cloud - For speech and vision processing services
  • Anthropic - For Claude AI integration
  • TypeScript Team - For type-safe JavaScript development

πŸ“ž Support

πŸ—ΊοΈ Roadmap

Current Status (v1.0)

  • βœ… Core Electron application with TypeScript
  • βœ… Multimodal AI processing (text, voice, image)
  • βœ… Browser automation with Playwright integration
  • βœ… Learning session management and orchestration
  • βœ… Real-time progress tracking and analytics
  • βœ… Performance monitoring and caching
  • βœ… Auto-updater system
  • βœ… Comprehensive IPC integration

Version 1.1 (Q2 2024)

  • Enhanced voice processing with multiple language support
  • Advanced analytics dashboard with ML insights
  • Plugin system for third-party integrations
  • Mobile companion app

Version 1.2 (Q3 2024)

  • Collaborative learning features
  • Advanced project templates
  • Integration with popular IDEs
  • Cloud synchronization

Version 2.0 (Q4 2024)

  • Multi-user support
  • Enterprise features
  • Advanced AI model fine-tuning
  • Comprehensive API for developers

Built with ❀️ by the Sabi Team

Empowering learners through intelligent, adaptive technology.

About

A multimodal AI-powered desktop companion designed to orchestrate your workspace, automate browser workflows, and build personalized, adaptive learning paths.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages