Build a Conversational 24‑Point Game with Baidu AppBuilder: A Step‑by‑Step Guide

This article walks through the complete workflow for creating an AI‑native conversational 24‑point game using Baidu Cloud Qianfan AppBuilder, covering methodology, component design, agent architecture, and implementation details with code examples and visual diagrams.

Baidu Intelligent Cloud Tech Hub
Baidu Intelligent Cloud Tech Hub
Baidu Intelligent Cloud Tech Hub
Build a Conversational 24‑Point Game with Baidu AppBuilder: A Step‑by‑Step Guide

1. Three‑step methodology for AI‑native applications

AI‑native apps differ from traditional apps by using fully human‑like interaction via text, voice, or visual signals. The article focuses on text‑based natural language interaction and outlines three key steps to prototype an AI‑native app.

Creative description : Summarize the idea in one sentence.

Creative decomposition : Split the idea into thinking modules and component work.

Creative implementation : Use natural language to describe the thinking pattern and realize the components.

2. Case study: Conversational 24‑point game

The target app lets users request a random 24‑point puzzle via dialogue, validates user‑submitted expressions, and provides hints when needed.

Task breakdown

Define the thinking module’s functional boundaries, including component call protocols.

Implement components based on the defined protocols.

Component workflow diagram
Component workflow diagram

2.1 Solution overview

Pure prompt engineering is unreliable for tasks like random puzzle generation, answer verification, and hint recommendation. An Agent‑based approach, where a large language model decides which tool to invoke and processes the tool’s output, is required.

2.2 24‑point game task decomposition

Define the thinking module’s interface: protocol, conditions, component description, and parameters.

Implement the components according to the description and parameter design.

AppBuilder architecture diagram
AppBuilder architecture diagram

2.3 AppBuilder framework for AI‑native apps

The framework follows a "thinking + component" pattern. The thinking model (based on ReAct) drives decisions, while components execute concrete functions.

Long‑term memory: persisted variables, knowledge‑base retrieval.

Short‑term memory: multi‑turn dialogue history, system time, etc.

Component description: official components have built‑in descriptions; custom components rely on user‑provided descriptions.

Component execution results: results are fed back to the thinking model for further reasoning.

System prompts, user role prompts, current query, uploaded files, etc.

2.4 Defining the thinking module’s boundaries

Key elements include role prompts, component descriptions, parameter design, output design, and model selection.

# Role task
As a 24‑point game assistant, generate four numbers (1‑13) for the player, verify user answers, and provide hints when needed.

# Tool capabilities
1. Puzzle generation
2. Hint recommendation
3. Answer verification

2.5 Implementing custom components

Three custom components are needed: puzzle generation, answer verification, and hint recommendation. Each component is defined with a description and JSON‑style parameter schema.

Puzzle component description : Generates four numbers within a specified range.

Parameter example: {"name": "start", "type": "string", "desc": "minimum number"}, {"name": "end", "type": "string", "desc": "maximum number"}

Answer verification component description : Checks whether a user‑provided expression evaluates to 24.

Parameter example: {"name": "expression", "type": "string", "desc": "user expression"}

Hint component description : Provides solution suggestions based on the four numbers.

Parameter example: {"name": "number1", "type": "string", "desc": "first number"}, …

Workflow for puzzle component
Workflow for puzzle component
Workflow for hint component
Workflow for hint component

2.6 Model selection

For fast reasoning, the latest Ernie‑Speed AppBuilder‑specific model is used (3‑4× faster than Ernie‑4). The answer‑generation model is Ernie 3.5‑8K for better conversational quality.

2.7 Tips and best practices

Official component descriptions are continuously refined by the platform.

Custom component descriptions and parameter schemas should be clear and model‑friendly.

Choose the thinking model based on cost‑performance; Ernie‑Speed is optimal for official components, while Ernie 3.5/4 offers better generalization for custom components.

3. Summary

Baidu Cloud Qianfan AppBuilder dramatically lowers the barrier to building AI‑native applications. By clearly defining the creative idea, decomposing it into thinking modules and components, and leveraging Agent techniques, developers can quickly prototype functional AI apps such as the conversational 24‑point game.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Agent ArchitectureAppBuilder24-point gameAI native app
Baidu Intelligent Cloud Tech Hub
Written by

Baidu Intelligent Cloud Tech Hub

We share the cloud tech topics you care about. Feel free to leave a message and tell us what you'd like to learn.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.