Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ixi6/hermes-agent-android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚕ Hermes Agent on Android / هيرميس على أندرويد

License: Apache 2.0 Platform: Android Termux

Run the Hermes Agent — a self-improving AI agent by Nous Research — directly on your Android phone via Termux.

شغّل وكيل هيرميس الذكي — الوكيل ذاتي التطوير من Nous Research — مباشرةً على هاتفك الأندرويد عبر Termux.


📱 What is this? / ما هذا المشروع؟

EN: This repository provides everything you need to install and run Hermes Agent on an Android phone using Termux. It includes a custom installer script, Android-specific patches, and step-by-step guides. No root required. No laptop needed.

AR: هذا المستودع يوفر كل ما تحتاجه لتثبيت وتشغيل وكيل هيرميس على هاتف أندرويد باستخدام Termux. يحتوي على سكريبت تثبيت مخصص، تصحيحات خاصة بأندرويد، وأدلة خطوة بخطوة. بدون روت. بدون لابتوب.

Hermes Agent is a self-improving AI agent that / وكيل هيرميس هو وكيل ذكاء اصطناعي ذاتي التطوير:

  • Learns from experience and creates its own skills / يتعلم من التجارب وينشئ مهاراته الخاصة
  • Works with any LLM (OpenAI, Anthropic, OpenRouter, NVIDIA NIM, local Ollama, etc.) / يعمل مع أي نموذج لغوي
  • Connects to Telegram, Discord, Slack, WhatsApp, Signal / يتصل بتيليغرام، ديسكورد، سلاك، واتساب، سيغنال
  • Runs scheduled automations (cron) / يشغّل أتمتة مجدولة
  • Has long-term memory and cross-session recall / يمتلك ذاكرة طويلة المدى واستدعاء عبر الجلسات

⚡ Quick Install (One Command) / تثبيت سريع (أمر واحد)

EN: Make sure you have Termux installed from F-Droid (NOT Google Play — outdated), then run:

AR: تأكد من تثبيت Termux من F-Droid (وليس Google Play — النسخة قديمة)، ثم نفّذ:

curl -fsSL https://raw.githubusercontent.com/leecoin06-commits/hermes-agent-android/main/install-android.sh | bash

EN: This single command will:

  1. ✅ Install all required system packages
  2. ✅ Clone Hermes Agent
  3. ✅ Create a Python virtual environment
  4. ✅ Apply Android-specific patches
  5. ✅ Compile and install all dependencies
  6. ✅ Make hermes available on your Termux PATH

AR: هذا الأمر الواحد سيقوم بـ:

  1. ✅ تثبيت جميع الحزم النظامية المطلوبة
  2. ✅ استنساخ مستودع Hermes Agent
  3. ✅ إنشاء بيئة Python افتراضية
  4. ✅ تطبيق التصحيحات الخاصة بأندرويد
  5. ✅ تجميع وتثبيت جميع الاعتماديات
  6. ✅ جعل أمر hermes متاحاً على مسار Termux

⚠️ EN: The installation takes 10–30 minutes because several packages (pydantic-core, cryptography, uvloop) are compiled from Rust/C source on your phone's ARM processor.

⚠️ AR: التثبيت يستغرق 10–30 دقيقة لأن بعض الحزم الأساسية (pydantic-core، cryptography، uvloop) تُجمّع من شيفرات Rust/C المصدرية على معالج ARM في هاتفك.


📋 Requirements / المتطلبات

Requirement / المتطلب Notes / ملاحظات
Termux EN: Install from F-Droid (NOT Google Play — that version is outdated)
AR: ثبته من F-Droid (وليس Google Play — النسخة قديمة)
Android 7+ / أندرويد 7+ EN: Should work on Android 7 or newer
AR: يعمل على أندرويد 7 أو أحدث
~3 GB free storage / ~3 جيجابايت مساحة حرة EN: For the cloned repo + venv + compiled packages
AR: للمستودع + البيئة الافتراضية + الحزم المترجمة
Internet connection / اتصال إنترنت EN: For cloning and package downloads
AR: لاستنساخ وتحميل الحزم
4 GB+ RAM EN: Recommended for smooth compilation
AR: مُوصى به لتجميع الحزم بسلاسة

🚀 After Installation / بعد التثبيت

1. Initial Setup / الإعداد الأولي

hermes setup

EN: This interactive wizard configures your LLM provider, API keys, default model, and tool preferences.

AR: معالج تفاعلي يساعدك في ضبط مزود النموذج اللغوي، مفاتيح API، النموذج الافتراضي، وتفضيلات الأدوات.

