Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EdgeMind Agent 🧠

An AI-powered intelligent control layer for Raspberry Pi OS

License: MIT Python 3.9+ Raspberry Pi

🎯 What is EdgeMind Agent?

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)

Key Principle

"AI doesn't execute β€” AI decides"

The AI analyzes, plans, and recommends. A security gateway validates and executes only whitelisted commands.

πŸ—οΈ Project Structure

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

πŸš€ Installation

Quick Start

# 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

Raspberry Pi Installation

# 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.zip

πŸ’» Usage

Interactive CLI Mode

python https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip

Web Dashboard Mode

python https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip --web
# Access at http://localhost:8080

Single Request Analysis

python 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?" --execute

Check System Status

python https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip --status

πŸ“Š Workflow

User 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)

πŸ” Security Model

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

Risk Levels

Level Description Action
🟒 Low Read-only commands Auto-execute
🟑 Medium Service control, package management Requires confirmation
πŸ”΄ High System modifications Blocked automatically

Blacklisted Commands (Never Executed)

  • rm -rf / and destructive patterns
  • mkfs, dd disk operations
  • shutdown, reboot, halt
  • Firewall/routing modifications
  • Fork bombs and malicious patterns

πŸ“‹ Supported Tasks

  • βœ… 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

βš™οΈ Configuration

Environment Variables

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)

Config Files

  • https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip - General settings, security options
  • https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip - Allowed commands and risk levels
  • https://raw.githubusercontent.com/SAIFontop/edgemind-agent/main/src/core/edgemind-agent-v1.5.zip - AI behavior instructions

πŸ§ͺ Testing

# 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

πŸ“– API Endpoints

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

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

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

πŸ™ Acknowledgments

  • Google Gemini API for AI capabilities
  • Raspberry Pi Foundation
  • The open-source community

Made with ❀️ for Raspberry Pi enthusiasts

About

EdgeMind Agent is a secure AI system agent for Raspberry Pi OS that operates as an intelligent decision layer above the operating system. It analyzes system state, diagnoses issues, and plans safe actions using an external Gemini API, while enforcing strict security policies to prevent destructive operations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages