AI Assistant

This solution leverages the Tuya Agent Platform, which provides developers with foundational capabilities such as large language model invocation, knowledge base management, agent orchestration, and Workflow configuration, serving as the core infrastructure for building AI assistant solutions. The AI assistant solution integrates platform capabilities into mini-programs via the AI Assistant SDK in a modular form, enabling developers to rapidly construct AI applications with natural language interaction capabilities without needing to handle model invocation details.

AI Assistant Introduction

AI Assistant is an intelligent dialogue mini-program provided by Tuya based on large language models, capable of accurately understanding user instructions and needs through voice or text input. It not only answers various user questions but also controls smart home devices, executes scheduled tasks, provides personalized recommendations, and many other functions. Through natural language interaction, AI Assistant creates a more convenient and intelligent living experience for users, becoming a smart butler in users' daily lives.

Application Scenarios

  • Smart Home Control: Users can give commands to the assistant through voice or text to control smart devices at home, such as "Turn on the living room light" or "Set the air conditioner to 26 degrees".
  • Information Queries: Users can ask about weather, news, schedules, and other information, and the AI Assistant will provide accurate answers.
  • Personalized Recommendations: Based on users' usage habits and preferences, it provides personalized suggestions such as energy-saving tips and comfort scene recommendations.
  • Scheduled Task Management: Helps users set up and manage various scheduled tasks, such as "Open the curtains at 7 AM every day" or "Turn off all lights at 10 PM".

Current Pain Points

  • Limited Customization and Extension Capabilities: Tuya's agent mini-program provides personalization configurations such as name, icon, and theme color, but customization and extension capabilities are limited.
  • High Development Cost: Developers need to understand agent-related APIs to develop, which has a steep learning curve.

What is AI Agent SDK?

AI Agent SDK is an SDK provided by Tuya to help developers integrate AI conversation functionality into their own mini-programs. It provides complete conversation interface, conversation logic management, and conversation data management capabilities.

Version Notice

⚠️ Important Notice: @ray-js/t-agent-plugin-assistant has been deprecated, please use @ray-js/t-agent-plugin-aistream instead.

Core Components

  • @ray-js/t-agent: A general conversation framework that supports message sending and receiving, lifecycle management, and conversation data management, with a plugin mechanism.
  • @ray-js/t-agent-plugin-aistream: A plugin that connects to the mini-program AI agent platform, supporting streaming conversations, speech recognition, and other features.
  • @ray-js/t-agent-ui-ray: A conversation component library based on Ray UI, supporting virtual scrolling, internationalization, multimodal interaction, and other features.

Core Features

  • Natural Language Understanding: Able to understand users' colloquial expressions without requiring users to memorize specific command formats.
  • Multimodal Interaction: Supports voice, text, image, video, and other input methods to meet usage needs in different scenarios.
  • Device Control: Can control various smart devices within the Tuya ecosystem, achieving one-stop smart home management.
  • Scene Linkage: Supports creating and executing complex scene linkages, such as "Home Mode", "Away Mode", etc.
  • Knowledge Base Queries: Able to answer user questions about device usage, home management, and other aspects.
  • Personalized Recommendations: Provides personalized suggestions and recommendations based on users' usage habits and preferences.
  • Speech Recognition: Supports ASR speech recognition, accurately recognizing users' voice input.
  • Internationalization Support: Built-in multi-language support, including 8 languages: Chinese, English, Japanese, German, French, Spanish, Italian, etc.

AI Agent SDK vs. AI Agent Mini-Program

After creating an agent on Tuya's agent development platform and binding it to an App or PID, you can use the AI Agent Mini-Program, which provides personalization configurations such as name, icon, and theme color. However, if you need to integrate AI conversation into your own mini-program or deeply customize functionality and appearance, the AI Agent SDK is recommended.

Comparison Analysis

FeatureAI Agent Mini-ProgramAI Agent SDK
Platform IntegrationAgent Development PlatformAgent Development Platform
Device ControlSupportedSupported
WorkflowSupportedSupported
Knowledge BaseSupportedSupported
FormIndependent Mini-Programnpm Package
Development MethodNo code development requiredCode development required
Customization CapabilityName, color, welcome message, background imageInterface and functionality fully customizable
Integration MethodMini-program navigationCan be embedded in your own mini-program
Chart DrawingNot currently supportedSupported
Card FunctionalityNot currently supportedSupports custom cards
Multiple AgentsNot currently supportedSupported
Speech RecognitionNot currently supportedSupports ASR speech recognition
InternationalizationNot currently supportedSupports multi-language internationalization
Virtual ScrollingNot currently supportedSupports long list optimization

If you want to quickly enable agent conversation functionality without complex customization, you can directly use the AI Agent Mini-Program. If you need to deeply integrate AI conversation into your own mini-program and perform personalized customization, the AI Agent SDK is a better choice.

Billing Rules

During App usage, AI tokens or resources will be consumed. Please refer to AI Agent Metering and Billing for pricing rules. You can check specific usage by visiting Resource Consumption.