Building a Romantic Ceremony Assistant with Tencent Yuanqi

In previous projects, we developed learning assistants and to-do list managers. This time, we wanted to create something different—focused entirely on romance. Our motivation stemmed from realizing that our previous assistants lacked that essential sense of occasion, making it difficult to truly surprise someone special. So we set out to develop a Valentine's Day ceremony assistant that could help address this specific need.

Before diving into implementation, let's identify the key challenges we aimed to solve: selecting the perfect gift, composing romantic poetry, creating personalized short videos with images and background music, writing heartfelt vows to set the mood, and ultimately conveying genuine feelings to a partner.

To accommodate different experience levels, this guide is divided into two sections: Quick Start and Advanced Implementation. If you already have some background knowledge, feel free to skip the Quick Start section and jump directly to the technical details.

Quick Start

Yuanqi Agent Platform

Official platform: https://yuanqi.tencent.com/application
Documentation: https://docs.qq.com/doc/DTWxpclVNeFRUUlh3

Yuanqi is an AI agent creation tool developed by Tencent's Hunyuan large language model team. It provides features like prompt configuration, plugins, knowledge bases, and more. The core concept here is that an agent enhances the LLM's capabilities through function calling—accessing external interfaces including APIs, knowledge bases for data retrieval, databases, and variables.

There's also the concept of workflows, which is a special form that encompasses all available external capabilities, executing them sequentially based on business requirements.

When interacting with external system interfaces, detailed descriptions are mandatory to ensure the model accurately understands and generates properly structured outputs. This is essentially the foundational step for working with the platform.

Creating Your Agent

Skip the marketplace and navigate directly to the main page to create your own agent.

Interface Layout

The interface is divided into left and right panels. The left panel handles all agent settings including name, description, avatar, prompt, opening messages, suggested questions, plugins, knowledge bases, and workflows. The right panel serves as a testing area to verify settings and make adjustments as needed.

Detailed Configuration

Let's focus on the prompt structure, which defines the overall framework. Here's an example template:

# Role: You are a weather forecaster that can query weather information.
## Skills
- Ask users about their location and weather requirements
- Provide detailed weather forecasts: temperature, humidity, weather conditions, wind speed, UV index, and PM2.5 levels.
## Principles
- Only provide weather information; do not answer other questions
- All data must come from tools; do not fabricate information

Structured prompts not only help with optimization but also improve the model's response accuracy. You can leverage the model itself to generate prompts. For instance:

I want to create a prompt for a Valentine's Day ceremony assistant robot that handles:
- Selecting Valentine's Day gifts
- Writing love poems
- Creating personalized short videos (images, background music)
- Writing vows to create atmosphere
- Sending heartfelt messages to partners

The format should be:
# Role
## Skills:
## Principles:

Here's a template example:
# Role: You are a weather forecaster that can query weather information.
## Skills
- Ask users about their location and weather requirements
- Provide detailed weather forecasts: including temperature, humidity, weather conditions, wind speed, UV index, and PM2.5 values.
## Principles
- Only provide weather information; do not answer other questions
- All data must come from tools; do not fabricate information

Using this approach, we developed the final configuration for our assistant:

# Role: Valentine's Day Ceremony Assistant Bot
## Skills:
- Gift selection: Based on collected information and the partner's preferences, provide personalized gift suggestions including but not limited to flowers, chocolates, jewelry, books, etc.
- Love poetry: Generate warm and romantic poems based on keywords and emotions provided by users, expressing sincere feelings.
- Short video creation: Automatically generate beautiful short videos from user-provided photos, video clips, and background music, showcasing beautiful memories and love.
- Vow publishing: Provide multiple vow templates or customize based on user needs to create romantic atmosphere and express commitment and love.
- Sending messages: Integrate the above content and send gift suggestions, poems, videos, and vows to the partner in a warm manner.

## Principles:
- Respect user privacy and personal preferences; do not leak user information or behavior.
- Provide personalized services and customize content based on user needs to ensure expectations are met.
- Maintain professionalism and courtesy, creating a romantic and warm Valentine's Day atmosphere.
- When processing user data and content, strictly comply with privacy policies and laws to ensure information security and compliance.

Plugin System

Some capabilities like video creation may be difficult for the LLM to handle directly. This is where plugins come in. For example, Yuanqi offers an exclusive text-to-image plugin that converts creative ideas into images. Then you can use mobile apps to create videos with one click.

After selecting appropriate plugins, you can add them to your agent to streamline the workflow.

Regarding the "Send Message" capability—there's a challenge here. Since the LLM operates in isolation from external systems, email notifications require separate implementation. The plugin store doesn't currently offer email functionality, so custom development is needed. We'll cover this in the Advanced section.

