Bifacial-OS provides system-level support for GUI agents on mobile devices. It combines a device-side MCP server for application interaction, foreground-aware resource control, and framework-level optimizations for GUI-agent task execution.
The current release includes part of the framework implementation as patches to Android's frameworks/base and frameworks/native. The remaining code, including the MCP server and resource manager, will be open-sourced later.
Agent Host. At the top, the Agent Host plans tasks, performs inference and selects GUI actions. It sends actions and observation requests to the mobile device through MCP and uses the returned observations to decide its next action.
Agent Execution Service. On the device, the service manages tasks and target UI instances, checks requests, delivers input and returns observations. Its internal Resource Manager combines task demand and runtime state with foreground pressure to decide when agent work can proceed and how much CPU, GPU and memory it can use.
Framework and OS support. At the bottom, Android framework extensions provide independent agent UI interaction, schedule UI updates and produce the requested observations with less rendering work. Actions enter the application's existing UI callbacks and business logic. OS scheduling, cgroups and memory reclamation provide the mechanisms for resource control. The service passes interaction requests and execution limits to these components and receives execution feedback and resource-pressure signals.
| Directory | Role in the system | Included now |
|---|---|---|
| server/ | Provides the MCP interface and coordinates agent interaction with mobile applications | Component documentation; source code pending release |
| manager/ | Manages agent resource use to preserve foreground responsiveness | Component documentation; source code pending release |
| framework/ | Supports independent agent interaction with applications and improves GUI-task execution efficiency | Base/native patches, minimal usage examples, fixed source versions and porting guidance |
server/ and manager/ are separate source modules; the manager is an internal component of the Agent Execution Service. The directory split does not require two independently deployed services.
The framework snapshot includes UI construction and rendering controls that support independent user and agent interaction within the same application and reduce unnecessary UI updates and rendering work. The control mechanism for requests submitted between application layers is pending release and is not included now in this repository.
- Read the framework README for the exact AOSP baseline, development branches and included commits.
- Apply the patches to compatible source trees and build them for the target device.
- Follow the minimal framework examples to create an agent display, inject input, control rendering and export raw DisplayList observations.
This snapshot is a source-level integration starting point. It does not contain an installable end-to-end service or a device image. Screenshot and DisplayList observations are independent of whether a second UI instance is needed; Piggyback specifically addresses a shared application main thread.
This repository includes two minimal framework examples with build, invocation and cleanup instructions. They use the bundled framework patches and require no model credentials. The full experiment suite, datasets and observation-processing pipeline are not included in this release.
Reproducing system software requires pinning the source branches, exact commits and platform versions. The supplied patches target the revisions listed in the framework README and may not apply directly to other branches or versions. Developers targeting a different version must implement the necessary adaptations in their own source tree and validate the resulting build on the target device.
AI coding assistants such as Codex and Claude can substantially help with understanding the code hierarchy and dependencies, locating equivalent implementation points across versions, and carrying out the adaptation and reproduction process. Provide the assistant with the component documentation, pinned source revisions, patches and target platform code, and use it to assist with implementation, build troubleshooting and functional validation.