Skip to content
/ aira Public
forked from airalab/aira

Autonomous intelligent robot agent (AIRA) project implements the standard of economic interaction between human-robot and robot-robot.

License

Notifications You must be signed in to change notification settings

akagi-dev/aira

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

294 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AIRA - AI-powered NixOS System

        *
       /|
      / |
     /  |
    *   *       _    ___ ____      _    
   /|  /|      / \  |_ _|  _ \    / \   
  / | / |     / _ \  | || |_) |  / _ \  
 /  |/  |    / ___ \ | ||  _ <  / ___ \ 
*---*---*   /_/   \_\___|_| \_\/_/   \_\

Autonomous Intelligent Robot Agent - A complete AI-powered system built on NixOS with local LLM capabilities, MCP protocol support, and modern tooling.

Build License

πŸš€ Overview

AIRA is a fully reproducible, declarative NixOS system that provides:

  • πŸ€– Ollama - Local LLM engine with llama3.2:3b model
  • 🌐 Agent Gateway - MCP Router for tool orchestration
  • πŸ’» Open WebUI - Modern web interface for LLM interaction
  • πŸ–₯️ aichat - Terminal UI client for chat
  • πŸ”§ MCP Servers - Filesystem, Nix, systemd, and shell tool servers
  • πŸ“¦ QEMU/ISO Images - Ready-to-use VM and installation images

✨ Features

Core Components

Component Description Port/Access
Ollama Local LLM inference engine localhost:11434
Agent Gateway MCP protocol router localhost:8081
Open WebUI Web-based chat interface localhost:8080
aichat Terminal UI client CLI tool

MCP Servers

  • Filesystem - Safe file operations with directory whitelisting
  • Nix - System configuration and package management
  • Systemd - Service control and monitoring
  • Shell - Sandboxed command execution

🎯 Quick Start

Prerequisites

  • Linux system (x86_64)
  • Nix with flakes enabled
  • 4GB+ RAM
  • 20GB+ free disk space

