Artificial Intelligence 6 min read

Building a "Dream of the Red Chamber" Reading Companion Bot with Coze

This article explains how to create an automated reading companion bot for "Dream of the Red Chamber" using the Coze platform, covering knowledge‑base setup, workflow design, JavaScript date handling, weather integration, language‑model note generation, and deployment steps.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Building a "Dream of the Red Chamber" Reading Companion Bot with Coze

Background : The author needs a way to help a child complete reading assignments for the four classic Chinese novels without sacrificing sleep, so they propose building a robot to automate the reading and note‑taking process.

Goal : Design a robot that can read specified chapters, fetch today's weather in Guangzhou, generate reading notes with dates, and output them in a predefined format.

Requirements :

Access to the text of "Dream of the Red Chamber".

A reading workflow that selects chapters based on user input.

Integration with a weather service for daily forecasts.

A summarization component to produce reading notes.

Implementation Steps :

3.1 Knowledge‑Base Preparation

Upload the Dream_of_the_Red_Chamber.txt file to Coze’s knowledge base.

3.2 Reading Workflow Design

Define a Start Input Node where the user specifies the chapter to read.

Use a Knowledge‑Base Node to retrieve the requested text.

After reading, employ a Yunque Language Model Node to generate a reading note.

Add a Code Node that runs JavaScript to obtain the current date.

The JavaScript code is:

async function main({ params }: Args): Promise
{
    const now = new Date(); // create a Date object for the current time
    const year = now.getFullYear(); // get year
    const month = (now.getMonth() + 1).toString().padStart(2, '0'); // get month (0‑based) and format
    const day = now.getDate().toString().padStart(2, '0'); // get day and format
    // concatenate year, month, day
    return `${year}年${month}月${day}日`;
}

Insert a Moji Weather Plugin (DayWeather) Node pre‑filled with the author’s city to record today’s weather.

Finally, format the reading note according to the desired template and connect all workflow nodes with lines for visual clarity.

3.3 Robot Design

Combine the workflow, plugins, and knowledge base into a single robot, set its persona, functions, and execution steps.

4. Publishing and Running

Publish the robot on the domestic Doubao platform by filling in version information, then test the deployed bot.

5. Conclusion

Coze provides a rapid way to build custom bots that automate repetitive tasks, freeing up time for both parents and children. While the current workflow cannot fully automate daily reading and WeChat group posting, future enhancements may expand its capabilities.

JavaScriptAIAutomationChatbotCozeReading Companion
Rare Earth Juejin Tech Community
Written by

Rare Earth Juejin Tech Community

Juejin, a tech community that helps developers grow.

0 followers
Reader feedback

How this landed with the community

login 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.