2. Choose a Model / اختيار النموذج

hermes model

EN: Select from:

  • Nous Portal — Free access to Hermes models, no API key needed
  • OpenRouter — 200+ models, pay-as-you-go
  • OpenAI / Anthropic — Your own API keys
  • Local Ollama — Run models locally on your phone (requires Ollama installed separately)

AR: اختر من بين:

  • Nous Portal — وصول مجاني لنماذج Hermes، بدون مفتاح API
  • OpenRouter — 200+ نموذج، ادفع حسب الاستخدام
  • OpenAI / Anthropic — بمفاتيح API الخاصة بك
  • Ollama محلي — شغّل النماذج محلياً على هاتفك (يتطلب تثبيت Ollama منفصلاً)

3. Start Chatting (CLI) / بدء المحادثة

hermes

EN: Opens the full-featured terminal UI with multiline editing, slash-command autocomplete, streaming tool output, and conversation history.

AR: يفتح واجهة طرفية متكاملة مع تحرير متعدد الأسطر، إكمال تلقائي للأوامر، مخرجات أدوات متدفقة، وسجل المحادثات.

4. Set Up Telegram Gateway / إعداد بوابة تيليغرام

hermes gateway setup

EN: Configure your Telegram bot token (get one from @BotFather), then run:

AR: اضبط توكن بوت تيليغرام (احصل عليه من @BotFather)، ثم شغّل:

hermes gateway run

⚠️ EN: If you also run OpenClaw or another agent, use a separate Telegram bot token to avoid conflicts. Two agents cannot share the same bot token.

⚠️ AR: إذا كنت تشغّل OpenClaw أو وكيلاً آخر، استخدم توكن بوت تيليغرام مختلف لتجنب التعارض. لا يمكن لوكيلين مشاركة نفس توكن البوت.


🛠 Manual Installation (Step by Step) / التثبيت اليدوي (خطوة بخطوة)

EN: If the one-liner doesn't work, follow these steps. Each step includes the exact command and Arabic explanation.

AR: إذا لم يعمل الأمر الواحد، اتبع هذه الخطوات. كل خطوة تتضمن الأمر المطلوب والشرح بالعربية.


Step 1 / الخطوة 1: Install System Packages / تثبيت الحزم النظامية

pkg update
pkg install -y git python clang rust make pkg-config libffi openssl nodejs ripgrep ca-certificates curl
pkg install -y python-psutil

EN: These are the build tools and libraries needed to compile Python packages from source. clang, rust, and make handle C/Rust compilation. python-psutil is the Termux system package (PyPI psutil rejects Android).

AR: هذه أدوات البناء والمكتبات اللازمة لتجميع حزم Python من المصدر. clang و rust و make تتولى تجميع C/Rust. python-psutil هي حزمة Termux النظامية (PyPI يرفض تثبيت psutil على أندرويد).


Step 2 / الخطوة 2: Clone Hermes Agent / استنساخ المستودع

mkdir -p ~/.hermes
git clone --recurse-submodules https://github.com/NousResearch/hermes-agent.git ~/.hermes/hermes-agent
cd ~/.hermes/hermes-agent

EN: Creates the Hermes home directory (~/.hermes) and clones the official Hermes Agent repository with all submodules. --recurse-submodules ensures the Atropos RL environment is included.

AR: ينشئ مجلد Hermes الرئيسي (~/.hermes) ويستنسخ مستودع Hermes Agent الرسمي مع جميع الوحدات الفرعية. --recurse-submodules يضمن تضمين بيئة Atropos RL.


Step 3 / الخطوة 3: Create Virtual Environment / إنشاء البيئة الافتراضية

python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install maturin

EN: Creates an isolated Python environment so Hermes dependencies don't conflict with other Python projects. maturin is required to build Rust-based packages (pydantic-core, cryptography). Activate with source venv/bin/activate every time you open a new Termux session.

AR: ينشئ بيئة Python معزولة حتى لا تتعارض اعتماديات Hermes مع مشاريع Python أخرى. maturin مطلوب لبناء الحزم المبنية بـ Rust. فعّل البيئة بـ source venv/bin/activate في كل مرة تفتح جلسة Termux جديدة.


Step 4 / الخطوة 4: Link System psutil / ربط psutil النظامي

VENV_SITE=$(python -c "import site; print(site.getsitepackages()[0])")
echo "/data/data/com.termux/files/usr/lib/python3.13/site-packages" > "$VENV_SITE/system-site.pth"
python -c "import psutil; print('psutil OK:', psutil.__version__)"

