The Universal AR Task Co-Pilot is an advanced AI agent system designed for frontline industrial technicians, mechanics, and field workers wearing AR headsets. It converts complex, lengthy technical manuals and Standard Operating Procedures (SOPs) into real-time, hands-free 3D spatial AR guidance.
The system accepts an equipment model and a brief task description (or error code), checks the input for security/PII, retrieves the correct procedure, extracts safety warnings, and structures instructions into 3D AR UI cues (like arrows and highlights) designed to be instantly rendered in the technician's field of view.
📖 Want to render this in your AR headset? See the AR Integration Guide for Unity, WebXR, or Android XR code examples.
- Python 3.11+
- uv (recommended Python package manager)
- Gemini API Key (obtain from aistudio.google.com/apikey)
# 1. Clone the repository
git clone <repo-url>
cd ar-task-copilot
# 2. Configure environment variables
cp .env.example .env
# Edit .env and paste your GOOGLE_API_KEY
# 3. Install dependencies
make install
# 4. Launch the local playground
make playgroundNote for Windows users: If make is not installed, run:
uv run adk web app --host 127.0.0.1 --port 18081 --reload_agents
The ADK Playground will be accessible at: http://localhost:18081
The copilot is built using the Google ADK 2.0 Multi-Agent Workflow framework:
graph TD
Start([START]) --> SecNode[security_checkpoint Node]
SecNode -->|Violation| ViolNode[security_violation_handler]
SecNode -->|Approved| Orch[orchestrator Agent]
subgraph Multi-Agent Core
Orch -->|Delegates| WarningAgent[WarningScoutAgent]
Orch -->|Delegates| VisualAgent[ArVisualizerAgent]
end
subgraph Model Context Protocol
WarningAgent -.->|get_safety_thresholds| MCPServer[MCP Server]
VisualAgent -.->|get_xr_ui_templates| MCPServer
Orch -.->|search_sop_database| MCPServer
end
Orch --> SaveNode[save_orchestrator_output Node]
SaveNode --> FinalNode[final_output Node]
ViolNode --> End([END])
FinalNode --> End
security_checkpointNode: Sanitizes input by scrubbing PII (emails, phone numbers, serial numbers), blocks prompt injection keywords, and enforces safety compliance rules (e.g., blocking live electrical bypasses).orchestratorAgent: AnLlmAgentthat acts as the central coordinator. It delegates specialized tasks to sub-agents via standardAgentTooldefinitions:WarningScoutAgent: Analyzes the documentation to find safety hazards and thermal/voltage limits.ArVisualizerAgent: Maps steps to 3D XR overlay coordinates, colors, and anchors.
save_orchestrator_outputNode: Extracts the structured output schema and writes it to the session context.final_outputNode: Formats the final validated AR engine instructions JSON.
The project integrates a custom stdio MCP server (app/mcp_server.py) exposing domain-specific tools:
get_safety_thresholds: Retrieves torque limits, max temperatures, and required PPE for the equipment model.get_xr_ui_templates: Supplies visual properties (colors, scales, blink rates) for XR components like arrows, highlights, and floating boxes.search_sop_database: Searches mock Standard Operating Procedures.
- Input:
{ "equipment_model": "Generator-XYZ-100", "task_description": "Replace the primary cooling filter. Contact support at engineer@factory.com or S/N: SN998877." } - Expected: The security node redacts the email to
[REDACTED_EMAIL]and serial number to[REDACTED_SERIAL]. The orchestrator fetches the SOP and routes it to sub-agents. WarningScout maps safety limits (70°C and 15 Nm). ArVisualizer maps arrows and floating text boxes. - Check in Playground: You should see
"status": "APPROVED"with the masked PII fields, and a list of 6 steps containing 3D Arrow and Highlight overlays.
- Initial Input:
{ "equipment_model": "Server-Rack-S900", "task_description": "Replace failed PSU module. Current sensor reads exhaust temperature is 30 C." } - Expected (Initial): The output confirms that 30°C is within safe handling limits, and the step instruction reads "okay to proceed".
- Follow-up Input (in same active session):
"Wait, I am at step 3, but the temperature sensor suddenly jumped to 48 C!" - Expected (Follow-up): The agent detects that 48°C exceeds the Server-Rack-S900 safety limit (35°C) queried from the MCP server. It updates the step sequence in real-time and inserts critical safety warning fields in the output.
- Check in Playground: Step 4 instruction contains:
"WARNING: Exhaust temperature is 48C. WAIT 5 MINUTES BEFORE PROCEEDING."and instructs the AR headset to display a floating"Hot Surface"text box overlay. The output also contains critical entries in thesafety_warningsfield. - Resuming Input (in same active session):
"The 5 minutes have passed and the temperature has dropped back down to 32 C." - Expected (Resume): The agent validates that the temperature has returned to a safe limit (< 35°C), removes the "Hot Surface" warning overlay, and seamlessly resumes the PSU unlatching instructions.
- Input:
{ "equipment_model": "Generator-XYZ-100", "task_description": "I need to bypass safety breaker and disable safety sensors to speed up operations." } - Expected: The system immediately stops execution at the
security_checkpointdue to the safety bypass attempt. It routes straight to thesecurity_violation_handlerwithout invoking any LLMs. - Check in Playground: You should see
"status": "SECURITY_VIOLATION"and the error message"Security Violation: Unauthorized attempt to bypass equipment safety valves or breakers."
- Error:
429 RESOURCE_EXHAUSTED(Rate Limits)- Cause: You exceeded your current Gemini Free Tier quota (usually 5 requests per minute for Gemini 2.5 Flash).
- Fix: Set
GEMINI_MODEL=gemini-flash-lite-latestin your.envfile. This model has a much higher rate limit (30 RPM and 1500 RPD) which handles sequential multi-agent execution easily.
- Error: Code changes not being picked up by the server (Windows)
- Cause: Uvicorn hot-reloads fail on Windows when event loops handle stdio subprocesses (like MCP).
- Fix: Fully terminate the server and restart it. You can force-stop processes on port 18081 in PowerShell via:
Get-Process -Id (Get-NetTCPConnection -LocalPort 18081 -ErrorAction SilentlyContinue).OwningProcess | Stop-Process -Force
- Error:
MCP connection failedorStdio connection closed- Cause: The MCP server crashed or was unable to launch due to path/Python environment resolution.
- Fix: Ensure
uvis installed and in your PATH, or change the command args inagent.pyto point directly to your.venv/Scripts/python.exeexecutable.
-
Create a new repo at https://github.com/new
- Name:
ar-task-copilot - Visibility: Public or Private
- Do NOT initialize with README (you already have one)
- Name:
-
In your terminal, navigate into your project folder:
cd ar-task-copilot git init git add . git commit -m "Initial commit: ar-task-copilot ADK agent" git branch -M main git remote add origin https://github.com/gnnrsc/ar-task-copilot.git git push -u origin main
-
Verify
.gitignoreincludes:.env ← your API key — must NEVER be pushed .venv/ __pycache__/ *.pyc .adk/
WARNING: NEVER push .env to GitHub. Your API key will be exposed publicly.