Installation

  1. Install Nix (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
  1. Clone the repository:
git clone https://github.com/akagi-dev/aira.git
cd aira
  1. Build the QEMU VM:
make vm
  1. Run the VM:
make run
  1. Access the system:

Using the ISO

Build and burn the ISO for bare-metal installation:

make iso
# Result will be in result/iso/

πŸ“– Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         AIRA System                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚  β”‚  Open WebUI  │◄──────►│  aichat TUI  β”‚                   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚         β”‚                       β”‚                           β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                           β”‚
β”‚                     β–Ό                                       β”‚
β”‚            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                              β”‚
β”‚            β”‚ Agent Gateway   β”‚                              β”‚
β”‚            β”‚  (MCP Router)   β”‚                              β”‚
β”‚            β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                              β”‚
β”‚                     β”‚                                       β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                           β”‚
β”‚         β–Ό                       β–Ό                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                     β”‚
β”‚  β”‚   Ollama    β”‚        β”‚ MCP Servers β”‚                     β”‚
β”‚  β”‚   (LLM)     β”‚        β”‚ β€’ filesystemβ”‚                     β”‚
β”‚  β”‚             β”‚        β”‚ β€’ nix       β”‚                     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚ β€’ systemd   β”‚                     β”‚
β”‚                         β”‚ β€’ shell     β”‚                     β”‚
β”‚                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚
β”‚                                                             β”‚
β”‚                      NixOS 24.11                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Development

Available Make Targets

make vm            # Build QEMU VM image
make iso           # Build ISO installer
make run           # Run VM with graphics
make run-headless  # Run VM in headless mode
make test          # Run integration tests
make clean         # Clean build artifacts
make update        # Update flake inputs
make check         # Check flake validity
make dev           # Enter development shell

Project Structure

aira/
β”œβ”€β”€ flake.nix              # Nix flake configuration
β”œβ”€β”€ configuration.nix      # Base NixOS configuration
β”œβ”€β”€ modules/               # Service modules
β”‚   β”œβ”€β”€ ollama.nix
β”‚   β”œβ”€β”€ agent-gateway.nix
β”‚   β”œβ”€β”€ open-webui.nix
β”‚   β”œβ”€β”€ aichat.nix
β”‚   └── mcp-servers/       # MCP protocol servers
β”‚       β”œβ”€β”€ filesystem.nix
β”‚       β”œβ”€β”€ nix.nix
β”‚       β”œβ”€β”€ systemd.nix
β”‚       └── shell.nix
β”œβ”€β”€ images/                # Image builders
β”‚   β”œβ”€β”€ qemu.nix          # VM image
β”‚   └── iso.nix           # ISO image
β”œβ”€β”€ scripts/               # Helper scripts
β”‚   └── test-system.sh
└── tests/                 # Integration tests
    └── integration/

Modifying the Configuration

The system is fully declarative. To modify:

  1. Edit configuration.nix or module files
  2. Rebuild inside the VM:
sudo nixos-rebuild switch

Or rebuild the entire VM:

make clean && make vm && make run

πŸ§ͺ Testing

Run integration tests:

make test

Individual test scripts are in tests/integration/:

  • test_ollama.sh - Ollama service tests
  • test_agent_gateway.sh - Agent Gateway tests
  • test_mcp_servers.sh - MCP server tests

πŸ”§ Configuration

Changing the LLM Model

Edit configuration.nix:

services.aira.ollama.model = "llama3.1:8b";  # or any other model

Adjusting VM Resources

Edit images/qemu.nix:

virtualisation = {
  memorySize = 8192;  # 8GB RAM
  cores = 8;          # 8 CPU cores
  diskSize = 40960;   # 40GB disk
};

MCP Server Permissions

Control filesystem access in modules/mcp-servers/filesystem.nix:

services.aira.mcp.filesystem.allowedDirectories = [
  "/home"
  "/tmp"
  "/your/custom/path"
];

πŸ“š Usage Examples

Using Open WebUI

  1. Access http://localhost:8080
  2. Create an account (local only)
  3. Start chatting with the LLM
  4. Use MCP tools for system operations

Using aichat CLI

SSH into the VM and run:

aichat
> Hello! Can you help me list files?

Using Ollama API

curl http://localhost:11434/api/generate -d '{
  "model": "llama3.2:3b",
  "prompt": "Explain NixOS in one sentence",
  "stream": false
}'

πŸ”’ Security

  • Default password is aira - CHANGE IT IN PRODUCTION
  • MCP servers use whitelists and sandboxing
  • Services run with minimal privileges
  • Firewall enabled with only necessary ports open

For production use:

  1. Change user password
  2. Disable password authentication for SSH
  3. Configure proper firewall rules
  4. Review MCP server permissions
  5. Use secrets management for sensitive data

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“‹ System Requirements

Minimum

  • CPU: 2 cores, 1.4 GHz
  • RAM: 4GB
  • Disk: 20GB
  • KVM support (optional but recommended)

Recommended

  • CPU: 4+ cores, 2.0+ GHz
  • RAM: 8GB+
  • Disk: 40GB+
  • KVM acceleration enabled

πŸ“ License

This project is licensed under the terms specified in the LICENSE file.

πŸ”— Links

πŸ’¬ FAQ

Q: Why NixOS?
A: NixOS provides reproducible, declarative system configuration. Every component is version-controlled and can be rolled back.

Q: Can I use different LLM models?
A: Yes! Change the services.aira.ollama.model option to any model supported by Ollama.

Q: Does this work on ARM/Apple Silicon?
A: Currently only x86_64 is supported. ARM support is planned.

Q: How much RAM do I really need?
A: 4GB minimum for llama3.2:3b, but 8GB+ recommended for larger models and better performance.

Q: Can I deploy this to a server?
A: Yes! Build the ISO and install on bare metal, or use the configuration directly with NixOS.

🎯 Roadmap

  • ARM/aarch64 support
  • Additional MCP servers (git, docker, etc.)
  • Web-based configuration UI
  • Multi-model support
  • Clustering and distributed inference
  • Integration with external services

Built with ❀️ using NixOS

About

Autonomous intelligent robot agent (AIRA) project implements the standard of economic interaction between human-robot and robot-robot.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 79.4%
  • Shell 11.5%
  • Makefile 9.1%