EN: Since PyPI's psutil rejects Android, we use Termux's python-psutil system package. This .pth file tells the venv to also search Termux system packages. The last command verifies psutil is accessible from the venv.

AR: بما أن psutil على PyPI يرفض أندرويد، نستخدم حزمة Termux النظامية python-psutil. ملف .pth يخبر البيئة الافتراضية بالبحث أيضاً في حزم Termux النظامية. الأمر الأخير يتأكد أن psutil متاح من البيئة الافتراضية.


Step 5 / الخطوة 5: Patch pyproject.toml / تعديل ملف التبعيات

sed -i 's/"psutil>=5.9.0,<8",/# "psutil>=5.9.0,<8", # Termux provides python-psutil/' pyproject.toml
grep 'psutil' pyproject.toml

EN: Comments out the psutil dependency in Hermes' pyproject.toml since we provide it via the Termux system package. The grep command verifies the change — you should see the line commented out.

AR: يعلّق سطر اعتمادية psutil في ملف pyproject.toml الخاص بـ Hermes بما أننا نوفرها عبر حزمة Termux النظامية. أمر grep يؤكد التعديل — يجب أن ترى السطر مُعلّقاً.


Step 6 / الخطوة 6: Install Hermes / تثبيت Hermes

export ANDROID_API_LEVEL="$(getprop ro.build.version.sdk)"
pip install -e '.[termux-all]' -c constraints-termux.txt

EN: ANDROID_API_LEVEL tells Rust/C build tools which Android SDK version to target (needed for jiter, cryptography, etc.). The .[termux-all] installs the broadest Termux-compatible profile. This step takes 10–30 minutes — you'll see packages being compiled one by one.

AR: ANDROID_API_LEVEL يخبر أدوات بناء Rust/C بإصدار Android SDK المستهدف (ضروري لـ jiter، cryptography، إلخ). .[termux-all] يثبّت أوسع بروفايل متوافق مع Termux. هذه الخطوة تستغرق 10–30 دقيقة — سترى الحزم تُجمّع واحدة تلو الأخرى.

EN: If termux-all fails, try:

pip install -e '.[termux]' -c constraints-termux.txt

AR: إذا فشل termux-all، جرّب:

pip install -e '.[termux]' -c constraints-termux.txt

Step 7 / الخطوة 7: Add hermes to PATH / إضافة الأمر للمسار

ln -sf ~/.hermes/hermes-agent/venv/bin/hermes $PREFIX/bin/hermes

EN: Creates a symbolic link so the hermes command works from any directory in Termux. $PREFIX/bin is already on Termux's PATH.

AR: ينشئ رابطاً رمزياً ليعمل أمر hermes من أي مجلد في Termux. $PREFIX/bin موجود مسبقاً في مسار Termux.


Step 8 / الخطوة 8: Verify Installation / التحقق من التثبيت

hermes version
hermes doctor

EN: hermes version shows the installed version. hermes doctor runs a full diagnostic — checks Python, packages, config files, tools, and API connectivity. Address any issues it reports before proceeding.

AR: hermes version يعرض الإصدار المثبت. hermes doctor يشغّل تشخيصاً كاملاً — يفحص Python والحزم والإعدادات والأدوات والاتصال. عالج أي مشاكل قبل المتابعة.


📁 Repository Structure / هيكل المستودع

hermes-agent-android/
├── README.md                  ← EN/AR guide (you are here / أنت هنا)
├── install-android.sh         ← One-command installer / سكريبت التثبيت
├── patches/
│   ├── README.md              ← Patch documentation / توثيق التصحيحات
│   └── psutil-android.patch   ← psutil dependency patch / تصحيح اعتمادية psutil
├── docs/
│   ├── troubleshooting.md     ← Common issues and fixes / المشاكل الشائعة
│   └── telegram-setup.md      ← Telegram bot configuration / إعداد البوت
└── assets/
    └── banner.png             ← Repository banner / شعار المستودع

🐛 Known Issues & Workarounds / المشاكل المعروفة وحلولها

ffmpeg Linking Error / خطأ ربط ffmpeg

CANNOT LINK EXECUTABLE "ffmpeg": cannot locate symbol "x265_api_get_215"

EN — Impact: TTS/voice message conversion may not work. The core agent, CLI, and Telegram messaging all work fine.

AR — التأثير: قد لا تعمل ميزة تحويل الصوت. الوكيل الأساسي و CLI ومراسلة تيليغرام تعمل بشكل طبيعي.

