HUSKYLENS 2 Xiaozhi AI Agent Tutorial

Xiaozhi AI turns HUSKYLENS 2 into a voice‑controlled vision hub, like giving your camera a smart assistant that can switch models, learn objects, describe scenes, run multiple recognizers in parallel, manage parameters and device settings, all triggered hands‑free with “Hi Husky” and a one‑time online binding

1. Introduction

Xiaozhi AI is an online intelligent voice assistant launched with HUSKYLENS 2. Simply install the WiFi module on HUSKYLENS 2 and connect to the network, and you can engage in real-time voice conversations with the Xiaozhi agent on HUSKYLENS 2.

The core highlight of HUSKYLENS 2 Xiaozhi AI is its ability to directly invoke the various built-in AI models and tools of HUSKYLENS 2 through the MCP (Model Context Protocol), including face recognition, object detection, object tracking, color recognition, hand recognition, pose estimation, license plate recognition, OCR text recognition, self-learning classification models, and any models that users have trained and deployed to HUSKYLENS 2. Users can simply issue voice commands, and Xiao ZhiAI will automatically call the corresponding model to perform recognition, learning, and other tasks — no need to manually switch functions or write code.

2. Required Materials

3. Starting and Configuring Xiaozhi AI

Note: To use the Huskylens 2 Xiaozhi AI , please make sure to update the HUSKYLENS 2 firmware to the latest version. For the firmware update tutorial, please refer to: Click here to view

3.1 Installing the WiFi Module and Connecting to the Network

Before using the Huskylens 2 Xiaozhi AI feature, you need to install the WiFi module on HUSKYLENS 2 and connect to the network. Follow the tutorial to complete the network configuration.

For a detailed WiFi connection tutorial, please refer to: Click here to view

Power the HUSKYLENS 2 using a USB cable, wait for the screen to light up, and the device will boot successfully.

Power On

Once connected to the network, find "Xiaozhi AI" on the HUSKYLENS 2 menu page and tap to enter.

Enter Xiao ZhiAI Feature

3.2 Starting Xiaozhi AI

After entering the Xiaozhi AI feature, tap the switch button at the bottom to start Xiaozhi AI.

Start Xiao ZhiAI Switch

When using Huskylens 2 Xiaozhi AI for the first time after a successful start, you will need to obtain an activation code to complete device binding. After binding, you can wake up the Xiaozhi AI on HUSKYLENS 2 by saying the wake word "Hi Husky" and start conversing with it directly.

Wake up the Huskylens 2 Xiaozhi AI Agent on HUSKYLENS 2 using the wake word "Hi Husky" to obtain the activation code.

As shown below, a string of active code will be displayed on the screen. Please note down or keep this active code, as you will need it later for device binding.

If activation fails and no active code appears, please check whether HUSKYLENS 2 has successfully connected to the WiFi network, then re-enter the Xiaozhi AI feature after confirming.

Xiao ZhiAI Activation Code

3.3 Logging into the Xiaozhi Control Platform

Next, you will need to use a computer or mobile phone browser to complete the following steps. Please follow the steps below:

(1) Open the browser on your computer or phone.
(2) Enter xiaozhi.me in the address bar to access the Xiao Zhi control platform.

Xiao Zhi Control Platform Homepage

(3) Click "Console" on the page. On first login, you will need to enter your mobile phone number and complete the login by receiving an SMS verification code.

Login to Xiao Zhi Console

3.4 Binding the Device

When using the Xiaozhi AI feature on HUSKYLENS 2 for the first time, you need to bind the device to your account. Enter the active code displayed on the HUSKYLENS 2 screen in the Xiaozhi console to complete device binding.

Tip: Binding only needs to be done once. For subsequent use, simply enter the Xiaozhi AI feature on HUSKYLENS 2 and turn on the switch — it will connect automatically without needing to bind again.

Enter Activation Code to Bind Device

After successful binding, your HUSKYLENS 2 device will appear in the device list in the console. You can now start voice conversations with the HUSKYLENS 2 Xiaozhi AI directly!

Binding Successful - Device List

4. HUSKYLENS 2 Xiaozhi AI Agent Usage Examples

After starting Huskylens 2 Xiaozhi AI following the tutorial above, the following icon will appear on the HUSKYLENS 2 screen, indicating that Xiao ZhiAI is running in the background.

Xiao ZhiAI Running Icon

4.1 Waking Up Xiaozhi AI Agent

Use the wake word "Hi Husky" to wake up the Huskylens 2 Xiaozhi AI Agent and enter the conversation page.

The wake word for HUSKYLENS 2 Xiao ZhiAI currently only supports "Hi Husky" .

Wake Up Xiao ZhiAI to Enter Conversation

4.2 Basic Conversation and Q&A

After waking up, you can have voice conversations with the Huskylens 2 Xiaozhi AI. Through its knowledge library and online search capabilities, Huskylens 2 Xiaozhi AI can answer various questions, such as:

  • "What's the weather like today?"
  • "Tell me today's news"

Chatting with Xiao ZhiAI

4.3 Switching Vision Recognition Models

In addition to basic chat and Q&A, you can also use voice commands to have Huskylens 2 Xiaozhi AI invoke the various built-in AI vision models on HUSKYLENS 2. Huskylens 2 Xiaozhi AI supports switching to any model on HUSKYLENS 2 (including factory-built-in models and user-deployed models).

For example, say to Huskylens 2 Xiaozhi AI Agent : "Switch to face recognition" to automatically switch to the face recognition model.

Voice Switch to face recognition

4.4 Getting Vision Recognition Results

After entering a vision recognition feature, Huskylens 2 Xiaozhi AI can not only run the model to complete recognition tasks, but also perform image semantic understanding and tell you in natural language what is currently in the frame.

For example, ask: "Tell me what you see", and Huskylens 2 Xiaozhi AI Agent will describe what the camera captures.

Xiao ZhiAI Describing Scene Content

4.5 Learning and Naming

You can use Huskylens 2 Xiaozhi AI Agent to learn target objects in the current frame and set custom names for them. The entire process requires no manual operation of HUSKYLENS 2 buttons.

For example, in face recognition mode, point the camera at a person's face and say: "Learn the current face and name it Wanda", and Huskylens 2 Xiaozhi AI Agent will automatically complete the learning and save the name.

Voice Learning Face and Naming

4.6 Querying Recognition Results

After learning, you can have Huskylens 2 Xiaozhi AI Agent report the current recognition results. For example, when there is both a learned face and an unlearned face in the frame, ask: "Tell me the current face recognition results", and Huskylens 2 Xiaozhi AI Agent will accurately report the number of faces recognized and the names of the learned faces.

Xiao ZhiAI Reporting face recognition Results

4.7 Specifying Multi-Model Parallel Operation

In addition to running a single model, you can also use Huskylens 2 Xiaozhi AI to enter HUSKYLENS 2's multi-algorithm mode, loading multiple models simultaneously and allocating computing power ratios.

For example, say: "Switch to face recognition and hand recognition, and set the computing power ratio to 1:1" to run multiple models simultaneously.

Multi-Model Parallel Operation

5. HUSKYLENS 2 Xiaozhi AI MCP Tools Overview

In addition to the features demonstrated in the usage examples above, the MCP tools in Xiaozhi AI also inherit other functions from HUSKYLENS 2. The following table summarizes all MCP tools that Xiaozhi AI can invoke. You can refer to the conversation examples and use relevant dialogue to invoke specific tools.

Daily conversation and online queries (such as knowledge Q&A, information lookup, etc.) are basic capabilities of Xiao ZhiAI and do not require switching models — simply ask via voice. These are not listed in the table below.

5.1 Model Management

No. Tool Description Usage Notes Example Prompt
1 List Models Lists the built-in models and installed custom-trained models available on HUSKYLENS 2 No additional details are required. Use this tool when you do not know the model name or before switching models Show me the models available on this device
2 Switch Model Switches to a specified built-in model or installed custom-trained model You must specify the target model. If you are unsure of its name, use “List Models” first Switch to Face Recognition
3 Get Current Model Shows the model currently running on HUSKYLENS 2 No additional details are required Which model is currently running

5.2 Multimedia

No. Tool Description Usage Notes Example Prompt
4 Take Photo Takes a photo with HUSKYLENS 2 You may specify 1920x1080, 1280x720, or 640x480 as the resolution. The default is 1280x720 Take a photo
5 Take Screenshot Captures the current HUSKYLENS 2 screen No additional details are required Take a screenshot

5.3 Recognition and Learning

No. Tool Description Usage Notes Example Prompt
6 Get Recognition Results Gets real-time recognition results from the current model, including image data, target positions, and recognition labels A model must currently be running What do you see
7 Forget Learned IDs Forgets the IDs learned by the current or specified model You may specify a model. If omitted, the learned IDs of the currently running model are forgotten Forget the learned IDs
8 Learn a Specific Object Teaches the model a target object in the current image You may describe the target's approximate position using directions such as top, bottom, left, or right Learn the face in the image.
Learn the leftmost person in the image
9 Name a Learned Object Assigns a name to an object that has already been learned You must specify the object ID and name Name the face with ID 1 Alex

5.4 Model Import and Export

No. Tool Description Usage Notes Example Prompt
10 Export Model Exports the current configuration and learned data of a specified model to the knowledge base You must specify the model and target knowledge base ID Export the current Face Recognition configuration to Knowledge Base 1
11 Import Model Imports a model configuration from the knowledge base and loads it into the current workspace You must specify the knowledge base ID to load Load Knowledge Base 1

5.5 Multi-Model Operation

No. Tool Description Usage Notes Example Prompt
12 Run Multiple Models Loads and runs multiple models on the device at the same time You must specify 2 or 3 models. You must also set their compute ratios, or the models will not recognize targets Run Face Recognition and Object Recognition together, and set their compute ratio to 1:2
13 Set Model Compute Ratios Adjusts how compute resources are allocated among the models currently running together Provide ratios in the same order as the active models. The number of ratios must match the number of active models; a higher value allocates more compute resources Set the compute ratio of the two current models to 1:2

5.6 Model Parameters

No. Tool Description Usage Notes Example Prompt
14 View Model Parameters Shows the available parameters and current values for a specified model You may specify a model. If omitted, the parameters of the current model are shown. Use this tool before changing model parameters Show the parameters of the current model
15 Set Model Parameters Changes the parameters of a specified model You must specify the parameters and their values. The target model is optional; if omitted, the current model is used. Parameter names and value types must match the results from “View Model Parameters” For Face Recognition, set the recognition threshold to 0.5, the detection threshold to 0.6, and enable multi-face acceleration

5.7 Device Control

No. Tool Description Usage Notes Example Prompt
16 Set Screen Brightness Adjusts the device screen brightness You must specify a value from 0 to 100 Set the screen brightness to 70
17 View Screen Brightness Shows the current device screen brightness No additional details are required What is the current screen brightness
18 Set System Volume Adjusts the device system volume You must specify a value from 0 to 100 in increments of 10 Set the system volume to 60
19 View System Volume Shows the current device system volume No additional details are required What is the current system volume
20 Set Fill Light Brightness Adjusts the brightness of the device's fill light You must specify a value from 0 to 100 Set the fill light brightness to 80
21 View Fill Light Status Shows the current brightness and on/off state of the fill light No additional details are required Show the current fill light brightness and on/off state

6. Xiaozhi AI Personalized Configuration

Turning Off the Xiaozhi AI Chat Window

In the Xiaozhi AI feature on HUSKYLENS 2, you can enable or disable the Xiaozhi chat window through the switch setting. If the chat window is turned off, you can still wake up Xiao ZhiAI with the wake word and chat with it while the Xiaozhi AI feature is enabled — only the conversation interface will not be displayed. This prevents the chat window from blocking the HUSKYLENS 2 camera view.

Multi-Model Parallel Operation

Setting the Device Name in the Xiaozhi Console

When you have multiple Xiaozhi agent devices, you can set the name of each agent in the Xiaozhi console using the following method to facilitate multi-device management.

Multi-Model Parallel Operation

Setting Up a Personalized Xiaozhi Agent

In the Xiaozhi console, select the corresponding Xiaozhi agent and click "Configure" to set parameters such as conversation language, voice, agent role, and more.

Multi-Model Parallel Operation

Was this article helpful?

TOP