An AI-powered intelligent control layer for Raspberry Pi OS
EdgeMind Agent is an AI system that operates as an intelligent control layer on top of Raspberry Pi OS:
- Not part of the OS - Runs as a separate service
- No direct privileges - All commands go through security gateway
- Analysis & Planning Brain - Thinks before acting
Real System = Raspberry Pi OS
Intelligence = Gemini API
Execution = Security Gateway (Safe)
"AI doesn't execute β AI decides"
The AI analyzes, plans, and recommends. A security gateway validates and executes only whitelisted commands.
edgemind-agent/
βββ src/
β βββ core/
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Main AI agent brain
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # System context collector
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Decision processor
β βββ gateway/
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Security validation layer
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Allowed commands manager
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Safe command executor
β βββ api/
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Gemini API client
β βββ interface/
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Command-line interface
β β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Web dashboard
β βββ utils/
β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Logging system
β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Input validation
βββ config/
β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # System configuration
β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Whitelisted commands
β βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip # Gemini system prompt
βββ logs/ # System logs
βββ tests/ # Unit tests
βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip
βββ https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip
# Clone the repository
git clone https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip
cd edgemind-agent
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip
# Set up API key
export GEMINI_API_KEY="your-api-key"
# Run the system
python https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip# Use the installation script
chmod +x https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip
https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip
# Install as a systemd service (optional)
sudo https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zippython https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zippython https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip --web
# Access at http://localhost:8080python https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip --analyze "Check memory usage"
python https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip --analyze "Why is SSH not working?" --executepython https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip --statusUser Request
β
EdgeMind Interface (CLI / Web)
β
Context Builder (Logs / Errors / System State)
β
Gemini API (AI Brain)
β
Decision Output (Structured JSON)
β
Security Gateway (Validation)
β
Raspberry Pi OS (Execution)
| Component | Role |
|---|---|
| Gemini API | Understands, Analyzes, Plans, Rejects dangerous requests |
| Security Gateway | Validates against whitelist, Blocks dangerous commands |
| Raspberry Pi OS | Only receives pre-approved commands |
| Level | Description | Action |
|---|---|---|
| π’ Low | Read-only commands | Auto-execute |
| π‘ Medium | Service control, package management | Requires confirmation |
| π΄ High | System modifications | Blocked automatically |
rm -rf /and destructive patternsmkfs,dddisk operationsshutdown,reboot,halt- Firewall/routing modifications
- Fork bombs and malicious patterns
- β System Diagnostics - Memory, CPU, disk, temperature
- β Network Analysis - Interfaces, ports, connectivity
- β Service Health - Status, logs, restart recommendations
- β File Inspection - Safe read-only file operations
- β Automation Planning - Multi-step task planning
- β Advisory DevOps - Best practice recommendations
| Variable | Description | Required |
|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | Yes |
HOST |
Web server host | No (default: 0.0.0.0) |
PORT |
Web server port | No (default: 8080) |
https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip- General settings, security optionshttps://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip- Allowed commands and risk levelshttps://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip- AI behavior instructions
# Run all tests
pytest tests/ -v
# Run specific test file
pytest https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip -v
# Run with coverage
pytest tests/ --cov=src| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Web dashboard |
/api/status |
GET | System status |
/api/context |
GET | Full system context |
/api/analyze |
POST | Analyze a request |
/api/execute |
POST | Execute a command |
/api/validate |
POST | Validate a command |
/api/health |
GET | Health check |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini API for AI capabilities
- Raspberry Pi Foundation
- The open-source community
Made with β€οΈ for Raspberry Pi enthusiasts