Skip to main content

Helix AI Agent โ€” Self-hosted, provider-agnostic AI agent with memory, plugins, and CLI

Project description

Helix AI Agent ๐ŸŒŠ

A self-hosted, provider-agnostic AI Agent Framework that learns, remembers, and adapts to each user.

Phase 1: Core Foundation โœ…

Features

  • โœ… Provider-Agnostic: Works with OpenAI, Anthropic, Ollama, or any OpenAI-compatible API
  • โœ… Self-Hosted: User owns all data (local ChromaDB)
  • โœ… Memory: Conversation history with ChromaDB vector storage
  • โœ… Onboarding: Personality formation through first conversation
  • โœ… Telegram: Full Telegram bot interface

Phase 2: Smart Memory โœ…

Features

  • โœ… Memory Compression: Summarizes long conversations to reduce token usage
  • โœ… Smart Context Retrieval: Semantic search for relevant facts
  • โœ… Token Tracking: Cost monitoring and budget alerts
  • โœ… Error Learning: Tracks mistakes and learns to avoid them
  • โœ… Auto Fact Extraction: Automatically extracts user facts from conversations

Phase 3: Tools & Safety โœ…

Features

  • โœ… Safe SSH Client: Remote server management with approval system
  • โœ… File Operations: Read/write with sandbox and backup
  • โœ… API Caller: Generic HTTP client for external APIs
  • โœ… Obedience Engine: Safety layer for dangerous operations
  • โœ… Docker Support: Production-ready containerization

Phase 4: Voice & Production Polish โœ…

Features

  • โœ… Voice Input: Whisper API (cloud-based) + Nemotron ASR (local fallback)
  • โœ… Health Monitoring: System health checks for all components
  • โœ… Production Logging: Advanced logging with rotation
  • โœ… Rate Limiting: Request throttling protection
  • โœ… Complete Documentation: Full deployment guides

Phase 5: Vision & OCR โœ…

Features

  • โœ… Image OCR: Extract text from images using EasyOCR (Arabic + English)
  • โœ… Image Processing: Automatic resize, format conversion
  • โœ… Async Processing: Non-blocking with timeout protection
  • โœ… Memory Persistence: Fixed CHROMA_PATH environment variable

Phase 6: Plugin Architecture โœ… (Complete)

Features

  • โœ… Dynamic Plugins: Load features without restart
  • โœ… Plugin Registry: Easy install/uninstall
  • โœ… Hot Reload: Enable/disable on the fly
  • โœ… Safe Mode: Plugins can't break core
  • โœ… 5 Active Plugins: OCR, Voice, SSH, Web Search, File Ops

Available Plugins

Plugin Status Description
ocr โœ… Ready Extract text from images
voice โœ… Ready Speech-to-text with Whisper
ssh ๐Ÿ”„ Ready Remote server management
memory โœ… Ready ChromaDB conversation storage
file_ops โœ… Ready Safe file read/write
web_search โœ… Ready Search the web
code_exec ๐Ÿ”ด Planned Safe code execution

Quick Start

1. Clone and Setup

cd helix
pip install -r requirements.txt

2. Configure

# Copy example files
cp .env.example .env
cp config/config.example.yaml config/config.yaml

# Edit .env with your API keys
nano .env

3. Run

python run.py

Configuration

Environment Variables (.env)

OPENAI_API_KEY=sk-your-key-here
TELEGRAM_BOT_TOKEN=your-telegram-token

Config File (config/config.yaml)

providers:
  default: "openai"  # or "anthropic", "ollama"
  
agent:
  language: "ar"     # or "en"

๐Ÿš€ Deployment Guide

Method 1: Docker Compose (Recommended for Beginners)

The easiest way to deploy Helix on any server with Docker support.

Step 1: Prepare Your Server

# Install Docker & Docker Compose
curl -fsSL https://get.docker.com | sh

Step 2: Download Helix

# Clone the repository
git clone https://github.com/Nabilkarem911/Helix.git
cd Helix

# Or just download the files you need:
# - docker-compose.yml
# - docker/Dockerfile
# - .env.example

Step 3: Configure Environment

# Copy environment template
cp .env.example .env

# Edit with your values
nano .env

.env file:

# Required: Telegram Bot Token (get from @BotFather)
TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrSTUvwxyz

# Required: At least one LLM provider
OPENAI_API_KEY=sk-your-openai-key-here
# Or: ANTHROPIC_API_KEY=sk-ant-your-key-here

# Optional: Settings
DEFAULT_PROVIDER=openai
ENABLE_COMPRESSION=false

# Phase 4: Enable Voice (optional)
ENABLE_VOICE=false
ASR_MODEL_PATH=./models/nemotron-3.5-asr-q4_0.gguf

Optional: Voice Setup (Phase 4)

