An intelligent automation Agent framework with LLM capabilities, supporting task planning, RPA (Robotic Process Automation) execution, and workflow orchestration for macOS and Windows.
- Task Planning: Automatic task decomposition and planning using LLM
- RPA Execution: Complete set of mouse, keyboard, screen, and system automation tools
- Workflow Engine: Flexible node-based workflow orchestration with evaluation capabilities
- Multi-LLM Support: Compatible with OpenAI, Qwen, and Gemini models
- Visual Intelligence: Screenshot-based action planning and evaluation
- Evaluation Mode: Compare before/after screenshots to verify task completion
- Go 1.24+
- macOS (required for RPA features)
go mod downloadThe config.toml configuration file is optional. The application includes built-in default configurations. The config file only needs to contain fields you want to override:
[app]
name = "agent"
version = "1.0.0"
mode = "production"
debug = false
task = "Open Safari and search for cat pictures"
max_steps = 100
screen_index = 0
is_plan = false
is_evaluation = false
[llm]
provider = "qwen" # Supported: openai, qwen, gemini
api_key = "${OPENAI_API_KEY}" # Supports environment variables
base_url = "http://127.0.0.1:1234/v1"
model = "qwen/qwen3-vl-4b"
timeout = 30Note: Fields in the config file override default settings. Unconfigured fields use default values.
# Using Makefile
make run
# Or run directly
go run .
# Specify task
go run . -task "Open calculator and calculate 1+1"
# Plan only mode (no execution)
go run . -task "Search weather forecast" -plan
# Enable evaluation mode
go run . -task "Open Notes app" -eval=true
# Set maximum execution steps
go run . -task "Automated testing workflow" -max-steps=50
# Specify screen index
go run . -task "Open Safari on second display" -screen-index=1make build
./build/agent -task "Your task description"| Parameter | Description | Default |
|---|---|---|
-help |
Show help information | - |
-version |
Show version information | - |
-task |
Task description to execute | Read from config file |
-plan |
Plan only mode, no execution | Read from config file (default false) |
-eval |
Enable evaluation mode | Read from config file (default false) |
-max-steps |
Maximum execution steps | Read from config file (default 100) |
-screen-index |
Working screen index | Read from config file (default 0) |
Note: All parameters can be set via config file with default values. Command line arguments override config file values.
Examples:
# View all parameters
go run . -h
# Complete example
./build/agent -task "Open Safari and visit apple.com" -plan=false -eval=true -max-steps=20 -screen-index=0Supports multiple LLM providers. Configure in config.toml (optional, uses defaults if not configured):
[llm]
# Provider: openai, qwen, gemini
provider = "qwen"
# Model name
model = "qwen/qwen3-vl-4b"
# API key (supports environment variables like ${OPENAI_API_KEY})
api_key = ""
# Custom API endpoint (optional, for proxy or local deployment)
base_url = "http://127.0.0.1:1234/v1"
# Request timeout (seconds)
timeout = 30Supported Provider Examples:
- OpenAI:
provider = "openai",base_url = "https://api.openai.com/v1" - Qwen:
provider = "qwen",base_url = "https://dashscope.aliyuncs.com/api/v1" - Gemini:
provider = "gemini"
To use local LLM models, we recommend LM Studio:
-
Install LM Studio
- Visit https://lmstudio.ai/ to download and install
- Supports macOS, Windows, and Linux
-
Start Local Server
- Open LM Studio
- Select and download a model (recommended: Qwen2.5-7B, Llama-3-8B, etc.)
- Click the "Server" tab to start the local API server
- Default port is 1234, API address is
http://127.0.0.1:1234/v1
-
Configure config.toml
[llm] provider = "openai" # LM Studio uses OpenAI-compatible API api_key = "" # Can be empty for local deployment base_url = "http://127.0.0.1:1234/v1" model = "Downloaded model name"
-
Advantages
- Completely offline, privacy protected
- No API call costs
- Customizable model parameters (temperature, top_p, etc.)
- Support for multiple open-source models
The following settings can be modified in config.toml. Unconfigured fields use defaults:
[rpa]
# Enable RPA logging
enable_logging = false
# Log level: debug, info, warn, error
log_level = "info"
# Action timeout (seconds)
action_timeout = 30
# Smooth mouse movement
smooth_movement = true
# Mouse movement speed (pixels/millisecond)
movement_speed = 5
# Click visual indicator pause time (milliseconds)
click_visual_sleep = 500
# Scroll step interval (milliseconds)
scroll_step_sleep = 20
# Wait time after app launch (seconds)
app_launch_sleep = 1[app]
name = "mac-use-agent"
version = "1.0.0"
# Run mode: development or production
mode = "production"
# Debug mode (enables verbose logging)
debug = false
# Default task
task = "Open Safari and download a cat picture to desktop"
# Maximum execution steps
max_steps = 100
# Working screen index
screen_index = 0
# Enable planning mode
is_plan = false
# Enable evaluation mode
is_evaluation = false[logging]
# Log level: debug, info, warn, error
level = "info"
# Format: json, text
format = "json"
# Output: stdout, stderr, or file path
output = "stdout"[server]
host = "localhost"
port = 8080The Agent provides the following automation tools:
| Tool | Description |
|---|---|
left_click |
Left click at specified coordinates |
right_click |
Right click at specified coordinates |
double_click |
Double click at specified coordinates |
move |
Move mouse cursor to coordinates |
drag |
Drag and drop operation |
scroll |
Scroll in specified direction with amount |
mouse_position |
Get current mouse position |
| Tool | Description |
|---|---|
type_text |
Input text string |
key_press |
Press keyboard key or combination |
| Tool | Description |
|---|---|
screenshot |
Capture screen screenshot (base64 encoded) |
screen_size |
Get screen dimensions |
| Tool | Description |
|---|---|
wait |
Wait for specified duration |
open_app |
Open application by name |
get_app_list |
List running applications |
done |
Mark task as completed |
| Tool | Description |
|---|---|
apple_script |
Execute AppleScript commands |
The Agent uses a node-based workflow engine for task orchestration:
- PlannerNode: Creates a step-by-step plan from the main goal
- GetActionNode: Determines the next actions based on current state
- RPAExecutorNode: Executes the planned RPA actions
- EvaluatorNode: Evaluates task completion by comparing screenshots
- CompletionNode: Finalizes the workflow
PlannerNode
↓
GetActionNode
↓
RPAExecutorNode
↓
EvaluatorNode → GetActionNode (continue)
↓
CompletionNode (completed)
When evaluation mode is enabled, the agent:
- Takes a screenshot before executing actions
- Executes the planned actions
- Takes another screenshot after execution
- Compares the two screenshots using the LLM
- Determines if the step was completed successfully
- Continues or marks as completed based on evaluation
./build/agent -task "Open Safari browser, search today's weather forecast, and save a screenshot"./build/agent -task "Open calculator, input 123 + 456, get result"./build/agent -task "Open Finder, create new folder named 'test', open TextEdit and write 'Hello World', save to new folder" -max-steps=30./build/agent -task "Analyze system performance and generate report" -plan./build/agent -task "Download a picture of a cat to the desktop" -eval=true# Run all tests
make test
# Or
go test ./...
# Run specific tests
go test -v ./internal/core/llm -run TestMockLLMClient
# Generate coverage report
make test-coverage
# Run race detection
make test-race
# Run benchmarks
make bench| Command | Description |
|---|---|
make build |
Build application (automatically injects version info) |
make run |
Run application |
make clean |
Clean build files and test reports |
make test |
Run tests |
make test-coverage |
Run tests and generate coverage report |
make test-race |
Run race detection |
make bench |
Run benchmark tests |
make fmt |
Format code |
make vet |
Run go vet |
make lint |
Run code checks (requires golangci-lint) |
make deps |
Download dependencies |
make deps-update |
Update dependencies |
make install |
Install to GOPATH/bin |
make help |
Display all available commands |
# View all commands
make help- Run
make fmtto format code withgofmt - Run
make vetto check code withgo vet - Run
make lintfor code quality checks withgolangci-lint
You can set the LLM API key via environment variable:
export OPENAI_API_KEY="your-api-key"
go run .Or use it in config.toml:
[llm]
api_key = "${OPENAI_API_KEY}"- Agent Implementation:
/internal/core/workflow/agent.go - Workflow Nodes:
/internal/core/workflow/node.go - LLM Client:
/internal/core/llm/ - RPA Server:
/internal/core/rpa/rpa.go - Configuration:
/internal/config/config.go
Q: Is the config.toml file required?
A: No. The application includes complete default configurations. config.toml is only used to override fields you want to modify. If there is no config.toml file, the application will run automatically with default settings.
Q: How to use local LLM models?
A: Modify the base_url in the config file to point to your local service, for example:
base_url = "http://127.0.0.1:1234/v1"Q: What to do if Agent execution gets stuck?
A: Use the -max-steps parameter to limit maximum execution steps, or use Ctrl+C to interrupt execution.
Q: Does evaluation mode work with screenshots?
A: Yes. When evaluation mode is enabled, the agent takes screenshots before and after each action, then uses the LLM to compare them and determine if the task was completed successfully.
Q: Which operating systems are supported?
A: RPA features currently only support macOS (using CGO and AppleScript). Core LLM functionality can run on any platform.
Q: How to view detailed execution logs?
A: Set in the config file:
[app]
mode = "development" # Enable debug mode
debug = true
[logging]
level = "debug"- RPA tools currently only support macOS (requires CGO and AppleScript)
- Cross-platform compilation not supported (CGO dependencies)
- Requires display access for screenshot and automation features
- Improve OpenAI and Gemini clients
- Support Windows and Linux RPA features
- Enhance LLM features (streaming output, function calling)
- Web UI workflow management interface
- Performance monitoring and metrics
- Distributed execution support
- Advanced screenshot comparison algorithms
- Custom tool registration API
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.