RIGEL - Open Source AI Assistant & Multi-LLM Agentic Engine

License: AGPL v3 Python Ollama Groq

Table of Contents


Hello World !

Zerone Laboratories - Rigel Engine v5.0.0 [Developer Beta]

Open-source Hybrid AI Assistant & Virtual Assistant Engine
Multi-LLM backend support | Agentic AI | Local & Cloud Inference | D-Bus Integration | Python AI Framework

Powered by multiple LLM backends (Ollama, Groq, LLAMA.cpp), designed for flexible AI inference, decision-making, and system integration.

  • Agentic Inference + Natural conversation
  • Plug-and-play multi-LLM support
  • DBus interface for OS-level integration
  • Modular, extensible, and developer-friendly
  • Build it. Hack it. Make it yours.

What makes RIGEL special? RIGEL bridges the gap between powerful AI models and practical system integration. Whether you're building a personal AI assistant, developing chatbots, creating AI-powered applications, or researching agentic AI systems, RIGEL provides the foundation you need with support for both local privacy-focused inference and high-performance cloud models.

[!WARNING] RIGEL Engine is still in developer-beta stage. Bugs may present. The code will be well structured in the public release and more features will be added!.

Example Tool built using RIGEL Engine

Rigel-Runtime Shell

Repository for this tool: [https://github.com/Zerone-Laboratories/RIGEL-Runtime]

Overview

RIGEL is a powerful open-source multi-agentic AI engine and virtual assistant framework that provides a unified interface for multiple language model backends. Built with extensibility in mind, it supports both local AI inference via Ollama and cloud-based inference through Groq.

Perfect for developers building AI applications, chatbots, virtual assistants, and agentic AI systems.

Key capabilities:

  • Multi-LLM Support: Ollama (local), Groq (cloud), LLAMA.cpp, Transformers
  • Agentic AI: Advanced reasoning, thinking, and decision-making
  • System Integration: D-Bus server for OS-level AI assistance
  • MCP Tools: File management, system commands, real-time information, and rich system/device interaction with configurable server support
  • Voice Interface: Local speech-to-text and text-to-speech capabilities
  • Vector Memory Retrieval: /query-with-memory uses vector session retrieval to bring in relevant historical context.
  • Natural Language Routing: Memory-first tool delegation through /rigel-natural-language
  • Image Analysis: Vision-powered image understanding via /analyze-image
  • Memory Management: Persistent conversation threads
  • Extensible: Plugin architecture for custom capabilities and MCP server integration

Aims to act as a central AI server for multiple agentic-based clients and AI-powered applications.

Project Status

Feature Status
Inference with Ollama
Inference with Groq
Inference with LLAMA.cpp (CUDA/Vulkan Compute) -
Inference with transformers -
Thinking
MCP
Dbus Server
RAG
Memory
Local Voice Recognition
Live Voice Recognition (whisper.cpp)
Local Voice Synthesis
Visual Inference (Vision Models)
Natural Language Routing
Image Analysis REST Endpoint

Features

  • Multi-Backend Support: Seamlessly switch between Ollama (local) and Groq (cloud) backends. More backends will be integrated in future
  • D-Bus Server Integration: Inter-process communication via D-Bus for system-wide AI assistance
  • MCP (Model Context Protocol) Tools: Extended AI capabilities with system-level operations including file management, system commands, and real-time information access
  • Browser Automation Workflows: Save and replay browser automation tasks - record once with AI, replay infinitely without AI
  • Voice Synthesis & Recognition: Local speech-to-text using Whisper and text-to-speech using Piper with chunked streaming audio
  • Extensible Architecture: Built with a superclass design for easy extension to new capabilities
  • Memory Management: Persistent conversation memory with thread-based organization
  • Advanced Thinking: Sophisticated reasoning and decision-making capabilities
  • Comprehensive Logging: Integrated logging system for debugging and monitoring
  • Flexible Inference: Support for custom prompts and message formats
  • RAG Support: Retrieval-Augmented Generation using ChromaDB for document-based AI interactions

Supported Backends

Ollama Backend (RigelOllama)

  • Default Model: llama3.2
  • Type: Local inference
  • Benefits: Privacy, no API costs, offline capability

Groq Backend (RigelGroq)

  • Default Model: llama3-70b-8192
  • Type: Cloud-based inference
  • Benefits: High performance, larger models, no local compute requirements
  • Requirements: Groq API key

Installation

  1. Clone the repository:
git clone <repository-url>
cd RIGEL
  1. For D-Bus integration, install the system D-Bus configuration:
sudo bash install_dbus_config.sh

This script installs the rigel-dbus.conf configuration into /etc/dbus-1/system.d/ and reloads D-Bus.

  1. If you prefer manual setup, create a Python virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate  # On Linux/macOS
# or
.venv\Scripts\activate     # On Windows
pip install -r requirements.txt

For PyPI installs, use:

# Lightweight core package (no bundled large voice binaries/models)
pip install rigel-engine-core

# Core + optional voice asset locator package
pip install "rigel-engine-core[voice-assets]"
  1. For voice features, install system dependencies:
# Install Piper TTS (for voice synthesis)
# Download from: https://github.com/rhasspy/piper/releases
# Or install via package manager if available

# Install PulseAudio for audio playback (Ubuntu/Debian)
sudo apt-get install pulseaudio pulseaudio-utils

# Install PulseAudio for audio playback (Fedora/RHEL)
sudo dnf install pulseaudio pulseaudio-utils

# Install SDL2 for live voice recognition with whisper-stream
sudo apt-get install libsdl2-2.0-0   # Ubuntu/Debian
sudo dnf install SDL2                 # Fedora/RHEL
  1. For Ollama backend, ensure Ollama is installed and running:
# Install Ollama (if not already installed)
curl -fsSL https://ollama.ai/install.sh | sh

# Pull the default model
ollama pull llama3.2
  1. For D-Bus functionality (Linux only), ensure system dependencies:
# Ubuntu/Debian
sudo apt-get install python3-gi python3-gi-cairo gir1.2-gtk-3.0

# Fedora/RHEL
sudo dnf install python3-gobject python3-gobject-cairo gtk3-devel

Quick Start

RIGEL offers two server modes to suit different use cases and environments:

Docker Compose (Recommended)

Before starting RIGEL, install dependencies and prepare the host environment. If you need Linux D-Bus integration, run the provided D-Bus installer script first:

sudo bash install_dbus_config.sh

Then start RIGEL with Docker Compose:

docker compose up

This will start RIGEL in a consistent containerized environment with sane defaults and easy server selection via SERVER_TYPE.

D-Bus Server (Linux Desktop Integration)

RIGEL's D-Bus server provides system-wide AI assistance with advanced tool capabilities, perfect for Linux desktop integration.

Best for:

  • Linux desktop environments
  • System-wide AI assistance
  • Inter-process communication
  • Desktop application integration

Starting the D-Bus Server

# Using the main launcher (recommended)
python main.py
# Select option 1

# Or directly
python dbus_server.py

Web Server (HTTP REST API)

RIGEL's web server provides a REST API interface accessible from any HTTP client, with automatic OpenAPI documentation.

Best for:

  • Cross-platform compatibility
  • Remote access
  • Web applications
  • Mobile app backends
  • API integrations

Starting the Web Server

# Using the main launcher (recommended)
python main.py
# Select option 2

# Or directly
python web_server.py

The web server will be available at:

Web Server Endpoints

Endpoint Method Auth Required Description
/ GET No Service information
/query POST Yes Basic inference
/query-with-memory POST Yes Inference with conversation memory
/query-think POST Yes Advanced thinking capabilities
/query-with-tools POST Yes Inference with MCP tools support
/synthesize-text POST Yes Convert text to speech
/list-voices GET Yes List available voice models
/set-voice POST Yes Switch active voice model
/clone-voice POST Yes Start voice cloning from MP3 file
/recognize-audio POST Yes Transcribe audio file to text
/live-voice-recognition WebSocket Yes Live voice recognition via WebSocket
/license-info GET No License and copyright information
/admin/create-key POST Admin Create new API key
/admin/usage/{tenant_id} GET Admin Get usage statistics
/admin/list-tenants GET Admin List all tenants

Web API Usage Examples

Note: All endpoints except / and /license-info require authentication via X-API-Key header.

# Basic query
curl -X POST "http://localhost:8000/query" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -d '{"query": "Hello RIGEL!"}'

# Query with memory
curl -X POST "http://localhost:8000/query-with-memory" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -d '{"query": "My name is Alice", "id": "user123"}'

# Query with tools
curl -X POST "http://localhost:8000/query-with-tools" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -d '{"query": "What time is it and list files in current directory?"}'

# Text synthesis
curl -X POST "http://localhost:8000/synthesize-text" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -d '{"text": "Hello, this is RIGEL speaking!", "mode": "chunk"}'

# Audio recognition
curl -X POST "http://localhost:8000/recognize-audio" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -F "[email protected]" \
     -F "model=tiny"

# Live voice recognition via WebSocket (JavaScript example in browser console or Node.js)
# const ws = new WebSocket("ws://localhost:8000/live-voice-recognition?api_key=rigel_your_key");
# ws.onmessage = (e) => console.log(JSON.parse(e.data));
# ws.send(audioChunk);  // Send binary WAV audio frames

# License information (no auth required)
curl http://localhost:8000/license-info

Both servers support the same core functionality but with different interfaces. Choose the one that best fits your use case.

Starting the MCP Server on host via systemd (recommended)

Run the host startup service that starts the MCP tools server (port 8001) and the main Docker rigel-server container.

sudo cp scripts/rigel-tools.service /etc/systemd/system/rigel-tools.service
sudo systemctl daemon-reload
sudo systemctl enable --now rigel-tools.service
sudo systemctl status rigel-tools.service

This service executes scripts/host-up.sh (requires root / sudo) and ensures:

  • built-in core/mcp/rigel_tools_server.py runs on host
  • docker compose up rigel-server starts host service, not containerized tools server

Note: For Linux D-Bus integration, run sudo bash install_dbus_config.sh before starting RIGEL.

Note: For Linux D-Bus integration, run sudo bash install_dbus_config.sh before starting RIGEL. Note: The MCP server is now started separately from the main RIGEL process. Make sure the MCP server is running before you start the web/D-Bus server.

  • To start the MCP server: `python core/mcp/rigel_tools_server.py

For debugging or standalone use, you can still start the built-in MCP server manually:

cd core/mcp/
python rigel_tools_server.py

Configuring MCP Servers

Before starting the D-Bus server, you can configure custom MCP servers by editing server.py. The file includes commented examples showing how to:

  • Configure the built-in "rigel tools" server (SSE transport)
  • Add external MCP servers like "python-toolbox" (STDIO transport)
  • Set up environment variables and command-line arguments

To enable MCP functionality:

  1. Edit server.py and uncomment the default_mcp configuration
  2. Modify paths and settings to match your environment
  3. Start any external MCP servers if using STDIO transport
  4. Run the RIGEL server with your MCP configuration

If no MCP servers are configured, RIGEL will display a helpful message with setup instructions.

Using the D-Bus Service

from pydbus import SessionBus

bus = SessionBus()
service = bus.get("com.rigel.RigelService")

# Basic query
response = service.Query("Hello RIGEL!")
print(response)

# Query with memory (remembers conversation context)
response = service.QueryWithMemory("My name is Alice", "user123")
follow_up = service.QueryWithMemory("What's my name?", "user123")

# Advanced thinking capabilities
response = service.QueryThink("How should I approach solving this complex problem?")

# Query with MCP tools (file operations, system commands, etc.)
response = service.QueryWithTools("What time is it and list the files in the current directory?")
response = service.QueryWithTools("Read the README.md file and summarize its contents")
response = service.QueryWithTools("Check the system uptime and current user")

# Voice synthesis and recognition
response = service.SynthesizeText("Hello, this is RIGEL speaking!", "chunk", "knight")
transcription = service.RecognizeAudio("/path/to/audio.wav", "tiny")

Browser Automation Workflows

RIGEL includes a powerful workflow system that allows you to save and replay browser automation tasks. Create a workflow once with the AI agent, then replay it unlimited times without needing AI processing.

Quick Start

# List all saved workflows
python test_browser_agent_direct.py --list

# Run a task with AI and save as workflow
python test_browser_agent_direct.py --save "Workflow Name" "your task description"

# Replay a saved workflow (no AI needed!)
python test_browser_agent_direct.py --replay "Workflow Name"

# Or use the convenience script
./workflow.sh list
./workflow.sh save "YouTube Search" "go to youtube.com and search for AI"
./workflow.sh replay "YouTube Search"

Key Benefits

  • ⚡ Speed: Replay workflows in seconds vs minutes with AI
  • 💰 Cost: Zero API calls during replay
  • 🎯 Reliability: Exact same steps every time
  • 📤 Shareable: Export workflows as JSON files
  • 🔄 Reusable: Perfect for repetitive tasks

Use Cases

  1. Daily Tasks: Automate repetitive browser operations
  2. Testing: Create test scenarios and run them repeatedly
  3. Monitoring: Check website status or data periodically
  4. Data Collection: Gather information on a schedule

Example Workflow Creation

# Create a workflow for searching YouTube
python test_browser_agent_direct.py --save "YouTube Search" \
  "go to youtube.com and search for 'AI tutorials'"

# The AI agent will:
# 1. Navigate to YouTube
# 2. Find and click the search box
# 3. Type the search query
# 4. Submit the search
# 5. Save all steps as a reusable workflow

Replaying Workflows

# Replay with visible browser
python test_browser_agent_direct.py --replay "YouTube Search"

# Replay in headless mode (faster, no window)
python test_browser_agent_direct.py --replay "YouTube Search" --headless

# Or use the shell script
./workflow.sh replay "YouTube Search"
./workflow.sh replay-headless "YouTube Search"

Workflow Management

Workflows are stored as JSON files in the workflows/ directory:

workflows/
├── README.md                       # Technical documentation
├── Example_YouTube_Search.json     # Example workflow
└── Your_Workflow_Name.json         # Your saved workflows

For detailed usage, see WORKFLOW_GUIDE.md

Voice Features

RIGEL includes comprehensive voice capabilities for both speech synthesis and recognition, enabling natural voice interactions with your AI assistant.

Voice Synthesis (Text-to-Speech)

RIGEL uses Piper TTS for high-quality, local voice synthesis with multiple modes:

Synthesis Modes

  • Chunk Mode: Processes text in chunks (sentences) for streaming audio playback
  • Linear Mode: Processes entire text as a single unit

Using Voice Synthesis

from pydbus import SessionBus

bus = SessionBus()
service = bus.get("com.rigel.RigelService")

# Chunk mode for streaming (recommended for longer texts)
result = service.SynthesizeText("Hello, this is RIGEL speaking. I can help you with various tasks.", "chunk", "knight")

# Linear mode for simple, quick synthesis
result = service.SynthesizeText("Welcome to RIGEL!", "linear", "knight")

Direct Python Usage

from core.synth_n_recog import Synthesizer

# Initialize synthesizer
synthesizer = Synthesizer(mode="chunk")

# Synthesize and play text
synthesizer.synthesize("Hello, this is RIGEL speaking!")

# Switch modes
synthesizer.mode = "linear"
synthesizer.synthesize("Quick announcement!")

Voice Model Selection

RIGEL supports multiple Piper TTS voice models. Available models are stored in core/synthesis_assets/ as .onnx files. You can switch voices at runtime via environment variable, API, or DBus.

Setting the Default Voice via Environment Variable

# In .env or environment
VOICE=knight    # Options: knight, hal, jarvis-medium

Switching Voices via API

# List available voices
curl -X GET "http://localhost:8000/list-voices" \
     -H "X-API-Key: rigel_your_api_key_here"

# Switch to a different voice
curl -X POST "http://localhost:8000/set-voice" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -d '{"voice": "hal"}'

# Synthesize with a specific voice (overrides default)
curl -X POST "http://localhost:8000/synthesize-text" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -d '{"text": "Hello world", "mode": "chunk", "voice": "jarvis-medium"}'

Switching Voices via D-Bus

from pydbus import SessionBus

bus = SessionBus()
service = bus.get("com.rigel.RigelService")

# List available voices
print(service.ListVoices())

# Switch voice
service.SetVoice("hal")

# Synthesize with a specific voice
service.SynthesizeText("Hello world", "chunk", "jarvis-medium")

Direct Python Usage

from core.synth_n_recog import Synthesizer

# Initialize with a specific voice
synth = Synthesizer(mode="chunk", voice="hal")

# Switch voice at runtime
synth.set_voice("jarvis-medium")

# List all available voices
voices = Synthesizer.list_available_voices()
print(voices)  # ['hal', 'jarvis-medium', 'knight']

Voice Cloning

RIGEL includes an automated voice cloning pipeline that converts MP3 voice clips into a Piper-compatible training dataset. The pipeline:

  1. Converts MP3 to WAV segments (split on silence or into 15-second chunks)
  2. Transcribes each segment with Whisper
  3. Generates a Piper-compatible metadata.csv file
  4. Optionally preprocesses the dataset for Piper training

The resulting dataset is placed in core/synthesis_assets/VoiceCloning/dataset/{voice_name}/. After the dataset is prepared, run the Piper training pipeline (see the piper_multilingual_training_notebook.ipynb notebook in the VoiceCloning/ directory) to produce the .onnx model file. Place the resulting .onnx and .json files in core/synthesis_assets/ to make the cloned voice available for selection.

Cloning via API

curl -X POST "http://localhost:8000/clone-voice" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: rigel_your_api_key_here" \
     -d '{"mp3_path": "/path/to/voice_sample.mp3", "voice_name": "myvoice", "language": "English (U.S.)"}'

Cloning via D-Bus

service.CloneVoice("/path/to/voice_sample.mp3", "myvoice", "English (U.S.)")

Cloning via Python

from core.synth_n_recog import clone_voice

result = clone_voice("/path/to/voice_sample.mp3", "myvoice", language="English (U.S.)")
print(result)
# {"status": "started", "message": "...", "pid": 12345, ...}

Note: Voice cloning runs asynchronously as a background subprocess. The .onnx model file is not produced automatically — the dataset preparation is the first step. Full model training requires the Piper training environment with GPU support.

Voice Recognition (Speech-to-Text)

RIGEL uses OpenAI Whisper for accurate, local speech recognition supporting multiple model sizes:

Available Models

  • tiny: Fastest, good for real-time processing
  • base: Balanced speed and accuracy
  • small: Better accuracy, slower processing
  • medium: High accuracy for most use cases
  • large: Best accuracy, slowest processing

Using Voice Recognition

from pydbus import SessionBus

bus = SessionBus()
service = bus.get("com.rigel.RigelService")

# Transcribe audio file
transcription = service.RecognizeAudio("/path/to/audio.wav", "tiny")
print(f"Transcription: {transcription}")

# Use different model for better accuracy
transcription = service.RecognizeAudio("/path/to/audio.wav", "base")

Direct Python Usage

from core.synth_n_recog import Recognizer

# Initialize recognizer with desired model
recognizer = Recognizer(model="tiny")

# Transcribe audio file
transcription = recognizer.transcribe("/path/to/audio.wav")
print(f"Transcription: {transcription}")

Live Voice Recognition (whisper.cpp Streaming)

RIGEL includes a live voice recognition mode powered by whisper.cpp (whisper-stream binary), enabling real-time audio capture and transcription with lower latency than the Python Whisper backend.

Available Models (ggml format)

Pre-bundled models in core/whisper_live/models/:

  • tiny.en (75 MB) - Fastest, English-only (default)
  • base.en (142 MB) - Balanced speed/accuracy, English-only
  • small.en (466 MB) - Better accuracy, English-only

Using Live Voice Recognition (D-Bus)

Live voice recognition streams transcription results via DBus signals. Call LiveVoiceRecognition("start", ...) to begin capture, then subscribe to TranscriptionUpdate signals to receive each line in real time.

from pydbus import SessionBus
import json
from gi.repository import GLib

bus = SessionBus()
service = bus.get("com.rigel.RigelService")

# Subscribe to live transcription signals
def on_transcription(text):
    print(f"[LIVE] {text}")

service.TranscriptionUpdate.connect(on_transcription)

# Start live capture from default audio device
result = service.LiveVoiceRecognition("start", json.dumps({
    "model": "tiny.en",
    "capture_device": -1,
    "threads": 8,
    "step": 500,
    "length": 5000
}))
print(result)  # {"status": "started", "model": "tiny.en", ...}

# ... transcription lines arrive via on_transcription callback ...

# Check status
status = service.LiveVoiceRecognition("status", "{}")

# Stop capture
result = service.LiveVoiceRecognition("stop", "{}")

# Transcribe a file with whisper.cpp
result = service.LiveVoiceRecognition("transcribe_file", json.dumps({
    "model": "tiny.en",
    "file_path": "/path/to/audio.wav"
}))
print(result)  # {"status": "completed", "transcription": "..."}

Using Live Voice Recognition (WebSocket)

// Connect with API key
const ws = new WebSocket("ws://localhost:8000/live-voice-recognition?api_key=rigel_your_key");

// Receive server messages
ws.onmessage = (event) => {
    const msg = JSON.parse(event.data);
    if (msg.type === "transcription" || msg.type === "done") {
        console.log("Transcription:", msg.text);
    }
};

// Send binary audio chunks (WAV format, 16kHz mono 16-bit)
ws.send(audioChunk);  // Binary WebSocket frame

// Request interim transcription
ws.send(JSON.stringify({ command: "transcribe" }));

// Update config
ws.send(JSON.stringify({ command: "config", model: "tiny.en", threads: 8 }));

// Reset audio buffer
ws.send(JSON.stringify({ command: "reset" }));

// Close connection to get final transcription
ws.close();

Voice Requirements

System Dependencies

# Install Piper TTS
# Download from: https://github.com/rhasspy/piper/releases
# Ensure 'piper' command is available in PATH

# Install PulseAudio for audio playback
sudo apt-get install pulseaudio pulseaudio-utils  # Ubuntu/Debian
sudo dnf install pulseaudio pulseaudio-utils      # Fedora/RHEL

# Install SDL2 for live voice recognition (whisper-stream audio capture)
sudo apt-get install libsdl2-2.0-0   # Ubuntu/Debian
sudo dnf install SDL2                 # Fedora/RHEL

Python Dependencies

Voice features require additional dependencies included in requirements.txt:

  • openai-whisper: For speech recognition
  • torch, torchaudio, torchvision: PyTorch dependencies for Whisper

Voice Models

  • Piper Models: .onnx voice models stored in core/synthesis_assets/. Default: knight.onnx. Set VOICE env var to select a different model (e.g. VOICE=hal).
  • Whisper Models (Python): Downloaded automatically when first used
  • Whisper.cpp Models (ggml): Pre-bundled in core/whisper_live/models/ for live recognition

D-Bus Voice Endpoints

SynthesizeText(text: str, mode: str, voice: str) -> str

  • Description: Converts text to speech with specified synthesis mode and optional voice override
  • Parameters:
    • text - The text to synthesize
    • mode - Synthesis mode: "chunk" or "linear"
    • voice - (Optional) Voice model name to use (e.g. "knight", "hal"). Empty string uses default.
  • Returns: Status message indicating synthesis queued
  • Use Case: Voice output for AI responses, notifications, accessibility

ListVoices() -> str

  • Description: Returns a JSON string with available voice model names and the currently active voice
  • Returns: JSON string: {"voices": ["hal", "jarvis-medium", "knight"], "current": "knight"}
  • Use Case: Discover available TTS voices, check current voice

SetVoice(voice_name: str) -> str

  • Description: Switch the active voice synthesis model
  • Parameters:
    • voice_name - Name of the voice model (e.g. "hal", "knight")
  • Returns: Status message confirming voice change
  • Use Case: Change TTS voice at runtime without restarting

CloneVoice(mp3_path: str, voice_name: str, language: str) -> str

  • Description: Start the voice cloning pipeline from an MP3 file. Runs asynchronously — returns immediately with task status.
  • Parameters:
    • mp3_path - Path to the source MP3 voice sample
    • voice_name - Name for the cloned voice
    • language - Language code (e.g. "English (U.S.)")
  • Returns: JSON string with status, PID, and output directory
  • Use Case: Create custom voice models from voice samples

RecognizeAudio(audio_file_path: str, model: str) -> str

  • Description: Transcribes audio file to text using Whisper
  • Parameters:
    • audio_file_path - Path to audio file (WAV, MP3, etc.)
    • model - Whisper model size: "tiny", "base", "small", "medium", "large"
  • Returns: Transcribed text from audio
  • Use Case: Voice input processing, audio transcription, accessibility

LiveVoiceRecognition(action: str, config_json: str) -> str

  • Description: Start/stop/check live voice recognition using whisper.cpp streaming. Results are streamed via the TranscriptionUpdate signal — subscribe to com.rigel.RigelService.TranscriptionUpdate to receive live transcription lines.
  • Parameters:
    • action - One of: "start", "stop", "status", "transcribe_file"
    • config_json - JSON string with config:
      • For start: {"model": "tiny.en", "capture_device": -1, "threads": 8, "step": 500, "length": 5000}
      • For transcribe_file: {"model": "tiny.en", "file_path": "/path/to/audio.wav"}
  • Returns: JSON string with status/results (start/stop return immediately; transcription lines arrive via signal)
  • Signal: TranscriptionUpdate(s: text) — emitted for each transcription line from whisper-stream
  • Use Case: Real-time voice transcription from microphone, low-latency audio processing

Subscribing to Live Transcription via DBus Signals

Live voice recognition streams results through DBus signals. Once LiveVoiceRecognition("start", ...) is called, each transcribed line is emitted as a TranscriptionUpdate signal. Clients subscribe to this signal to receive transcription in real time.

Python Client Example

from pydbus import SessionBus
from gi.repository import GLib
import json

bus = SessionBus()
service = bus.get("com.rigel.RigelService")

# Track accumulated transcription
transcription_lines = []

def on_transcription(text):
    """Called in real time for each transcribed line."""
    transcription_lines.append(text)
    print(f"\r> {text}", flush=True)

# Subscribe to the signal BEFORE starting capture
service.TranscriptionUpdate.connect(on_transcription)
print("Subscribed to TranscriptionUpdate signal")

# Start live capture
result = service.LiveVoiceRecognition("start", json.dumps({
    "model": "tiny.en",
    "capture_device": -1,
    "threads": 8,
    "step": 500,
    "length": 5000
}))
print(f"Capture started: {result}")

# Keep the event loop running to receive signals
try:
    loop = GLib.MainLoop()
    loop.run()
except KeyboardInterrupt:
    # Stop capture on Ctrl+C
    service.LiveVoiceRecognition("stop", "{}")
    print("\n\nFull transcription:")
    print(" ".join(transcription_lines))

Shell / CLI Test

# Monitor live transcription from the command line
dbus-monitor --session "interface='com.rigel.RigelService',member='TranscriptionUpdate'"

# In another terminal, start capture:
dbus-send --session --print-reply \
  --dest=com.rigel.RigelService \
  /com/rigel/RigelService \
  com.rigel.RigelService.LiveVoiceRecognition \
  string:"start" string:'{"model":"tiny.en"}'

Signal Reference

Signal Argument Description
TranscriptionUpdate s text A transcribed line from live capture

The signal is emitted on the com.rigel.RigelService interface. Connect your handler before calling start to avoid missing early transcription lines.

Basic Usage with Ollama

from core.rigel import RigelOllama

# Initialize RIGEL with Ollama backend
rigel = RigelOllama(model_name="llama3.2")

# Define your messages
messages = [
    ("system", "You are RIGEL, a helpful assistant"),
    ("human", "Hello! How can you help me today?"),
]

# Get response
response = rigel.inference(messages=messages)
print(response.content)

Basic Usage with Groq

from core.rigel import RigelGroq
import os

# Set your Groq API key
os.environ["GROQ_API_KEY"] = "your-groq-api-key-here"

# Initialize RIGEL with Groq backend
rigel = RigelGroq(model_name="llama3-70b-8192")

# Define your messages
messages = [
    ("system", "You are RIGEL, a helpful assistant"),
    ("human", "What's the weather like today?"),
]

# Get response
response = rigel.inference(messages=messages)
print(response.content)

Usage with Memory

from core.rigel import RigelOllama

# Initialize RIGEL with Ollama backend
rigel = RigelOllama(model_name="llama3.2")

# Define your messages with memory support
messages = [
    ("human", "My name is John. Remember this!"),
]

# Get response with memory
response = rigel.inference_with_memory(messages=messages, thread_id="conversation1")
print(response.content)

# Continue conversation - RIGEL will remember previous context
follow_up = [
    ("human", "What's my name?"),
]

response2 = rigel.inference_with_memory(messages=follow_up, thread_id="conversation1")
print(response2.content)  # Should remember the name is John

# Get conversation history
history = rigel.get_conversation_history(thread_id="conversation1")
print(f"Conversation has {len(history)} messages")

# Clear memory when needed
rigel.clear_memory(thread_id="conversation1")

Visual Inference

RIGEL supports visual inference with vision-capable models, allowing you to analyze images and ask questions about them.

Supported Vision Models

  • Ollama: llava, llava-llama3, bakllava, moondream
  • Groq: llama-3.2-90b-vision-preview, llama-3.2-11b-vision-preview

Basic Visual Inference

from core.rigel import RigelOllama, RigelGroq

# Using Ollama with a vision model
rigel = RigelOllama(model_name="llava")

# Analyze a local image
response = rigel.visual_inference(
    prompt="What's in this image?",
    image_source="/path/to/image.jpg"
)
print(response.content)

# Analyze an image from URL
response = rigel.visual_inference(
    prompt="Describe what you see",
    image_source="https://example.com/image.png"
)
print(response.content)

# Analyze multiple images
response = rigel.visual_inference(
    prompt="Compare these two images",
    image_source=["/path/to/image1.jpg", "/path/to/image2.jpg"]
)
print(response.content)

Visual Inference with Groq

import os
os.environ["GROQ_API_KEY"] = "your-groq-api-key"

rigel = RigelGroq(model_name="llama-3.2-11b-vision-preview")

response = rigel.visual_inference(
    prompt="Analyze this diagram and explain what it shows",
    image_source="/path/to/diagram.png",
    detail="high"  # Use high detail for complex images
)
print(response.content)

Visual Inference with Memory

import asyncio
from core.rigel import RigelOllama

rigel = RigelOllama(model_name="llava")

async def analyze_with_context():
    # First analysis
    response1 = await rigel.visual_inference_with_memory(
        prompt="What objects do you see in this image?",
        image_source="/path/to/image.jpg",
        thread_id="visual_chat"
    )
    print(response1.content)
    
    # Follow-up question (remembers context)
    response2 = await rigel.visual_inference_with_memory(
        prompt="What colors are those objects?",
        image_source="/path/to/image.jpg",
        thread_id="visual_chat"
    )
    print(response2.content)

asyncio.run(analyze_with_context())

Image Source Options

The image_source parameter accepts:

  • Local file path: "/path/to/image.jpg"
  • URL: "https://example.com/image.png"
  • Raw bytes: image_bytes
  • List of any combination: ["/path/to/img1.jpg", "https://example.com/img2.png"]

Detail Levels

The detail parameter controls image analysis depth:

  • "auto" (default): Let the model decide
  • "low": Faster processing, less detail
  • "high": More thorough analysis, slower

Project Structure

RIGEL_SERVICE/
├── core/
│   ├── rigel.py          # Main RIGEL engine classes
│   ├── logger.py         # Logging utilities
│   ├── rdb.py            # RAG database functionality
│   ├── synth_n_recog.py  # Voice synthesis and recognition
│   ├── whisper_live/     # whisper.cpp binaries and models for live voice recog
│   │   ├── whisp