An intelligent Android assistant powered by Koog AI Agent Framework that integrates with Termux to execute shell commands, manage files, and automate tasks through natural language conversations.
- Natural Language Control: Interact with your device using conversational AI
- DeepSeek Integration: Powered by DeepSeek LLM for intelligent responses
- Contextual Memory: Maintains conversation history and persistent memory
- Background Execution: Run commands silently and capture output
- Foreground Execution: Open interactive terminal sessions
- Complete Result Handling: Capture stdout, stderr, and exit codes
- File Operations: Read/write files through AI agent tools
- Scheduled Tasks: Automate command execution at specific times
- Flexible Frequencies: Support for daily, weekly, and weekday schedules
- Boot Persistence: Automatically reschedule tasks after device reboot
- Notification Support: Display task execution status
- Language: Kotlin 2.3.10
- UI Framework: Jetpack Compose + Material 3
- AI Framework: Koog Agents 0.7.3
- Minimum SDK: 33 (Android 13)
- Target SDK: 36 (Android 15)
- Compile SDK: 36
- Termux - Terminal emulator (F-Droid or Play Store)
- Termux:API - API integration package
- Android Studio Hedgehog or later
- Gradle 8.13.2
- JDK 17
git clone https://github.com/yourusername/localagent.git
cd localagentDownload both from the same source (both from F-Droid OR both from Play Store):
Open Termux and run:
# Update packages
pkg update && pkg upgrade
# Install termux-api
pkg install termux-api
# Grant storage access
termux-setup-storage
# Enable external app integration
echo "allow-external-apps=true" >> ~/.termux/termux.propertiesOn your Android device:
- Go to Settings β Apps β Termux β Permissions
- Grant all permissions (Storage, Display over other apps, etc.)
- Disable battery optimization for Termux
./gradlew assembleDebugInstall the APK on your device:
adb install app/build/outputs/apk/debug/app-debug.apkOr use Android Studio's Run button.
- Open LocalAgent app
- Grant
RUN_COMMANDpermission when prompted - Navigate to Settings and configure your DeepSeek API key
- Optionally customize the system prompt
- Type a message in the chat input (e.g., "List all files in home directory")
- The AI agent will analyze your request
- It will use appropriate tools (Termux commands, file operations, etc.)
- View the response with formatted output
Try these examples:
- "Show me the current directory structure"
- "Create a file named test.txt with hello world content"
- "What's my device's IP address?"
- "Run a ping test to google.com"
- "Show me running processes"
- "Backup my important files to /sdcard"
- Navigate to Scheduled Tasks from the chat screen
- Create a new task with:
- Command to execute
- Frequency (Daily, Weekly, Weekdays)
- Time of execution
- Enable the task
- The app will automatically execute it at the scheduled time
The AI maintains two types of memory:
- Conversation History: Chat messages within each session
- Persistent Memory: Long-term knowledge updated via the
UpdateMemoryTool
Example:
"Remember that I work as a developer and prefer Python scripts"
- Validate Inputs: Always review AI-suggested commands before execution
- Limited Access: Only grant necessary permissions to Termux
- Sandbox Environment: Commands run within Termux's sandboxed environment
- Audit Logs: Review command history regularly
- API Key Safety: Never commit your API key to version control
The app requires the following permissions (declared in AndroidManifest.xml):
INTERNET- API calls to DeepSeekACCESS_NETWORK_STATE- Network connectivity checksWRITE_EXTERNAL_STORAGE- File operations (Android β€ 12)com.termux.permission.RUN_COMMAND- Termux integrationSCHEDULE_EXACT_ALARM- Task schedulingPOST_NOTIFICATIONS- Task notificationsRECEIVE_BOOT_COMPLETED- Auto-start on bootFOREGROUND_SERVICE_*- Background task execution
Customize the AI's behavior in Settings:
You are a security-focused Android assistant. Always warn users before
executing potentially dangerous commands.
Modify tool implementations in agent/tools/ to:
- Add command whitelisting
- Implement additional safety checks
- Extend functionality
Solution: Ensure Termux is installed and the <queries> tag is present in AndroidManifest.xml
Solutions:
- Verify
allow-external-apps=truein~/.termux/termux.properties - Grant RUN_COMMAND permission to LocalAgent
- Check that Termux has necessary permissions
- Disable battery optimization for Termux
Solutions:
- Grant storage permission to Termux
- Run
termux-setup-storagein Termux - For Android 11+, use "Allow management of all files"
Solutions:
- Verify your DeepSeek API key is valid
- Check internet connectivity
- Review OkHttp logs for detailed errors
- Termux - Terminal emulator for Android
- Koog Agents - AI Agent framework by JetBrains
- Project Link: GitHub Repository
- Issue Tracker: GitHub Issues