Creating Device Agents - Tutorial Series

November 7, 2025 ยท View on GitHub

This tutorial series teaches you how to create new device agents for UFOยณ, using LinuxAgent as a reference implementation.

๐Ÿ“š Tutorial Structure

Part 0: Overview

Introduction to device agents and architecture overview

  • Understanding device agents vs third-party agents
  • Server-client architecture
  • LinuxAgent as reference implementation
  • Tutorial roadmap

Time: 15 minutes | Difficulty: โญ


Part 1: Core Components

Building server-side components

  • Agent Class implementation
  • Processor and strategy orchestration
  • State Manager and FSM
  • Processing Strategies (LLM, Action)
  • Prompter for LLM interaction

Time: 45 minutes | Difficulty: โญโญโญ


Part 2: MCP Server Development

Creating platform-specific MCP servers (Placeholder - Under Development)

  • MCP server architecture
  • Defining MCP tools
  • Command execution logic
  • Error handling and validation

Time: 30 minutes | Difficulty: โญโญ


Part 3: Client Setup

Setting up the device client (Placeholder - Under Development)

  • Client initialization and configuration
  • MCP server manager integration
  • WebSocket connection setup
  • Platform detection

Time: 20 minutes | Difficulty: โญโญ


Part 4: Configuration & Deployment

Configuring and deploying your agent (Placeholder - Under Development)

  • third_party.yaml configuration
  • devices.yaml device registration
  • Prompt template creation
  • Deployment steps
  • Galaxy integration

Time: 25 minutes | Difficulty: โญโญ


Part 5: Testing & Debugging

Testing and debugging your implementation (Placeholder - Under Development)

  • Unit testing strategies
  • Integration testing
  • Debugging techniques
  • Common issues and solutions

Time: 30 minutes | Difficulty: โญโญโญ


Part 6: Complete Example: MobileAgent

Hands-on walkthrough creating MobileAgent (Placeholder - Under Development)

  • Step-by-step implementation
  • Android/iOS platform specifics
  • UI Automator integration
  • Complete working example

Time: 60 minutes | Difficulty: โญโญโญโญ


Quick Navigation

I Want To...Go To
Understand device agent architectureOverview
Study LinuxAgent implementationOverview
Create Agent ClassCore Components - Step 1
Build ProcessorCore Components - Step 2
Implement State MachineCore Components - Step 3
Write Processing StrategiesCore Components - Step 4
Create PrompterCore Components - Step 5
Build MCP ServerMCP Server (placeholder)
Setup ClientClient Setup (placeholder)
Configure & DeployConfiguration (placeholder)
Test & DebugTesting (placeholder)
Complete ExampleMobileAgent Example (placeholder)

Prerequisites

Before starting, ensure you have:

  • โœ… Python 3.10+
  • โœ… UFOยณ repository cloned
  • โœ… Basic understanding of async programming
  • โœ… Familiarity with Agent Architecture

Learning Path

graph LR
    A[Overview<br/>โœ… Complete] --> B[Core Components<br/>โœ… Complete]
    B --> C[MCP Server<br/>๐Ÿ“ Placeholder]
    C --> D[Client Setup<br/>๐Ÿ“ Placeholder]
    D --> E[Configuration<br/>๐Ÿ“ Placeholder]
    E --> F[Testing<br/>๐Ÿ“ Placeholder]
    F --> G[Complete Example<br/>๐Ÿ“ Placeholder]
    
    style A fill:#c8e6c9
    style B fill:#c8e6c9
    style C fill:#fff3e0
    style D fill:#fff3e0
    style E fill:#fff3e0
    style F fill:#fff3e0
    style G fill:#fff3e0

Recommended Path:

  1. โœ… Completed: Overview - Understand architecture
  2. โœ… Completed: Core Components - Build server-side components
  3. ๐Ÿ“ Placeholder: MCP Server - Create device commands
  4. ๐Ÿ“ Placeholder: Client Setup - Setup device client
  5. ๐Ÿ“ Placeholder: Configuration - Configure and deploy
  6. ๐Ÿ“ Placeholder: Testing - Test and debug
  7. ๐Ÿ“ Placeholder: Complete Example - Full MobileAgent implementation

Additional Resources


Getting Help

If you encounter issues:

  1. ๐Ÿ“– Review the FAQ
  2. ๐Ÿ› Check troubleshooting guides
  3. ๐Ÿ’ฌ Ask in GitHub Discussions
  4. ๐Ÿž Report bugs on GitHub Issues

Contributing

Found an issue or want to improve these tutorials?

  • ๐Ÿ“ Submit a PR with improvements
  • ๐Ÿ’ก Suggest new topics
  • ๐Ÿ” Report errors or unclear sections

Ready to start? โ†’ Begin with Overview