EN — Fix:

pkg upgrade
dpkg --remove --force-depends ffmpeg
pkg install ffmpeg

AR — الإصلاح:

pkg upgrade
dpkg --remove --force-depends ffmpeg
pkg install ffmpeg

Compilation Hangs / توقف التجميع

EN: The first install takes 10–30 minutes because heavy packages compile from source. If it seems stuck, check with ps -ef | grep rustc — if Rust or Cargo processes are running, it's working.

AR: التثبيت الأول يستغرق 10–30 دقيقة لأن حزماً ثقيلة تُجمّع من المصدر. إذا بدا متوقفاً، تحقق بـ ps -ef | grep rustc — إذا كانت عمليات Rust أو Cargo تعمل، فالتجميع مستمر.


Background Process Killed / قتل العمليات الخلفية

EN: Android kills background processes to save battery. Solutions:

termux-wake-lock              # Keep Termux alive
termux-boot                   # Auto-start on boot

Disable battery optimization for Termux in Android Settings → Apps → Termux → Battery → Unrestricted.

AR: أندرويد يقتل العمليات الخلفية لتوفير البطارية. الحلول:

termux-wake-lock              # إبقاء Termux حياً
termux-boot                   # تشغيل تلقائي عند الإقلاع

عطّل تحسين البطارية لـ Termux في إعدادات أندرويد → التطبيقات → Termux → البطارية → غير مقيد.


Browser Tools / أدوات المتصفح

EN: The browser automation tool (Playwright) is skipped in the Android installer. Browser tooling on Android is experimental.

AR: أداة التشغيل الآلي للمتصفح (Playwright) لا تُثبّت في مسار أندرويد. أدوات المتصفح على أندرويد تجريبية حالياً.

Voice Transcription / تحويل الصوت محلياً

EN: Local faster-whisper is unavailable (ctranslate2 has no Android wheels). Use cloud instead: Groq Whisper (GROQ_API_KEY) or OpenAI Whisper (VOICE_TOOLS_OPENAI_KEY).

AR: التحويل المحلي faster-whisper غير متاح (ctranslate2 لا تنشر حزماً لأندرويد). استخدم السحابة: Groq Whisper (GROQ_API_KEY) أو OpenAI Whisper (VOICE_TOOLS_OPENAI_KEY).


🔄 Coexisting with OpenClaw / التعايش مع OpenClaw

EN: You can run both Hermes Agent and OpenClaw on the same phone. The key is using different Telegram bot tokens:

Agent / الوكيل Bot / البوت How / الطريقة
Hermes Agent Bot #1 / بوت 1 hermes gateway setup → get token from @BotFather
OpenClaw Bot #2 / بوت 2 Configure in OpenClaw → use a different token

AR: يمكنك تشغيل كل من Hermes Agent و OpenClaw على نفس الهاتف. المفتاح هو استخدام توكنات بوت تيليغرام مختلفة. مع توكنات منفصلة، يعمل كلا الوكيلين معاً دون تعارض.


📚 Additional Resources / مصادر إضافية

Resource / المصدر Link / الرابط
Hermes Agent Docs / توثيق هيرميس https://hermes-agent.nousresearch.com/docs/
Hermes Agent GitHub / مستودع هيرميس https://github.com/NousResearch/hermes-agent
Nous Research https://nousresearch.com
Termux Official / موقع Termux https://termux.dev/
Termux on F-Droid https://f-droid.org/packages/com.termux/

🤝 Contributing / المساهمة

EN: Found an issue on Android? Have a fix for a device-specific problem? Open an issue or submit a PR!

AR: وجدت مشكلة على أندرويد؟ لديك حل لمشكلة خاصة بجهاز معين؟ افتح issue أو أرسل PR!

  1. Fork the repo / اعمل fork للمستودع
  2. Create a feature branch / أنشئ فرعاً للميزة
  3. Submit a PR with a clear description / أرسل PR مع وصف واضح

📝 License / الرخصة

EN: Apache 2.0 — same license as Hermes Agent itself (see license).

AR: Apache 2.0 — نفس رخصة Hermes Agent نفسه (راجع الرخصة).


Made with ☕ by the Android agent community — because AI agents shouldn't need a laptop. صُنع بـ ☕ من مجتمع وكلاء أندرويد — لأن وكلاء الذكاء الاصطناعي ينبغي ألا تحتاج لابتوب.

About

Run Hermes Agent (Nous Research) on Android phones via Termux — one-command installer with bilingual EN/AR guides

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%