To enable voice message support:

# 1. Download Nemotron ASR model
mkdir -p models
cd models
wget https://huggingface.co/mudler/parakeet-cpp-gguf/resolve/main/nemotron-3.5-asr-q4_0.gguf

# 2. Enable in config
echo 'ENABLE_VOICE=true' >> .env

# 3. Restart Helix
docker-compose restart

Features:

  • ๐ŸŽค 40+ languages supported
  • ๐Ÿง  0.6B parameters (lightweight)
  • ๐Ÿ’ป CPU-only (no GPU needed)
  • โšก 2.5x faster than NVIDIA NeMo

Step 4: Deploy!

# Start Helix
docker-compose up -d

# Check logs
docker-compose logs -f helix

# Stop Helix
docker-compose down

# Update to new version
git pull
docker-compose down
docker-compose up -d --build

Method 2: Dokploy (One-Click Deployment)

Deploy on Dokploy or similar platforms (Railway, Coolify, etc.)

Step 1: Fork/Clone Repository

Fork this repo to your GitHub account.

Step 2: Connect to Dokploy

  1. Log in to Dokploy dashboard
  2. Click "Create Service" โ†’ "Template"
  3. Select "Docker Compose"
  4. Connect your GitHub account
  5. Choose the forked Helix repository

Step 3: Add Environment Variables

In Dokploy dashboard, add these environment variables:

Variable Value Required
TELEGRAM_BOT_TOKEN Your bot token โœ… Yes
OPENAI_API_KEY Your OpenAI key โœ…*
ANTHROPIC_API_KEY Your Anthropic key โœ…*
DEFAULT_PROVIDER openai or anthropic No (default: openai)

* At least one provider key required

Step 4: Deploy

Click "Deploy" and wait for build to complete.

Helix will start automatically and connect to Telegram.

๐Ÿ“– Detailed Guide: See DOKPLOY_DEPLOY.md for complete step-by-step instructions with troubleshooting.


Method 3: Manual Installation (Advanced)

For servers without Docker or custom setups.

Requirements

  • Python 3.11+
  • pip
  • git

Installation Steps

# 1. Clone repository
git clone https://github.com/Nabilkarem911/Helix.git
cd Helix

# 2. Create virtual environment
python -m venv venv
source venv/bin/activate  # Linux/Mac
# or: venv\Scripts\activate  # Windows

# 3. Install dependencies
pip install -r requirements.txt

# 4. Install as command (optional, for CLI mode)
pip install -e .

# 5. Configure
cp .env.example .env
# Edit .env and add your API keys

# 6. Run โ€” choose your mode:
python run.py                           # Telegram mode (default)
python run.py --interface api           # HTTP API only
python run.py --interface both          # Telegram + API
python run.py --cli                     # Interactive CLI mode

# Or if you installed with pip install -e .:
helix --cli                             # CLI in any directory
helix --interface telegram              # Telegram bot
helix --interface api                   # API server
helix --interface both                  # Both Telegram + API

Using Systemd (Linux Servers)

# Create service file
sudo nano /etc/systemd/system/helix.service

Service file content:

[Unit]
Description=Helix AI Agent
After=network.target

[Service]
Type=simple
User=your-username
WorkingDirectory=/path/to/Helix
Environment=PYTHONUNBUFFERED=1
ExecStart=/path/to/Helix/venv/bin/python run.py
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
# Enable and start service
sudo systemctl enable helix
sudo systemctl start helix

# Check status
sudo systemctl status helix
sudo journalctl -u helix -f

Method 4: Custom API Proxy (Orcanox, etc.)

Use a unified API proxy that combines multiple providers.

.env:

TELEGRAM_BOT_TOKEN=your-telegram-token
OPENAI_API_KEY=your-api-key-here

config/config.yaml:

providers:
  default: "openai"
  openai:
    api_key: "${OPENAI_API_KEY}"
    base_url: "https://api.orcanox.xyz/v1"  # Custom proxy URL
    model: "gpt-4o"
    temperature: 0.7

Post-Deployment: Verify Installation

After deployment, verify everything works:

# Check container is running
docker ps | grep helix

# Check logs
docker-compose logs helix

# Test Telegram bot
# 1. Open Telegram
# 2. Find your bot (by username you created with @BotFather)
# 3. Send /start
# 4. You should receive welcome message

Updating Helix

# Using Docker Compose
cd /path/to/Helix
git pull                    # Get latest code
docker-compose down        # Stop old version
docker-compose up -d --build  # Build and start new version

# Using manual installation
git pull
source venv/bin/activate
pip install -r requirements.txt  # In case deps changed
python run.py

Troubleshooting

Container keeps restarting

# Check logs for errors
docker-compose logs helix

