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.gitConfigure 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Ubiquitous Tech
A ubiquitous public account for pirate enthusiasts, regularly sharing curated experiences, tech learning, and growth insights. Currently publishing articles on AI RAG customer service, AI MCP technology, and open-source design. Personal free Knowledge Planet: Awakening New World Programmer.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
