devd0gu.tr
Back to Project Catalog
Cortex Logo
In Developmentv0.1.0-alpha • AI Agent

Cortex

On-Device Android Phone Assistant & Hybrid Dual-Engine Agent

Anthropic Claude API & Claude for Startups Integration

Cortex leverages Claude 3.5 Sonnet / Haiku to orchestrate system-level intent. Built for the Anthropic Claude for Startups program (claude.com/programs/startups).

Architecture & Purpose

Cortex is an on-device Android assistant that executes system actions in your own language—preferably without ever looking at the screen. System settings (Wi-Fi, Bluetooth, volume, DND) run directly through a Privileged ADB daemon with state read-back verification. A local GGUF model (Qwen2.5 family via llama.cpp JNI and OpenCL on Adreno) uses GBNF grammars to guarantee valid execution with zero data leaving the phone. For complex multi-step reasoning, an optional Claude API fallback can be engaged with automatic local PII masking.

Core Specifications & Features

Privileged Path: ADB over Wi-Fi daemon toggles settings with read-back verification
Local Engine: Qwen2.5-3B via llama.cpp JNI & OpenCL acceleration with GBNF grammar constraints
Capability Router: FastPath chit-chat, offline translation, and macro replay without model overhead
Optional Claude Fallback: SwitchableEngine with Android Keystore encryption & on-device PII masking
Screen-reading fallback: AccessibilityService pipeline for navigating legacy and third-party apps
Dedicated training pipeline: LoRA fine-tuning for AndroidControl datasets in training/

Privacy Perimeter & Runtime Verification

Network Profile:
100% Offline
Commercial Ads:
Zero Ads
Telemetry Trackers:
Zero Trackers
Package / Engine:
Qwen2.5-3B GGUF + Claude 3.5 Fallback
Sample Session & Decision Pipeline
dev.cortex.agent v0.1.0
cortex-daemon ~ Galaxy S24 Ultra (JNI/OpenCL)ONLINE
>turn up the volume
[Privileged Path • Wireless ADB Daemon] No screen-read, zero model cost
media volume 3 → 4 ✓ state verified
>translate to Turkish: meeting is at five
[Capability Router] Dedicated translation module, 100% on-device
"Toplantı saat beşte"
>how are you doing?
[FastPath Chit-chat] Instant response, zero token overhead
Doing great! What can I help you do on your phone today?
>find the flight ticket email and add it to calendar
[SwitchableEngine • Optional Claude 3.5 Sonnet] PII regex masked locally
Multi-step plan synthesized: PII masked locally → Execution dispatched via AccessibilityService.

Decision Hierarchy: "LLM is the Last Resort"

Most mobile agents burn battery by blindly screenshotting the screen. Cortex inverts this with a four-tier hierarchical execution pipeline:

01. FastPath & Privileged ADB0 tokens

System toggles execute straight through Wireless Debugging ADB shell with state read-back verification. Screen stays off.

02. Capability RouterDeterministic

Chit-chat, translation, and user macros route to targeted lightweight handlers without invoking heavy agent reasoning.

03. On-Device llama.cpp100% Local

Qwen2.5-3B loaded via native JNI with OpenCL GPU acceleration. Strict GBNF grammars constrain model output to valid phone actions.

04. Optional Claude APIKeystore Encrypted

Deep multi-step reasoning via Claude 3.5 Sonnet. PII is regex-masked locally; API key stored in Android hardware Keystore.

Engineering Metrics & Repository Audit

Kotlin Core:
~28,000 Lines
230+ Source Files
Unit Tests:
553 Passing
6,600+ test LoC
Native Bridge:
llama.cpp JNI
Adreno OpenCL GPU
Target Platform:
Android 8.0+
API 26 • No Root

Open Source Repository & Technical Documentation

Inspect the complete system design, ARCHITECTURE.md specs, and training pipeline on GitHub.

github.com/devd0gu/cortex ↗