# Common issues:
# 1. Missing TELEGRAM_BOT_TOKEN
# 2. Invalid API key
# 3. Network issues

Bot not responding in Telegram

  1. Check bot token is correct in .env
  2. Verify bot is started with @BotFather
  3. Check logs: docker-compose logs -f helix
  4. Try sending /start again

Permission denied errors

# Fix data directory permissions
sudo chown -R $USER:$USER ./data
# Or for Docker:
sudo chown -R 1000:1000 ./data

Architecture

helix/
โ”œโ”€โ”€ helix_core/              # Core system (lightweight)
โ”‚   โ”œโ”€โ”€ config_loader.py     # Pydantic config
โ”‚   โ”œโ”€โ”€ core.py               # Main orchestrator
โ”‚   โ”œโ”€โ”€ providers/            # LLM providers
โ”‚   โ”‚   โ”œโ”€โ”€ openai_provider.py
โ”‚   โ”‚   โ”œโ”€โ”€ anthropic_provider.py
โ”‚   โ”‚   โ””โ”€โ”€ router.py
โ”‚   โ”œโ”€โ”€ memory/               # ChromaDB storage
โ”‚   โ”‚   โ””โ”€โ”€ chroma_store.py
โ”‚   โ”œโ”€โ”€ plugins/              # โœ… Plugin system (Phase 6)
โ”‚   โ”‚   โ”œโ”€โ”€ manager.py
โ”‚   โ”‚   โ””โ”€โ”€ base.py
โ”‚   โ””โ”€โ”€ safety/               # Security layer
โ”‚       โ””โ”€โ”€ obedience.py
โ”œโ”€โ”€ plugins/                  # ๐Ÿ”„ Dynamic plugins
โ”‚   โ”œโ”€โ”€ ocr/                  # โœ… Phase 5
โ”‚   โ”œโ”€โ”€ voice/                # โœ… Phase 4
โ”‚   โ””โ”€โ”€ web_search/           # ๐Ÿ”ด Planned
โ”œโ”€โ”€ interfaces/
โ”‚   โ””โ”€โ”€ telegram_bot.py       # Telegram interface
โ”œโ”€โ”€ docker/
โ”‚   โ””โ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ config.example.yaml
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ requirements.txt

Usage

First Conversation (Onboarding)

When user first messages the bot:

User: Hello!
Helix: Hello! I'm Helix, your AI companion. ๐ŸŒŸ

To get started, I'd love to know:
1. What would you like to name me?
2. How would you describe my role?

Just reply with something like: "Name me Sara, you're my assistant"

User: Name me Luna, you're my friend
Helix: Perfect! I'm now Luna, your friend. How can I help you?

Commands

Command Description
/start Start conversation
/help Show help
/stats Memory, learning & tools statistics
/tokens Detailed token usage & cost report
/lessons Learned lessons from past errors
/clear Clear conversation history
/memory Show stored user facts
/remind Set a reminder
/monitor Server health monitoring
/plugins Manage plugins (list, enable, disable)
/connect Connect to SSH server
/exec Execute SSH command
/servers List connected servers
/search Web search
/read Read a file from server
/write Write a file to server
/ls List files on server
/skills Manage knowledge base skills
/alert Smart monitoring alerts
/approve Approve a dangerous command
/reject Reject a dangerous command
/pending List pending approvals
/stop Cancel current operation

CLI Mode (helix --cli):

Command Description
/tree [depth] Show project file tree
/read <file> Read file with syntax highlight
/ls [dir] List files
/undo Undo last file edit
/history Show edit history
/diff Show pending edits
/approve [id] Approve file edit
/reject [id] Reject file edit

CLI Mode (Phase 7)

Run Helix directly in your terminal with project awareness:

# 1. Clone the repo
git clone https://github.com/Nabilkarem911/Helix.git
cd Helix

# 2. Install dependencies
pip install -r requirements.txt

# 3. Install as command (one-time)
pip install -e .

# 4. Configure your API key
cp .env.example .env
# Edit .env and add your keys

# 5. Start CLI in any project directory
cd /path/to/your-project
helix --cli
# or without installing: python run.py --cli

Interactive terminal features:

  • ๐Ÿ—‚๏ธ Project scanner โ€” auto-detects type (Python, Node, etc.)
  • ๐Ÿ“ File tree โ€” /tree shows project structure
  • ๐Ÿ“– Syntax-highlighted file reading โ€” /read src/app.py
  • ๐Ÿ“ Safe editing โ€” diff preview + approval gate before any file change
  • โ†ฉ๏ธ Undo stack โ€” /undo reverts last edit
  • ๐Ÿง  Shared memory โ€” same profile from Telegram
$ helix --cli
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘     ๐ŸŒŠ H E L I X  C L I               โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐ŸŒ€ Helix โ€” your developer
Project: my-project (python)
โœ“ Found 42 files

