Building a Digital Human Agent for R&D: A Three-Layer Architecture with Offline Knowledge, MCP, and Personalized Skills
Author: vivo Internet Search Team - Yang Zhan
Targeting the pain point that R&D personnel are heavily occupied by repetitive tasks such as problem troubleshooting and data verification, which squeeze out core development time, this article builds a lightweight "R&D Digital Human Agent System" based on the OpenTask large model. The system adopts a three-layer architecture of "offline knowledge base static support + MCP dynamic interface calls + personalized Skill reasoning", structuring personal private experience into a static repository, linking real-time online business systems, and replicating the individual's troubleshooting thought process and work habits. It achieves a full-process automated closed loop of problem acceptance, information retrieval, logical analysis, and solution output. The system has replaced over 80% of tedious tasks, features low invasiveness and self-evolution, allowing R&D personnel to truly focus on core technical work.
1-minute visual summary of key points👇
一、Project Background
In daily software development and operations, R&D personnel face the pain point that repetitive, transactional tasks account for a disproportionately high percentage of their time, severely squeezing out core development and architecture design work. A large amount of energy is consumed by low-value tasks such as problem troubleshooting, requirement verification, log analysis, problem localization, data lookup, and interface validation, leading to a significant drop in efficiency for high-value work like focused coding, technical tackling, and architecture optimization. The R&D workflow becomes redundant and fragmented.
Traditional AI programming assistants only support code completion, syntax correction, and code writing. They cannot adapt to the full R&D workflow, lack private offline knowledge adaptation, online business interface integration, and personalized problem analysis logic, and fail to match an individual's R&D habits.
Based on these pain points, relying on OpenTask (similar to WorkBuddy/CodeX), an intelligent Agent office tool, we independently developed a lightweight R&D Digital Human Agent System, positioning it as a personal digital mirror of the R&D engineer—thinking and handling problems like the engineer does. Around this goal, the system is expected to have three core capabilities:
- Accumulate personal knowledge: Structurally encapsulate private experience from service architecture docs, flowcharts, RAG topology relations, business scenarios, and historical cases into an offline knowledge base, forming a personal knowledge asset that can be called upon at any time and continuously accumulated.
- Learn troubleshooting thought processes and work habits: Use personalized Skills to replicate the individual's problem analysis steps, troubleshooting priority, and answering logic, making outputs align with the person's thinking style and work habits.
- Self-optimization ability: Continuously accumulate high-frequency problems, iterate reasoning rules, and correct answer logic during daily use, achieving ever-increasing precision and adaptation—self-evolution.
Let this digital mirror replace humans in the entire process of problem reception, information retrieval, logical analysis, and solution output, automating tedious R&D tasks and freeing up R&D focus for core technical development.
二、Overall Design
This system uses the OpenTask large model as the core reasoning engine and adopts a three-layer architecture of "knowledge base static support + MCP dynamic calls + personalized Skill reasoning", balancing offline knowledge stability, online business real-time, and personal R&D workflow adaptability. The overall architecture is lightweight, low-invasive, and suits personal R&D daily office scenarios.
2.1 Design Thinking
Process steps:
1. User asks: simple command initiates consultation
2. Agent parses: identifies type · decomposes request
3. Knowledge matching + interface validation: offline retrieval · MCP real-time data
4. Skill reasoning: step-by-step derivation according to personal skill logic
5. Solution output: standardized result · problem closed loop
6. Self-evolution: accumulate high-frequency problems · iterate rules
2.2 Overall Architecture Components
OpenTask Large Model (core reasoning layer): Supports long code contexts, log text, and technical documents with a super-long context window, and supports offline local reasoning mode.
Digital Human Private Local Knowledge Base (static support layer): Carries the R&D personnel's personal private knowledge, runs completely offline locally, does not depend on external networks, has no data leakage risk, and provides the large model with exclusive, private, long-term static knowledge materials, solving the pain point that general large models do not know personal historical experience and internal project private data. Simply put: it is the digital human's "personal notebook + project archive room". All personal troubleshooting experience and internal private documents are stored locally and can be retrieved at any time.
MCP Online Interface Encapsulation (dynamic capability layer): MCP can be understood as a multi-end collaboration protocol / unified tool gateway, serving as a standardized channel for the digital human to connect to enterprise online business systems, third-party tools, and online services. It addresses the shortcoming that the offline knowledge base only has static historical data and cannot obtain real-time dynamic information.
Custom Skill System (personalized rules layer): Skill refers to reusable, customizable R&D-specific task skills. It is the core carrier for replicating an R&D engineer's unique troubleshooting ideas, workflow, and operating habits. Unlike the generalization ability of a generic large model, it represents the unique logic of that engineer.
Four-Layer Architecture (core-radiating)
Digital Human Private Local Knowledge Base Components
MCP Online Interface Encapsulation Components
Custom Skill System Components
三、Core Function Implementation
Based on the four-layer architecture, the system implements four core capabilities: intelligent problem acceptance, multi-source information fusion analysis, personalized logical reasoning, and standardized solution output. The full process automatically replaces manual tedious operations.
3.1 Intelligent Problem Acceptance and Semantic Parsing
Users initiate consultations with simple commands. The Agent, leveraging OpenTask's semantic understanding, accurately identifies problem types (code errors, business exceptions, operations issues, process consultations, syntax questions, etc.), automatically decomposes the core request, problem scenario, and key parameters, filters invalid information, and locks the analysis direction, reducing communication cost.
1. Command understanding · Service initialization
Question Initialize filter service music-xxx
Initialization complete
Root directory: /Users/****/Documents/work/opentask
Service name: <your-business-service-name>
Service ID: <your-business-service-name>
DAG ID: <your-dag-id>
Process type: first initialization
The Agent accurately understands the intent of this command—locating the target service, loading its architecture and knowledge context, and preparing for subsequent problem analysis.
2. Problem acceptance · Key information extraction
Question: In the association word service, entering "iQOO 120W charger" makes the product card show "iQOO12 original accessory". Need to locate the source of the hint text.
Good, found the service ID: portal-xxx
Now let me extract the key information of the problem:
User input: "iQOO 120W charger"
Result: product card hint is "iQOO12 original accessory"
Core question: why is the hint "iQOO12 original accessory"
The Agent locates the service ID (portal-xxx), then automatically extracts the three elements of "user input / result / core question" from the user's description, locking the analysis direction.
3.2 Offline Local Knowledge Base
The large model has knowledge blind spots. The Agent prioritizes retrieving the local structured offline knowledge base, solving the pain point that generic large models don't understand private projects or personal accumulated experience. This section is organized in two parts: content and retrieval methods.
1. Offline library content
Offline knowledge base directory structure:
Looking at the offline knowledge base directory structure from another angle, it is organized into three categories: "project private library / personal repository / team offline document library":
1.1 Project private library
1.1.1 Public information
·Jargon / coded terms
·Scenario ⇄ service relationships
·Business-specific terms
1.1.2 Service information
·Source code
·Service basic info: name, version, release time, code commit info …
·Service architecture
-Service nodes —— decomposed as independently as possible into small, fine-grained local nodes
-RAG topology relations —— the connecting lines between points
1.2 Personal repository
·Local execution specifications
-code logic interpreted directory
-business logic interpreted directory
·Personal troubleshooting notes (docs directory)
-Problem description
-Location approach
1.3 Team offline document library
·Requirement documents
·High-level design documents
2. Deterministic retrieval based on predefined flowcharts
Flow and node modeling: a complete RAG task is broken into a directed node sequence (chain or DAG). Each node defines clear specifications, at least including:
- Trigger condition / input: parameter source, input/output normative judgment (nullable, format checks, etc.).
- Responsibility scope: logical summary explanation — code-logic + business-logic.
- Output declaration (key): structured data (field names, field format checks, null checks).
The whole process forms a retrieval navigation map, essentially fixing "where to look, what to retrieve, in what output format" as node specifications. At execution time, it relies on the knowledge base, MCP, and Skill working together.
3.3 MCP Online Interface Dynamic Call and Validation
MCP can be understood as a multi-end collaboration protocol, a path connecting the digital human with online systems, enabling real-time data query (read) and online tool automation (write), so the digital human does not rely only on historical experience and addresses the shortcoming of offline knowledge bases (only static historical data, no real-time dynamic info).
Core Functions
① Service basic information: see file service-info.json, containing service name, version, release time, commit, and other metadata.
{
"serviceId": "portal-xxx",
"version": "10",
"DAGId": "4228",
"PROJECT_NAME": "search-biz",
"git_address": "https://gitlab.your-company.com/java-project/search-biz.git",
"git_branch": "portal-branch",
"commit_id": "e792fcd70597663e1a032898f5427cce9d2bc6",
"updateTime": "2026-01-14 20:01:50.0",
"flowStatus": "true",
"moduleInfo": {
"module_name": "portal-xxx-3.4.5",
"module_version": "",
"desc": "v3.4.5 completed large-capacity battery parsing\r\nTT Yang\r\n2026-01-14 19:20:26"
},
"gateway": {
"name": "common cluster (search)",
"group": "common"
},
"fetchTime": "2026-06-17T07:14:39Z"
}
② Service RAG topology: see file dag-structure.json, rendered as a service flow diagram, showing the invocation and connection relationships between nodes.
③ Local node detailed info: see file flowNodesInfo.json, recording node responsibilities, input/output contracts, and null-check rules.
{
"nodeId": "main",
"nodeName": "parameter initialization",
"dagId": "DAG-0327290e",
"codeLogic": "Parse request parameters, initialize context and default configuration",
"businessLogic": "Validate source channel, keywords, pagination parameters; fill business defaults when missing",
"input": {
"keyword": { "type": "string", "nullable": false },
"channel": { "type": "string", "nullable": false },
"pageSize": { "type": "integer", "nullable": true, "default": 10 }
},
"output": {
"ctx": { "type": "object", "nullable": false },
"valid": { "type": "boolean","nullable": false }
}
}
④ Source code retrieval: download code via git into the sourceCode directory for code-level analysis and localization.
⑤ Online service requests: real-time return of each node's execution status, input parameters, output parameters, time consumption, etc. Online requests return real-time status, I/O parameters, and timing, supporting fusion analysis of static knowledge plus dynamic data.
⑥ Online document content: pull requirement documents and other online docs to supplement real-time business context.
Core Requirements
MCP Provider:
- Unified interface: Unified interface specification and return structure for consistent request and parsing by consumers, reducing integration cost.
- Data real-time: Guarantee returned data is the live online state, avoiding stale or cached distorted data.
- Large content return link: When MCP returns large content, return a download link instead of the raw content to avoid context bloat and transmission blocking.
MCP Consumer:
- Timeout circuit breaking: Set a timeout threshold for each call; break on timeout to avoid a single-point interface blocking the entire system.
- Failure degradation: On failure or circuit break, degrade to the offline knowledge base to keep the process running.
3.4 Custom Skill Step-by-Step Reasoning Analysis
Goal: Personalized Skill reasoning is the digital human Agent's exclusive R&D behavior and logic engine, the core differentiator that replicates an R&D engineer's unique troubleshooting approach, work habits, and business processing style.
Skill is the execution carrier that orchestrates the following three components according to the engineer's fixed working logic:
- Agent large model: provides general understanding, planning, and summarization capabilities.
- Offline knowledge base: provides private static experience.
- MCP interfaces: provide online real-time data.
Throughout the full lifecycle, Skill cannot work independently of the Prompt system; the two are deeply bound and mutually driving, jointly defining the digital human's behavior boundary, thinking style, and output standards.
1. Skills Admission Conditions
- Implicit automatic trigger: match keywords, semantic understanding trigger.
- Explicit manual invocation: enter /help or @code-review in the dialog to directly trigger the corresponding Skill, e.g., /init-flow user-svc-001.
Skill admission condition settings:
2. Skill Global Flow Orchestration Layer
- Task decomposition & step-by-step execution: Break down complex R&D tasks and execute step by step.
- Multi-scenario branching: Support multiple scenario branch judgments and conditional transitions.
- Unified scheduling: Unify scheduling of offline knowledge base, MCP interfaces, Prompt rules, and Script scripts for full-process automated orchestration.
- Fault tolerance: Built-in retry, timeout, and degradation step mechanisms.
Skill execution steps & order settings:
3. Prompt Settings for Execution Plan
- Fill the process skeleton: Skill is the "process skeleton", Prompt is the "brain logic" filling the skeleton, defining each step's execution plan, constraint rules, analysis dimensions, and delivery standards.
- Provide decision basis for scripts: Provide decision basis and rule constraints for Script script execution.
Prompt execution plan settings:
4. Script Scripts for Fixed Actions
- Standardized batch actions: Execute standardized fixed actions in batch.
- Reusable execution: For scenarios that run the same action multiple times, ensuring consistency and reusability.
3.5 Standardized Result Output
After analysis, the Agent outputs structured results with clear, directly actionable content, completing the problem closed loop. This section explains from two dimensions: output content and expression style.
1. What content is output
- Conclusion output: Directly give the cause analysis and final conclusion.
- Modification suggestions (modification_suggestions.md): Specific code/configuration change suggestions that can be directly applied.
- High-level design (high_level_design.md): Output a standard high-level design document for requirements or solutions.
- Key case consolidation (key_cases.md): Consolidate key cases and troubleshooting processes for reuse and traceability.
2. Expression style
The output style can switch between "technical" and "popularized" to adapt to the audience. Two methods control this:
- Persona differentiation: Use different personas to control expression dimensions (tone, professionalism, audience perspective).
- Skill + Prompt differentiation: Use different Skill and Prompt configurations to control the form of the output (structure, detail level, terminology choices).
- Technical style: Retains professional terms, code snippets, and field details, emphasizes root cause and invocation chain, ready for review and implementation.
- Popularized style: Weakens jargon, uses business language to paraphrase, emphasizes impact and conclusions, allowing non-technical audiences to understand and decide quickly.
Complete Business Flow
3.6 Feature Demonstration
Phone price filter logic
Background: A user who has claimed a 6000+ government subsidy wants to jump directly to a list of eligible models above 6000, connecting the claim and usage steps to improve conversion efficiency.
Question: In the filter service, can it precisely filter out phones above 6000 yuan, excluding those in the 5000-6000 range?
🔴 Cannot precisely filter phones above 6000 yuan without including 5000-6000 yuan.
Three reasons:
- The price classification system has no "above 6000" option
The system uses a price classification (FilterItemEnum.MIN_PRICE, i.e., filterMap key=2) with only 6 hardcoded intervals:
There is no "6000 and above" category. "5000 and above" is a catch-all interval that includes all phones ≥5000, so it cannot distinguish 5000-6000 from 6000+.
- The filtering logic uses hardcoded inPriceRange
In FilterStrategy.java, the inPriceRange method hardcodes price range judgments:
1. User asks: simple command initiates consultation
2. Agent parses: identifies type · decomposes request
3. Knowledge matching + interface validation: offline retrieval · MCP real-time data
4. Skill reasoning: step-by-step derivation according to personal skill logic
5. Solution output: standardized result · problem closed loop
6. Self-evolution: accumulate high-frequency problems · iterate rules
As long as "5000 and above" is selected, all phones with price ≥5000 pass the filter, including those in the 5000-6000 range. The categories cannot be split because the granularity is insufficient.
四、Agent Extension Capabilities: What Else Can It Do
The core functions above focus on the main scenario of "problem troubleshooting and answering", but OpenTask-driven Agent capabilities go far beyond that. With strong code understanding, logical reasoning, and context generation, the Agent achieves a role leap from "passive answering" to "active empowerment", covering key stages of the R&D lifecycle.
4.1 Solution Output — Complete Closed Loop from Problem to Solution
- Immediate fix suggestions: For specific bugs, configuration errors, or logic defects, directly provide fix code or configuration suggestions that can be applied after confirmation.
- Architecture optimization suggestions: For systemic issues like module coupling, poor extensibility, or performance bottlenecks, provide module splitting, interface refactoring, and caching strategy suggestions.
- Technology selection comparison: Based on project context, compare candidate solutions' performance, maintainability, compatibility, and team fit to aid decision-making.
- Solution trade-off analysis: Provide a comparison matrix of benefits, costs, risks, and implementation difficulty for multiple solutions.
4.2 High-Level Design — Generate Standard Design Documents from Requirements
- Requirement analysis and decomposition: Identify functional points, non-functional requirements, constraints, dependencies, and translate vague business language into clear technical requirements.
- System architecture design: Provide module division, responsibility boundaries, interface definitions, data flow design, deployment topology, and output architecture diagrams and explanatory documents.
- Interface and data design: Define interface contracts and data models (table structure, index strategy, lifecycle), and output reviewable interface documents and data dictionaries.
- Review points & templated output: Generate review checklists, flag key decision points and risks; output complete high-level design documents per team templates.
4.3 Code Generation — The Last Mile from Design to Implementation
- Scaffold code generation: Automatically generate directory structure, configuration files, base classes, and interface skeletons based on module division and interface definitions.
- Core logic code drafts: Generate skeleton code for data validation, business process control, exception handling, logging, etc., for refinement.
- Unit test case generation: Generate test cases for normal paths, boundary conditions, and exception scenarios based on code and interface contracts.
- Configuration and deployment scripts: Generate configuration templates, Dockerfile, CI/CD pipeline scripts for full-chain assistance from code to deployment.
After pasting a requirement document, the Agent can generate a complete high-level design and code changes at once—from requirement decomposition, architecture and interface design, to code drafts, covering the full "design → implementation" chain end to end.
High-level design output: Based on the pasted requirement document, the Agent automatically produces a complete design document covering requirement decomposition, architecture, and interface design.
Two detailed documents generated:
1. Impact of power recognition on association word intent and fix plan.md (334 lines)
2. Power recognition code implementation example.md (724 lines)
🎯 Modification requirements and corresponding solutions
✅ Requirement 1: Skip power judgment for model words and series words
Core logic: add power pattern detection detectPowerPattern() and remove extractPowerAndRemove()
Regex: \\d+[安aA瓦wW] (matches digit + 安/a/A/瓦/w/W, no space between)
✅ Requirement 2: Intent determination ensures accessory type is included
Data cable accessory: detect \\d+[安aA] → set dataCableIntentionFlag
Charger accessory: detect \\d+[瓦wW] → set chargerIntentionFlag
✅ Requirement 3: Sorting text score considers a and w field bonuses
Bonus logic: when power info is recognized, add 0.05 to mix_score
Ranking optimization: in dedup and final sorting, prioritize power-related association words
五、Implementation Results
Workload reduction: Replaces 80%+ of tedious tasks like problem lookup, troubleshooting, and data verification, greatly reducing fragmented time and effectively focusing on high-value work like core coding, architecture optimization, and technical tackling.
Error reduction: Leveraging standardized knowledge base and fixed Skill reasoning logic, avoids manual oversight, experience bias, and memory lapses, significantly improving troubleshooting accuracy and efficiency.
Experience accumulation: Structurally encapsulate scattered personal R&D experience into a knowledge base, reuse and solidify personal technical experience, achieving experience fixation and efficient reuse.
High adaptability: Lightweight deployment, no business intrusion, fully fits personal R&D scenarios. No need to modify existing business systems; ready to use.
六、Future Optimization Iterations
Based on current results and R&D pain points, subsequent iterations will focus on five dimensions: knowledge base intelligence, Skill reasoning refinement and Prompt decision-making, service-ization and external service capabilities, Loop closed-loop monitoring, and autonomous learning.
6.1 Knowledge Base Intelligence Upgrade
Optimize structuring capabilities, add automatic incremental updates to automatically capture new problems, solutions, and documents; improve vector retrieval accuracy for complex, ambiguous scenarios; classify and grade knowledge base content for precise scenario matching.
6.2 Skill Reasoning Refinement and Prompt Decision Mechanisms
Enrich the custom Skill rule library, create dedicated reasoning templates; add priority mechanisms, scenario-adaptive switching, and visual editing. Further introduce a joint Skill + Prompt decision mechanism:
- Skill decomposition and refinement: Break coarse-grained Skills into atomic skills (e.g., "code error troubleshooting" into compilation error analysis, runtime exception localization, dependency conflict resolution), each with independent reasoning logic.
- Prompt decides "whether to do it": Before executing a Skill, judge whether the problem falls within its scope and whether it is worth invoking; for ambiguous boundary problems, make accept/reject/redirect decisions.
- Prompt decides "how to do it": Choose the optimal execution strategy—which Skill, whether to combine, call order, whether MCP assistance is needed—making execution paths smarter.
- Skill combination and orchestration: Dynamically combine multiple fine-grained Skills based on conditions to handle complex scenarios requiring multi-step reasoning and multi-skill collaboration.
- Skill effectiveness feedback loop: Record satisfaction, adoption rate, and closure rate to continuously optimize rules and decision logic, achieving self-iteration and evolution.
6.3 Service-ization and External Service Capabilities
Currently the Agent runs locally, essentially a personal digital mirror. Future plans include exporting analysis capabilities through channels like WeChat official accounts, focusing on:
- Read-only capability boundary: Strictly limit external access to read-only queries and analysis; no write/update/delete permissions, ensuring no side effects.
- Problem boundary definition: For irrelevant problems (chitchat, non-technical inquiries, out-of-scope), directly return clear boundary messages without futile attempts.
- Channel adaptation: Adapt to official account message formats, interaction styles, and response timeliness to ensure consistent experience.
- Identity and permission control: Differentiate internal and external user privileges; external users only get read-only public interfaces, protecting private knowledge and sensitive data.
6.4 Loop Closed-Loop Monitoring Capability
Currently the flow is single-shot triggered. Future work introduces Loop closed-loop monitoring, allowing the Agent to continuously supervise whether the flow is actually executed to completion and whether the problem is fully resolved:
- Execution status tracking: Continuously track whether the solution was adopted, whether changes were applied, and whether the problem was verified as resolved.
- Closure validation mechanism: Set validation points for code/config/architecture solutions to check if they truly resolve the issue, avoiding "false closure".
- Abnormal interruption recovery: When the flow is interrupted due to interface timeout, network issues, or user absence, it can resume from the breakpoint, ensuring long-process continuity.
- Periodic inspection reminders: Set inspection cycles for historical problems to check for recurrence and new anomalies, upgrading from "one-time fix" to "continuous assurance".
- Loop timeout and exit mechanism: Set timeout thresholds and maximum loop counts to avoid infinite loops; when closure cannot be achieved, proactively exit and request human intervention.
6.5 Autonomous Learning Capability Optimization
Introduce few-shot autonomous learning, allowing the Agent to automatically accumulate high-frequency problems, optimize answer logic, and iterate Skill rules during daily use, becoming increasingly precise and tailored to personal work habits, gradually achieving full-process autonomous and intelligent assistance.
七、Conclusion
This R&D assistance intelligent Agent based on OpenTask precisely addresses the core pain point of R&D personnel being overloaded with tedious daily tasks and core work being squeezed. Through the innovative architecture of offline knowledge base + MCP online interfaces + personalized Skill reasoning, it achieves automated, standardized, and personalized implementation of R&D problem troubleshooting, consulting, and analysis work, effectively improving personal R&D efficiency and reducing repetitive workload. Through continuous iterative optimization, it can further expand scenarios, raise intelligence levels, and become a personal full-process R&D intelligent assistant, maximizing the liberation of R&D productivity.