For optimization, most skill responses (approximately 80%) can be handled directly by the LLM. For the remaining 20% requiring higher literary quality, we need reference materials. There are two approaches: using search plugins to find existing copy online, or building our own knowledge base.

Knowledge Base

The second approach involves establishing a knowledge base with curated phrases and excerpts from various sources. This allows us to provide the LLM with quality inputs for generating better responses. During our development process, we evaluate which approach works best for each scenario.

Workflow System

Currently, we haven't implemented workflows. Generally, workflows improve output stability and reduce error rates. While individual plugin calls may work fine, when multiple plugins need to be called together for complex requirements, even advanced LLMs may not execute tasks exactly as instructed. Workflows become essential in these cases.

For example, if we ask basic questions, we might get responses that don't address specific needs. Plugins can handle most queries, but for personalized or specialized questions, a knowledge base containing information about different gift types and their meanings would be invaluable. This enables a customized workflow that generates answers matching user intent.

Summary

The diagram above illustrates the complete flow, helping you understand and master the process.

When building an assistant following the beginner approach, we've completed the basic setup. However, the assistant still has significant issues and gaps that prevent it from providing effective help. The Advanced section will address these problems in detail.

Advanced Implementation

Let's systematically identify the assistant's problems for targeted solutions:

  1. Gift recommendations lack detail and personalization
  2. Love poems feel simplistic and lack literary flair
  3. Image generation relies on Hunyuan text-to-image; additional features like background music recommendations needed
  4. The message-sending process needs humanization and personalization

We'll tackle each issue progressively to elevate the assistant's capabilities.

Feature Implementation - Plugins

When addressing plugin issues, we must recognize the importance of email functionality. Since the platform doesn't provide a dedicated email plugin, we need to implement our own. I previously set up a personal mail server. If anyone's interested in building a similar setup, you can refer to my guide on setting up a mail server in 5 minutes.

Before diving into detailed content, here's a plugin creation workflow diagram for reference:

The first step is to describe our plugin's functionality clearly. This description must be easy to understand for human users and compatible with the LLM's comprehension. Unclear descriptions may cause incorrect plugin calls or no calls at all. We'll cover workflow integration later.

Additionally, I recommend keeping API interfaces simple. Overly complex interfaces increase debugging difficulty and should be avoided.

Use the YAML format provided by the platform for interface descriptions rather than relying on LLM-generated descriptions, as they typically have higher error rates. Follow the interface modifications as shown in the platform interface.

Here's a YAML template you can customize:

openapi: "3.0.0"
info:
  title: "API Title"
  version: "1.0.0"
  description: "Description"
servers:
  - url: "http://ip/path"
    description: "Description"
paths:
  "/path":
    post:
      summary: "Description"
      description: "Description"
      operationId: "unique_id"
      parameters:
        - name: "parameter_one"
          in: "query"
          description: "Email format"
          required: false
          schema:
            type: "string"
            default: "plain"
            enum: ["example_param_one", "example_param_two"]
      responses:
        "200":
          description: "Success response"
          content:
            application/json:
              schema:
                type: "object"
                properties:
                  status:
                    type: "boolean"
                    description: "Return status"
                  msg:
                    type: "string"
                    description: "Return message"
        "400":
          description: "Bad request"
        "401":
          description: "Unauthorized"
        "500":
          description: "Internal server error"

After creating the plugin definition, we debug the interface to ensure it functions correctly before publishing. Note that the platform currently requires manual review for plugin submissions. This prevents malicious plugins from consuming review resources.

Once published, users can easily add the plugin to their agents or workflows.

Feature Implementation - Knowledge Base

My knowledge base contains poetry collections with various literary styles and forms. I organized different poetry styles and rules into categories.

Why import poetry collections into the knowledge base? Because the collections contain diverse categories, and the knowledge base content guides the LLM to output in the required format. If we needed to use a separate LLM node for each poetry category in the workflow, it would become cumbersome. Instead, we can reference poetry collections as parameters in the LLM node for matching.

One consideration: the current knowledge base's segmentation (line breaks) isn't particularly friendly for parsing. Cosnider converting knowledge base content to single lines with clear category descriptions.

Once the knowledge base file is properly maintained, we can proceed with adding it to our agent.

Feature Implementation - Workflows

Our workflow tasks are substantial. Let me outline and implement them one by one:

  1. Custom Love Poetry: To generate poems matching user requirements and keywords, this task is essential.
  2. Emoji Translator: Beyond text, emojis are important for emotional expression. Inspired by similar tools, we designed meaningful emoji sequences to convey affection.
  3. Personalized Gift Planning: Selecting gifts is often challenging. We'll recommend gifts based on the partner's interests, personality type, profession, and relationship dynamics.
  4. Culinary References: Inspired by similar features, helping prepare a romantic dinner is another way to express love.
  5. Email Dispatch: Everything prepared, now we need to send our love via email.

Workflow - Custom Love Poetry

As discussed, the knowledge base application involves importing relevant collections and using parameters to optimize LLM-generated content based on keywords. Considering users may not want to specify or might struggel with choosing poetry styles, I didn't make poetry categories mandatory. If users don't specify, the system defaults to Chinese seven-character regulated verse. The LLM then generates appropriate love poems based on keywords and selected poetry style.

Let's examine the workflow's execution flow.

Workflow - Emoji Translator

The goal here is simple: help users have more engaging conversations with their partners instead of awkward silences. We implemented an emoji translator that helps generate meaningful emoji sequences to convey emotions. This requires just one LLM node that understands emoji meanings and provides interesting conversation topics. The model can learn from examples provided.

Let's review the workflow structure.

Workflow - Personalized Gift Planning

Selecting gifts for Valentine's Day can be particularly challenging. For new couples, this process is exciting since they've never chosen gifts for each other before. However, as time passes, gift selection becomes increasingly difficult as options seem repetitive. We need a workflow to determine the most suitable gifts based on the partner's personality, interests, and hobbies.

This workflow primarily relies on a single LLM node that recommends gifts based on user type and preferences.

Workflow - Culinary References

Since I usually cook at home, I need to decide what's for dinner each evening. While eating out is an option, homemade meals feel warmer and more heartfelt. I incorporated similar functionality to enhance the assistant's capabilities.

The same LLM node handles all capabilities and provides tabular output. Let's examine the workflow in detail.

Workflow - Email Dispatch

The most critical step is conveying our deep affection to our partner. This task involved complex logic and multiple discussions with the platform team to resolve various issues. I first created a workflow diagram for reference.

Observing these nodes helps understand the complete process. The specific execution steps don't need detailed explanation here.

One notable issue: plugins couldn't directly call our API, consistently returning errors. Only Python code execution could send calls, but workflow code nodes cannot use third-party dependencies. We had to generate HTML code output instead.

Since this email goes to a partner rather than ourselves, checking before sending is advisable. Having the sender manually send the email adds more ceremonial feeling. So I convinced myself not to insist on automatic email sending.

Let's see the result: First, generate images. For demonstration, I'm using description-based generation. You can upload your own images and modify them:

Right-click to copy all image URLs. Then proceed to chat:

/email 
keyword: Xiaoyu
relationship start date: 2018-05-20
image list: https://cdn.yuanqi.tencent.com/hunyuan_open/default/c73af7034b280d895dcf8986cc03fe70.png?sign=1716813442-1716813442-0-fe644ff16f7547005b4ba76552464ae4c8e7abae7c1fa9f4d8333e2407f47fa7,https://cdn.yuanqi.tencent.com/hunyuan_open/default/5aec9c9704df47e4fe2ba93474bdf12c.png?sign=1716813376-1716813376-0-2c6a9368fc7288e8a26355c8d14e6438fb23943a927586c245d8c6d81e14bb05,https://cdn.yuanqi.tencent.com/hunyuan_open/default/c73af7034b280d895dcf8986cc03fe70.png?sign=1716813442-1716813442-0-fe644ff16f7547005b4ba76552464ae4c8e7abae7c1fa9f4d8333e2407f47fa7,https://cdn.yuanqi.tencent.com/hunyuan_open/default/5aec9c9704df47e4fe2ba93474bdf12c.png?sign=1716813376-1716813376-0-2c6a9368fc7288e8a26355c8d14e6438fb23943a927586c245d8c6d81e14bb05,https://cdn.yuanqi.tencent.com/hunyuan_open/default/c73af7034b280d895dcf8986cc03fe70.png?sign=1716813442-1716813442-0-fe644ff16f7547005b4ba76552464ae4c8e7abae7c1fa9f4d8333e2407f47fa7,https://cdn.yuanqi.tencent.com/hunyuan_open/default/5aec9c9704df47e4fe2ba93474bdf12c.png?sign=1716813376-1716813376-0-2c6a9368fc7288e8a26355c8d14e6438fb23943a927586c245d8c6d81e14bb05

Copy the generated email content and paste it into your email client (e.g., QQ Mail).

Final Demonstration

After several days of dedicated effort, the romantic ceremony assistant is complete. This was my first experience building with Yuanqi agents, despite having extensive experience with similar platforms. The custom plugin creation and workflow construction presented unexpected challenges, making the overall experience somewhat difficult. Nevertheless, I successfully completed my assistant.

Tags: tencent-yuanqi ai-agent valentines-day gift-recommendation love-poem-generator

Posted on Mon, 18 May 2026 18:55:13 +0000 by tony_c