0% found this document useful (0 votes)
34 views20 pages

College Project 1oe

The Trio Project is an advanced implementation of three AI assistants (NAMI, RUSH, and VEX) designed to operate on a Mac Mini with specific roles and operating hours. Each assistant utilizes a sophisticated pause/resume workflow for seamless transitions while preserving state, and the system includes a modular architecture with state, memory, checkpoint, and controller management systems. The project also features an automated scheduling system to manage assistant activation and deactivation based on designated hours.

Uploaded by

ehsassethi007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views20 pages

College Project 1oe

The Trio Project is an advanced implementation of three AI assistants (NAMI, RUSH, and VEX) designed to operate on a Mac Mini with specific roles and operating hours. Each assistant utilizes a sophisticated pause/resume workflow for seamless transitions while preserving state, and the system includes a modular architecture with state, memory, checkpoint, and controller management systems. The project also features an automated scheduling system to manage assistant activation and deactivation based on designated hours.

Uploaded by

ehsassethi007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

The Trio Project: Advanced AI Assistants

Implementation
Created by: Ehsas Sethi aka Sashe
AI Model Used: Manus AI

Introduction
The Trio Project is an advanced implementation of three specialized AI assistants designed to
work together on a Mac Mini. Each assistant has a specific role and operates during designated
hours to maximize efficiency and resource utilization. This implementation features a
sophisticated pause/resume workflow that allows seamless transitions between assistants
while preserving state.

System Overview
The Three Assistants

1. NAMI (Network and Machine Intelligence): System control assistant


2. Operating Hours: 7:00 AM - 12:00 AM (midnight)
3. RAM Allocation: 2-3 GB

4. Primary Functions: System management, file operations, command execution

5. RUSH (Recording and Understanding Speech Helper): Interactive lecture assistant

6. Operating Hours: 8:00 AM - 11:00 PM


7. RAM Allocation: 16-18 GB

8. Primary Functions: Audio processing, transcription, content analysis

9. VEX (Video Editing eXpert): Automated video editor

10. Operating Hours: 12:00 AM - 6:30 AM


11. RAM Allocation: 19-20 GB
12. Primary Functions: Video processing, clip creation, content editing

Resource Allocation

Assistant RAM Allocation Operating Hours System State

NAMI 2-3 GB 7:00 AM - 12:00 AM Active/Paused

RUSH 16-18 GB 8:00 AM - 11:00 PM Active/Paused

VEX 19-20 GB 12:00 AM - 6:30 AM Active/Paused


Assistant RAM Allocation Operating Hours System State

System 4-5 GB Always Always Active

NAMI and RUSH can run simultaneously during overlapping hours. VEX runs exclusively during
its designated hours.

Core Architecture
The Trio Project is built on a modular architecture with these key components:

1. State Management System

The state management system is the backbone of the Trio Project, enabling the pause/resume
workflow and ensuring seamless transitions between assistants.

# State Manager: Handles the state of all assistants


class StateManager:
def __init__(self, state_dir="/Users/Shared/trio_project/shared/state"):
"""Initialize state manager with directory for state files"""
self.state_dir = state_dir
self.assistants = ["rush", "nami", "vex"]
self.active_assistant = None

# Create state directory if it doesn't exist


os.makedirs(self.state_dir, exist_ok=True)

# Initialize states for all assistants


self._initialize_states()

def activate_assistant(self, assistant_name):


"""Activate an assistant and pause others if needed"""
# Implementation details...

def pause_assistant(self, assistant_name):


"""Pause an assistant and save its state"""
# Implementation details...

def get_assistant_state(self, assistant_name):


"""Get the current state of an assistant"""
# Implementation details...

2. Memory Management System

The memory management system ensures optimal resource allocation based on which
assistants are active.
# Memory Manager: Controls memory allocation for assistants
class MemoryManager:
def __init__(self):
"""Initialize memory manager with allocation limits"""
# Define memory limits for assistants (in MB)
self.memory_limits = {
# When active
"active": {
"rush": 18432, # 18GB
"nami": 3072, # 3GB
"vex": 20480, # 20GB
},
# When paused
"paused": {
"rush": 1024, # 1GB
"nami": 512, # 0.5GB
"vex": 1024, # 1GB
}
}

def adjust_memory_limit(self, assistant_name, active=True):


"""Set memory limit for an assistant based on its state"""
# Implementation details...

