AgentsDroid Technical Architecture
AgentsDroid is a production-ready, sovereign multi-agent execution environment built specifically for Android. It enables natural language user commands to be transformed into structured graph executions without sending telemetry or requiring root privileges.
1. DAG Task Scheduling Specification
The Master Agent orchestrates multi-agent tasks using Directed Acyclic Graphs (DAG). Incoming goals are decomposed into discrete, typed execution nodes governed by topological sort algorithms:
// app/domain/orchestrator/DAGScheduler.kt
data class TaskNode(
val id: String,
val agentType: AgentType,
val executionGoal: String,
val dependencies: List<String> = emptyList()
)
class DAGScheduler @Inject constructor() {
fun resolveExecutionBatches(nodes: List<TaskNode>): List<List<TaskNode>> {
// Computes in-degree dependency matrix and parallel batches
return topologicalBatchSort(nodes)
}
}
2. Native Accessibility UI Driver
AgentsDroid uses Android's Accessibility framework to interact directly with installed third-party applications. By inspecting the active window's node hierarchy, it performs clicks, scrolls, and text input safely:
// app/device/automation/action/ActionDispatcher.kt
suspend fun dispatchClick(nodeInfo: AccessibilityNodeInfo): Boolean {
val clickAction = AccessibilityNodeInfo.AccessibilityAction.ACTION_CLICK
return nodeInfo.performAction(clickAction.id)
}
3. 5-Tier Memory Architecture
To operate within mobile RAM quotas, context is segmented into five lifecycle tiers:
- Sensory Memory: Active screen node caches and real-time UI observations.
- Working Memory: Ephemeral parameters passed along DAG dependencies.
- Episodic Memory: Historical task execution records stored in Room SQLite (30-day retention).
- Semantic Memory: Knowledge graphs and long-term user preferences.
- Procedural Memory: Learned automation coordinate maps and gesture macros.
4. Hardware Keystore AES-256 GCM Security
All credentials for LLM endpoints (OpenAI, Gemini, Claude, Groq) are secured via Android Keystore. Plaintext tokens are strictly forbidden from being written to persistent storage or unencrypted shared preferences.
5. Sovereign Local Ollama Setup
To run completely private and offline, host an Ollama instance on your local Wi-Fi network and bind the host address:
# On your local workstation
OLLAMA_HOST=0.0.0.0:11434 ollama serve
# In AgentsDroid configuration:
Endpoint: http://192.168.1.X:11434
Target Model: llama3:8b