> /read main.py
๐Ÿ“„ main.py
  1 | import os
  2 | def main():
  ...

> add logging to main.py
๐ŸŒ€ Helix: I'll add logging. Here's the diff:
--- a/main.py
+++ b/main.py
+ import logging
...

Approve this edit? [y/n]: y
โœ“ Edited main.py

> /exit
๐ŸŒ€ Goodbye!

Natural Language Triggers

  • Learn skills: "ุงุชุนู„ู…ูŠ [URL]" or "learn [URL]"
  • Set alerts: "ู†ุจู‡ูŠู†ูŠ ู„ูˆ CPU ูˆุตู„ 90%" or "alert me if..."
  • Ask for commands: "ุงูŠู‡ ุงู„ุงูˆุงู…ุฑ" or "what commands" โ†’ shows full list
  • Voice: Send voice message for transcription
  • Photos: Send image for GPT-4o vision analysis

Providers Supported

Provider Status Notes
OpenAI โœ… Ready GPT-4, GPT-4o-mini, etc.
Anthropic โœ… Ready Claude 3 Haiku, Sonnet, etc.
Ollama โœ… Ready Local models (Llama, etc.)

Roadmap

  • Phase 1 โœ…: Core Foundation (Provider-agnostic, Memory, Telegram)
  • Phase 2 โœ…: Smart Memory (Compression, Token tracking, Error learning)
  • Phase 3 โœ…: Tools (SSH, files), Safety layer, Docker
  • Phase 4 โœ…: Voice (Whisper API + Nemotron), Health monitoring
  • Phase 5 โœ…: Vision OCR (EasyOCR), Memory persistence fix
  • Phase 6 โœ…: Plugin Architecture (dynamic loading, hot reload, dependency management)
  • Phase 7 โœ…: CLI Mode (interactive terminal, project awareness, diff preview, undo)

Project Status

Helix is a production-ready AI Agent Framework with:

  • ๐Ÿค– Multi-provider LLM support
  • ๐Ÿง  Persistent memory with ChromaDB
  • ๐Ÿ› ๏ธ Safe tool execution
  • ๐ŸŽค Voice input capability
  • ๐Ÿ‘๏ธ OCR for images
  • ๐Ÿณ Docker deployment
  • ๐Ÿ“Š Health monitoring
  • ๐Ÿ’ป Interactive CLI with project awareness & diff preview

Quick Feature Toggle (via Environment Variables)

# Core (Required)
TELEGRAM_BOT_TOKEN=your-token
OPENAI_API_KEY=your-key

# Features (Optional)
ENABLE_VOICE=true          # Voice messages
ENABLE_OCR=true            # Image text extraction
ENABLE_SSH=false           # Remote server access
ENABLE_FILE_OPS=false      # File management

โš ๏ธ Security Notice

Helix can execute system commands when enabled.

Safety Features:

  • โœ… Approval System: Destructive actions require manual approval
  • โœ… Sandbox: File operations restricted to allowed paths
  • โœ… Dry-run Mode: Preview SSH commands before execution
  • โœ… Audit Log: All actions are logged

Enable Tools (Optional):

# config/config.yaml
tools:
  ssh:
    enabled: true
    require_approval: true
    allowed_hosts: ["trusted-server.com"]
  
  file_ops:
    enabled: true
    allowed_paths: ["./data/"]

Warning: Only enable tools if you trust the LLM and understand the risks. SSH/file operations can damage your system.

License

MIT License - Self-hosted for everyone.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helix_nox-1.0.4.tar.gz (115.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

helix_nox-1.0.4-py3-none-any.whl (127.3 kB view details)

Uploaded Python 3

File details

Details for the file helix_nox-1.0.4.tar.gz.

File metadata

  • Download URL: helix_nox-1.0.4.tar.gz
  • Upload date:
  • Size: 115.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for helix_nox-1.0.4.tar.gz
Algorithm Hash digest
SHA256 b7a261ce9ddeea4806a7ab6678d13ee9337cc7c360c41a0a0253ac0ede1c94f5
MD5 5ee672ecb985d4357ba2f56261fec2ef
BLAKE2b-256 341c6d9e3d40b817c3aca4ce54d32f4d971f1367b95892bfcb91feaca0a9c7fd

See more details on using hashes here.

File details

Details for the file helix_nox-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: helix_nox-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 127.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for helix_nox-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ade5167001e11681aa6148d2d96d8f03b19a0dd879e4caae4bf8bfdaa565865a
MD5 8d3fddfc3e03d240bc197ede5b8d6b75
BLAKE2b-256 66060d2f3204e66351eb8347aca1c4f15dc626e0838fb62e60a9893646dc52b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page