def monitor_memory_usage(self):
"""Monitor system memory usage and adjust if needed"""
# Implementation details...

3. Checkpoint System

The checkpoint system allows assistants to save and restore their state during transitions.

# Checkpoint Manager: Handles saving and loading assistant states


class CheckpointManager:
def __init__(self, checkpoint_dir="/Users/Shared/trio_project/shared/
checkpoints"):
"""Initialize checkpoint manager with directory for checkpoint
files"""
self.checkpoint_dir = checkpoint_dir

# Create checkpoint directory if it doesn't exist


os.makedirs(self.checkpoint_dir, exist_ok=True)

# Create assistant-specific directories


for assistant in ["rush", "nami", "vex"]:
assistant_dir = os.path.join(self.checkpoint_dir, assistant)
os.makedirs(assistant_dir, exist_ok=True)

def save_checkpoint(self, assistant_name, task_name, checkpoint_data):


"""Save a checkpoint for an assistant"""
# Implementation details...

def load_checkpoint(self, checkpoint_id=None, assistant_name=None,


task_name=None):
"""Load a checkpoint for an assistant"""
# Implementation details...

4. Controller System

The controller system manages the overall operation of the Trio Project, including assistant
transitions and scheduling.

# Assistant Controller: Manages assistant transitions and scheduling


class AssistantController:
def __init__(self):
"""Initialize controller with necessary managers"""
self.state_manager = StateManager()
self.memory_manager = MemoryManager()
self.checkpoint_manager = CheckpointManager()

# Assistant scripts
self.assistant_scripts = {
"rush": "/Users/Shared/trio_project/rush/rush_main.py",
"nami": "/Users/Shared/trio_project/nami/nami_main.py",
"vex": "/Users/Shared/trio_project/vex/vex_main.py"
}

# Assistant processes
self.assistant_processes = {}

def start_assistant(self, assistant_name):


"""Start an assistant process"""
# Implementation details...

def stop_assistant(self, assistant_name):


"""Stop an assistant process"""
# Implementation details...

def handle_transition(self, command):


"""Handle transition between assistants"""
# Implementation details...
NAMI: System Control Assistant
NAMI is the system control assistant that manages file operations, executes commands, and
provides system information.

Key Features

1. Secure Command Execution: Executes system commands with proper validation and
security checks
2. File Management: Handles file operations like listing, copying, and finding files
3. System Monitoring: Provides information about system status and resource usage
4. Assistant Transitions: Manages transitions between assistants

Implementation

class NamiAssistant:
"""NAMI System Control Assistant"""

def __init__(self):
"""Initialize NAMI assistant with necessary components"""
self.logger = self._setup_logger()

# Create directories
self._create_directories()

# Initialize managers
self.state_manager = StateManager()
self.checkpoint_manager = CheckpointManager()

# Current state
self.current_directory = os.path.expanduser("~")
self.authenticated_users = set()
self.current_command = None
self.command_result = None

# Thread synchronization
self.state_lock = threading.RLock()

# Load state if available


self.load_state()

self.logger.info("NAMI assistant initialized")

def execute_command(self, command, user_id):


"""Execute a system command with proper security checks"""
# Implementation details...
def _is_command_allowed(self, command):
"""Check if a command is allowed for security reasons"""
# Implementation details...

def authenticate_user(self, user_id, auth_code):


"""Authenticate a user with secure methods"""
# Implementation details...

RUSH: Interactive Lecture Assistant


RUSH is the interactive lecture assistant that processes audio recordings, transcribes content,
and generates insights.

Key Features

1. Audio Processing: Handles various audio formats for processing


2. Transcription: Converts speech to text with high accuracy
3. Content Analysis: Analyzes transcripts to extract key concepts and relationships
4. Question Generation: Creates insightful questions based on content analysis

Implementation

class RushAssistant:
"""RUSH Interactive Lecture Assistant"""

def __init__(self):
"""Initialize RUSH assistant with necessary components"""
self.logger = self._setup_logger()

# Create directories
self._create_directories()

# Initialize managers
self.state_manager = StateManager()
self.checkpoint_manager = CheckpointManager()

# Current task state


self.current_audio = None
self.current_transcript = None
self.current_analysis = None
self.current_questions = None
self.processing_stage = None

# Thread synchronization
self.state_lock = threading.RLock()

# Load state if available


self.load_state()

self.logger.info("RUSH assistant initialized")

def process_audio(self, audio_file):


"""Process an audio file with comprehensive validation"""
# Implementation details...

def _transcribe_audio(self, audio_file):


"""Transcribe audio to text using advanced models"""
# Implementation details...

def _analyze_transcript(self, transcript):


"""Analyze transcript to extract key information"""
# Implementation details...

VEX: Automated Video Editor


VEX is the automated video editor that processes video content, creates clips, and produces
edited versions.

Key Features

1. Video Processing: Handles various video formats for editing


2. Content Analysis: Analyzes video content to identify key segments
3. Clip Creation: Automatically creates clips from interesting segments
4. Screen Awareness: Uses screen capture to understand content context
5. Automated Editing: Applies consistent editing styles to content

Implementation

class VexEditor:
"""VEX Automated Video Editor"""

def __init__(self):
"""Initialize VEX editor with necessary components"""
self.logger = self._setup_logger()

# Create directories
self._create_directories()

# Initialize managers
self.state_manager = StateManager()
self.checkpoint_manager = CheckpointManager()

# Current state
self.current_video = None
self.processing_stage = None
self.processing_progress = 0
self.output_path = None
self.clips = []

# Screen capture components


self.screen_capture_enabled = True
self.screen_capture_interval = 5 # seconds

# Thread synchronization
self.state_lock = threading.RLock()

# Load state if available


self.load_state()

self.logger.info("VEX editor initialized")

def process_video(self, video_file):


"""Process a video file with comprehensive validation"""
# Implementation details...

def _analyze_video_content(self, video_file):


"""Analyze video content to identify key segments"""
# Implementation details...

def _create_clips(self, video_file, segments):


"""Create clips from identified segments"""
# Implementation details...

Pause/Resume Workflow
The pause/resume workflow is a key feature of the Trio Project, allowing assistants to save
their state when paused and resume from that state when activated again.

Workflow Steps

1. Pause Assistant:
2. Save current state to checkpoint
3. Update state in state manager

4. Adjust memory allocation

5. Resume Assistant:

6. Load state from checkpoint


7. Update state in state manager
8. Adjust memory allocation
9. Continue from previous state
Implementation

# In AssistantController
def transition_assistants(self, from_assistant, to_assistant):
"""Transition from one assistant to another"""
# Pause current assistant
if from_assistant:
self.pause_assistant(from_assistant)

# Resume target assistant


if to_assistant:
self.resume_assistant(to_assistant)

return True

def pause_assistant(self, assistant_name):


"""Pause an assistant and save its state"""
# Get assistant process
process = self.assistant_processes.get(assistant_name)

if not process:
self.logger.warning(f"Assistant {assistant_name} not running")
return False

# Send pause signal to assistant


# This will trigger the assistant to save its state
os.kill(process.pid, signal.SIGUSR1)

# Wait for assistant to acknowledge


time.sleep(1)

# Update state
self.state_manager.pause_assistant(assistant_name)

# Adjust memory limits


self.memory_manager.adjust_memory_limit(assistant_name, active=False)

return True

def resume_assistant(self, assistant_name):


"""Resume an assistant from saved state"""
# Check if assistant is already running
if assistant_name in self.assistant_processes and
self.assistant_processes[assistant_name].poll() is None:
# Send resume signal
os.kill(self.assistant_processes[assistant_name].pid, signal.SIGUSR2)
else:
# Start assistant
self.start_assistant(assistant_name)

# Update state
self.state_manager.activate_assistant(assistant_name)

# Adjust memory limits


self.memory_manager.adjust_memory_limit(assistant_name, active=True)

return True

Scheduling System
The scheduling system ensures that assistants run during their designated hours and
transitions occur automatically.

Implementation

The scheduling system uses macOS's launchd service to manage assistant activation and
deactivation.

NAMI Launch Agent (7:00 AM - 12:00 AM)

<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/
DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.trio.nami</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/Users/Shared/trio_project/nami/nami_main.py</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>7</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</array>
<key>StandardOutPath</key>
<string>/Users/Shared/trio_project/logs/nami_launch.log</string>
<key>StandardErrorPath</key>
<string>/Users/Shared/trio_project/logs/nami_launch_error.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
<key>PYTHONPATH</key>
<string>/Users/Shared/trio_project</string>
</dict>
<key>WorkingDirectory</key>
<string>/Users/Shared/trio_project</string>
</dict>
</plist>

RUSH Launch Agent (8:00 AM - 11:00 PM)

<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/
DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.trio.rush</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/Users/Shared/trio_project/rush/rush_main.py</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>8</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</array>
<key>StandardOutPath</key>
<string>/Users/Shared/trio_project/logs/rush_launch.log</string>
<key>StandardErrorPath</key>
<string>/Users/Shared/trio_project/logs/rush_launch_error.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
<key>PYTHONPATH</key>
<string>/Users/Shared/trio_project</string>
</dict>
<key>WorkingDirectory</key>
<string>/Users/Shared/trio_project</string>
</dict>
</plist>

VEX Launch Agent (12:00 AM - 6:30 AM)

<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/
DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.trio.vex</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/Users/Shared/trio_project/vex/vex_main.py</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>0</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</array>
<key>StandardOutPath</key>
<string>/Users/Shared/trio_project/logs/vex_launch.log</string>
<key>StandardErrorPath</key>
<string>/Users/Shared/trio_project/logs/vex_launch_error.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
<key>PYTHONPATH</key>
<string>/Users/Shared/trio_project</string>
</dict>
<key>WorkingDirectory</key>
<string>/Users/Shared/trio_project</string>
</dict>
</plist>
Installation Guide
This section provides step-by-step instructions for installing and configuring the Trio Project on
your Mac Mini.

Prerequisites

• Mac Mini with Apple Silicon (M1 or later)


• macOS 12.0 (Monterey) or later
• Python 3.9 or later
• 32GB RAM recommended (24GB minimum)
• 256GB storage (SSD)

Installation Steps

1. Clone the Repository: bash git clone https://github.com/ehsassethi/trio-


project.git /Users/Shared/trio_project

2. Install Dependencies: bash cd /Users/Shared/trio_project pip3 install -r


requirements.txt

3. Create Required Directories: bash mkdir -p /Users/Shared/trio_project/logs


mkdir -p /Users/Shared/trio_project/shared/state mkdir -p /Users/Shared/
trio_project/shared/checkpoints mkdir -p /Users/Shared/trio_project/nami/
cache mkdir -p /Users/Shared/trio_project/rush/audio mkdir -p /Users/
Shared/trio_project/rush/transcripts mkdir -p /Users/Shared/trio_project/
vex/input mkdir -p /Users/Shared/trio_project/vex/output/clips

4. Set Up Launch Agents: bash cp /Users/Shared/trio_project/config/


com.trio.nami.plist ~/Library/LaunchAgents/ cp /Users/Shared/trio_project/
config/com.trio.rush.plist ~/Library/LaunchAgents/ cp /Users/Shared/
trio_project/config/com.trio.vex.plist ~/Library/LaunchAgents/

5. Load Launch Agents: bash launchctl load ~/Library/LaunchAgents/


com.trio.nami.plist launchctl load ~/Library/LaunchAgents/
com.trio.rush.plist launchctl load ~/Library/LaunchAgents/
com.trio.vex.plist

6. Set Permissions: bash chmod +x /Users/Shared/trio_project/*.sh

7. Start the System: bash /Users/Shared/trio_project/start.sh

Beginner's Guide to Using the Trio Project


This section provides a beginner-friendly guide to using the Trio Project's assistants.
Basic Commands

NAMI Commands

• /ls [path] - List files in directory


• /cd [path] - Change current directory
• /find [query] - Find files matching query
• /exec [command] - Execute a system command
• /status - Get system status
• /return_to_rush - Switch to RUSH assistant
• /start_vex - Switch to VEX assistant

RUSH Commands

• /process [audio_file] - Process an audio recording


• /status - Get processing status
• /questions - Get generated questions
• /pause - Pause current processing
• /resume - Resume from last checkpoint

VEX Commands

• /process [video_file] - Process a video file


• /status - Get processing status
• /clips - Get generated clips
• /pause - Pause current processing
• /resume - Resume from last checkpoint

Transition Between Assistants

1. RUSH to NAMI: Say "RUSH I AM HOME" to switch from RUSH to NAMI


2. NAMI to RUSH: Use /return_to_rush command in NAMI
3. To VEX: Use /start_vex command in NAMI or say "START VEX"

Common Workflows

Lecture Processing Workflow

1. Record a lecture using your preferred recording app


2. Place the audio file in /Users/Shared/trio_project/rush/audio
3. Switch to RUSH assistant
4. Process the audio: /process /Users/Shared/trio_project/rush/audio/lecture.mp3
5. Check status: /status
6. Get generated questions: /questions

Video Editing Workflow

1. Place raw video in /Users/Shared/trio_project/vex/input


2. Switch to VEX assistant (or wait for nighttime automatic processing)
3. Process the video: /process /Users/Shared/trio_project/vex/input/
raw_video.mp4
4. Check status: /status
5. Find edited video in /Users/Shared/trio_project/vex/output

Advanced Features
1. Voice Recognition

The Trio Project includes voice recognition capabilities using open-source models:

# In AssistantController
def setup_voice_recognition(self):
"""Set up voice recognition using open-source models"""
import speech_recognition as sr

self.recognizer = sr.Recognizer()
self.microphone = sr.Microphone()

# Adjust for ambient noise


with self.microphone as source:
self.recognizer.adjust_for_ambient_noise(source)

# Start listening thread


self.voice_thread =
threading.Thread(target=self._voice_recognition_thread)
self.voice_thread.daemon = True
self.voice_thread.start()

def _voice_recognition_thread(self):
"""Background thread for voice recognition"""
while True:
try:
with self.microphone as source:
audio = self.recognizer.listen(source)

# Recognize speech using open-source model


text = self.recognizer.recognize_vosk(audio)

# Process command
if "rush" in text.lower() and "home" in text.lower():
self.handle_transition("rush i am home")
elif "return" in text.lower() and "rush" in text.lower():
self.handle_transition("return to rush")
elif "start" in text.lower() and "vex" in text.lower():
self.handle_transition("start vex")
except Exception as e:
self.logger.error(f"Error in voice recognition: {str(e)}")

# Sleep to prevent high CPU usage


time.sleep(0.1)

2. Screen Awareness for VEX

VEX includes screen awareness capabilities to better understand video content:

# In VexEditor
def setup_screen_capture(self):
"""Set up screen capture for content awareness"""
if not self.screen_capture_enabled:
return

# Create screen capture directory


os.makedirs("/Users/Shared/trio_project/vex/screen_capture",
exist_ok=True)

# Start screen capture thread


self.screen_thread = threading.Thread(target=self._screen_capture_thread)
self.screen_thread.daemon = True
self.screen_thread.start()

def _screen_capture_thread(self):
"""Background thread for screen capture"""
import mss

with mss.mss() as sct:


monitor = sct.monitors[1] # Primary monitor

while self.screen_capture_enabled:
try:
# Capture screen
screenshot = sct.grab(monitor)

# Save to file
timestamp = int(time.time())
filename = f"/Users/Shared/trio_project/vex/screen_capture/
screen_{timestamp}.png"
mss.tools.to_png(screenshot.rgb, screenshot.size,
output=filename)

# Analyze screen content (in a real implementation)


# self._analyze_screen_content(filename)
# Sleep for interval
time.sleep(self.screen_capture_interval)
except Exception as e:
self.logger.error(f"Error in screen capture: {str(e)}")
time.sleep(5) # Longer sleep on error

3. Enhanced Memory Management

The Trio Project includes enhanced memory management with dynamic adjustment:

# In MemoryManager
def monitor_system_memory(self):
"""Monitor system memory and adjust assistant limits if needed"""
# Start monitoring thread
self.monitor_thread = threading.Thread(target=self._monitor_thread)
self.monitor_thread.daemon = True
self.monitor_thread.start()

def _monitor_thread(self):
"""Background thread for memory monitoring"""
import psutil

while True:
try:
# Get system memory info
memory = psutil.virtual_memory()

# Check if system is under memory pressure


if memory.percent > 90:
self.logger.warning(f"System under memory pressure:
{memory.percent}%")

# Get active assistants


active_assistants =
self.state_manager.get_active_assistants()

# Reduce memory limits for active assistants


for assistant in active_assistants:
current_limit = self.get_memory_limit(assistant,
active=True)
new_limit = int(current_limit * 0.8) # Reduce by 20%

self.logger.info(f"Reducing memory limit for {assistant}


from {current_limit}MB to {new_limit}MB")
self.memory_limits["active"][assistant] = new_limit

# Apply new limit


self.adjust_memory_limit(assistant, active=True)

# Sleep before next check


time.sleep(60)
except Exception as e:
self.logger.error(f"Error in memory monitor: {str(e)}")
time.sleep(300) # Longer sleep on error

Troubleshooting
This section provides solutions to common issues you might encounter with the Trio Project.

System Won't Start

If the system fails to start, check the following:

1. Check if processes are already running: bash ps aux | grep trio_project

2. Check log files for errors: bash cat /Users/Shared/trio_project/logs/


controller.log cat /Users/Shared/trio_project/logs/nami.log cat /Users/
Shared/trio_project/logs/rush.log cat /Users/Shared/trio_project/logs/
vex.log

3. Restart the system: bash /Users/Shared/trio_project/stop.sh /Users/Shared/


trio_project/start.sh

Assistant Switching Issues

If you're having trouble switching between assistants:

1. Check controller logs: bash cat /Users/Shared/trio_project/logs/


controller.log

2. Force a assistant switch: bash python3 -c "from shared.assistant_controller


import AssistantController; controller = AssistantController();
controller.activate_assistant('rush')"

Memory Issues

If the system is using too much memory:

1. Check memory usage: bash top -o MEM

2. Restart the system: bash /Users/Shared/trio_project/stop.sh /Users/Shared/


trio_project/start.sh

Performance Optimization
To optimize performance on your Mac Mini:
Memory Management

1. Create a memory optimization script: ```bash #!/bin/bash

# Purge inactive memory sudo purge

# Clean up temporary files find /Users/Shared/trio_project/vex/temp -type f -mtime +1 -delete


find /tmp -name "trio_project_*" -type f -mtime +1 -delete

echo "Memory optimized" ```

1. Run it periodically: bash chmod +x /Users/Shared/trio_project/


optimize_memory.sh

Scheduled Maintenance

1. Create a scheduled maintenance script: ```bash #!/bin/bash

# Clean up old checkpoints python3 -c "from shared.checkpoint_manager import


CheckpointManager; manager = CheckpointManager(); deleted =
manager.cleanup_old_checkpoints(days=7); print(f'Deleted {deleted} old checkpoints')"

# Clean up log files find /Users/Shared/trio_project/logs -type f -mtime +7 -delete

# Optimize memory sudo purge

echo "Maintenance completed" ```

1. Add to crontab: bash 0 0 * * 0 /Users/Shared/trio_project/


scheduled_maintenance.sh

Future Expansion
The Trio Project is designed to be expandable. Here are some ideas for future enhancements:

Add New Assistants

1. Update the state manager: python # In /Users/Shared/trio_project/shared/


state_manager.py # Add new assistant to the assistants list
self.assistants = ["rush", "nami", "vex", "new_assistant"]

2. Create assistant script: bash # /Users/Shared/trio_project/new_assistant/


new_assistant_main.py

Improve Pause/Resume Workflow

1. Enhance checkpoint system: python # In /Users/Shared/trio_project/shared/


checkpoint_manager.py def save_detailed_checkpoint(self, assistant_name,
task_name, checkpoint_data, metadata): # Enhanced checkpoint saving with
more metadata pass
Add Web Interface

1. Create a web interface for monitoring and control: ```python # /Users/Shared/


trio_project/web/app.py from flask import Flask, render_template, jsonify, request import
sys sys.path.append('/Users/Shared/trio_project') from shared.assistant_controller import
AssistantController

app = Flask(name) controller = AssistantController()

@app.route('/') def index(): return render_template('index.html')

@app.route('/api/status') def status(): return jsonify(controller.get_assistant_status())

@app.route('/api/switch', methods=['POST']) def switch(): assistant =


request.json.get('assistant') if assistant: controller.activate_assistant(assistant) return
jsonify({"success": True}) return jsonify({"success": False})

if name == 'main': app.run(host='0.0.0.0', port=5000) ```

Conclusion
The Trio Project provides a sophisticated implementation of three specialized AI assistants
working together on a Mac Mini. By leveraging free and open-source software, this system
delivers powerful functionality at minimal cost (just electricity).

The scheduling system ensures efficient resource usage, with each assistant operating during
its optimal hours: - NAMI provides system control from 7:00 AM to 12:00 AM - RUSH assists
with lectures from 8:00 AM to 11:00 PM - VEX edits videos from 12:00 AM to 6:30 AM

The pause/resume workflow enables seamless transitions between assistants, preserving state
and ensuring continuity of operations.

With proper memory management, the system makes optimal use of available resources,
allocating memory based on which assistants are active and their specific needs.

This implementation guide provides all the code and instructions needed to set up and use the
Trio Project on your Mac Mini.

You might also like