Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Exploring JoyAgent‑JDGenie: Core Workflow and Prompt Engineering (Part 2)

This article walks through the JoyAgent‑JDGenie open‑source AI agent framework, detailing its multi‑agent architecture, backend and frontend components, deployment steps, configuration files, and the comprehensive prompt templates that drive planning, execution, and ReAct‑style reasoning.

The JoyAgent‑JDGenie project is an open‑source, multi‑agent AI system released by JD. It combines a Spring Boot backend (Java 17, Spring Boot 3.2.2) that orchestrates agents, a React + Vite frontend (port 3000) for user interaction, a Python‑based tool service (port 1601) and an MCP client service (port 8188) for external tool integration.

Key architectural features include:

Plug‑in‑style multiple agents and tools.

Iterative planning (Planner) and execution (Executor) with a Plan‑and‑Executor mode combined with a ReAct mode.

Cross‑task workflow memory that retains information across similar tasks.

Tool evolution via automatic disassembly and re‑assembly, generating new tools from existing ones.

Deployment workflow :

Prepare the environment: JDK 17, Python 3.11, Node.js, and the UV package manager.

Clone the repository:

git clone [email protected]:jd-opensource/joyagent-jdgenie.git

Configure the backend LLM settings in genie-backend/src/main/resources/application.yml (LLM server URL and API key).

Copy genie-tool/.env_template to genie-tool/.env and set environment variables such as OPENAI_API_KEY, OPENAI_BASE_URL, DEFAULT_MODEL, and SERPER_SEARCH_API_KEY.

Run the dependency check script: sh check_dep_port.sh (verifies ports and dependencies).

Start all services with sh Genie_start.sh. The project occupies four ports: 3000 (frontend), 8080 (backend API), 1601 (tool service), and 8188 (MCP client).

After launching, the frontend provides a responsive React UI that streams agent responses via HTTP and Server‑Sent Events (SSE).

Prompt engineering is central to the system. Three main agent prompts are defined in application.yml:

Planning Agent Prompt

# Role
You are an intelligent assistant named Genie.
# Description
You are a task‑planning assistant that decomposes user requests into a list of tasks for the planning tool.
# Skills
- Break down user tasks into clear, independent subtasks (max 5).
- Avoid over‑splitting simple tasks.
- Ensure logical ordering and no overlap.
# Output format
First output a reasoning section (<200 words), then invoke the planning tool.
# Language
All output must be in **Chinese**.

Executor Agent Prompt

# Role
You are a reliable task‑execution expert skilled in reasoning, tool calls, and reflection.
# Workflow
1. Reasoning (≤200 words) – decide the next action.
2. Tool calling – execute the chosen tool (at least two search calls per task).
3. Evaluate results; if unsatisfactory, rethink and retry.
# Constraints
- Prefer efficient tools, follow API specs, avoid fabricating tools.
- Limit search calls to 3‑5 per task.
- Abort after three consecutive failures.
- Output language: **Chinese**.

ReAct (Super‑Agent) Prompt

# Role
You are a super‑intelligent agent named Genie.
# Requirements
- Use the report tool after gathering sufficient information via search.
- Default to HTML web‑report if no format is specified; obey user‑specified formats otherwise.
- For tabular output, prefer Excel/CSV.
# Process
Repeat the cycle: Think → Act → Observe.
- Think: ≤200 words, state the next goal.
- Act: either a tool call or a final answer.
- Observe: record tool results.
# Language
All output must be in **Chinese**.

These prompts guide the system through a three‑stage pipeline: the Planner creates a task list, the Executor carries out each subtask using the defined tools, and the ReAct super‑agent synthesizes results into the final response (HTML report, Markdown, or structured data).

Additional utility prompts for summarization and file handling are also provided, enforcing constraints such as no hallucination, no exposure of internal prompts, and compliance with safety and privacy rules.

Overall, the article demonstrates how to set up, run, and extend JoyAgent‑JDGenie, offering concrete scripts, configuration examples, architectural diagrams, and the full set of prompt templates that enable sophisticated multi‑agent reasoning.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

AI Agentsprompt engineeringReActSpring BootMCP integrationdeployment scriptsJoyAgent-JDGenie

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion