Architecture Design and Implementation of a Multi-Role AI Agent Investment Research System

    This article explores the architecture and best practices for building a multi-role AI agent system tailored for investment research. It covers transitioning from simple report generation to orchestrating a verifiable research workflow, defining strict input and output contracts, and assigning distinct roles such as bull, bear, technical, and risk reviewers. It further details six core infrastructure capabilities for reliability, a practical execution path for commodity research, position sizing logic, implementation checklists, and the expansion to stock research and active push notifications. Ultimately, the system's value is measured by its reliability and traceability rather than the sheer number of agents.

    1. From “Generating a Report” to “Organizing a Research Process”

    When applying AI agents to investment research, answering questions is the easiest capability to implement, while consistently organizing the research process is the most difficult.

    If a user inputs “analyze methanol,” the system can immediately generate a fluent analysis. However, without explicitly defining the contract, data cutoff point, research timeframe, and evidence sources, this report is likely just a recombination of common opinions. Length, expression quality, and terminology density cannot substitute for actual research quality.

    A more reasonable goal is to convert natural language requests into a set of executable, verifiable, and traceable tasks:

    Clarify research scope → Acquire data → Parallel research → Cross-examination → Risk review → Synthesize report → Continuous observation.

    The value of this design is not to have multiple agents repeatedly answer the same question, but to assign different responsibilities to different roles and enable collaboration through a unified data contract.

    It must be emphasized: automatically generated investment research reports serve as decision-support materials. They should not be directly equated with institutional research quality, and position sizing numbers provided by the model should never be treated as executable trading instructions.

    2. Define Inputs and Outputs to Prevent Runaway Tasks

    1. Inputs Require More Than Just a Product Name

    “Analyze methanol” is suitable as an interactive entry point, but insufficient as a complete execution parameter. The scheduling layer must at least confirm the following information:

    • Research target: Product, specific contract, or contract selection rules.
    • Research timeframe: Intraday, short-term, medium-term, or industry trend.
    • Data cutoff time: Explicitly state the latest data update time used for the report.
    • Task type: Fundamental research, trading scenario analysis, or review of existing positions.
    • Risk conditions: Whether position sizing is allowed, and whether necessary inputs like account equity and risk budget are available.
    • Data permissions: Which data sources are allowed to be used, and whether there are access and redistribution restrictions.

    For missing information, the system can adopt one of two approaches: ask the user, or use pre-declared defaults. Regardless of the approach, it must be recorded in the report. Critical trading conditions should not be silently filled in.

    2. Outputs Should Adopt a Fixed Contract

    A report requires not only the main text but also structured results. It is recommended to include:

    1. Research target, timeframe, and data cutoff time;
    2. Core conclusions and applicable conditions;
    3. Supporting evidence and counter-evidence;
    4. Base, bullish, and bearish scenarios;
    5. Evidence quality and uncertainty explanations;
    6. Risk constraints and conditional position sizing;
    7. Five key observation metrics;
    8. Cited sources, missing data, and failed tasks.

    A fixed contract prevents the synthesizing role from only retaining materials that support its own conclusions, and facilitates subsequent report comparisons and quality evaluations.

    3. Role Division: Seven Roles Do Not Mean Seven Simultaneous Processes

    A role is a combination of responsibilities and configurations, and does not necessarily correspond one-to-one with a process. A role can be executed by an independent worker process or by a temporary execution instance created at the start of a task. The actual deployment method depends on resource budgets, permission requirements, and isolation needs.

    The seven roles suitable for an investment research workflow are as follows:

    Role Core Responsibilities Required Outputs
    Research Coordinator Break down tasks, coordinate disagreements, generate final report Conclusions, scenarios, evidence references, unresolved issues
    Bull Researcher Identify conditions and drivers for upward price movement Bullish thesis, trigger conditions, counter-evidence
    Bear Researcher Identify conditions and drivers for downward price movement Bearish thesis, trigger conditions, counter-evidence
    Technical Analyst Analyze price, volume, open interest, and volatility structure Cycles, calculation parameters, key ranges
    Market Researcher Analyze supply and demand, inventory, costs, and industry events Data sources, timestamps, parameter discrepancies
    Risk Reviewer Check the executability of conclusions and loss boundaries Risk list, constraints, rejection reasons
    Memory & Reflection Agent Review the process and consolidate experience Error attribution, reusable rules, hypotheses to verify

    The first six can participate in a single research session; the Memory & Reflection Agent is more suited to run after the report is completed or the observation cycle ends. The user dialogue entry point receives requests and is not counted as a research role.

    The purpose of the bull and bear roles is to establish a counter-check mechanism, not to pre-determine the direction. Both must be required to state “what evidence would invalidate their judgment,” otherwise the multi-role design easily degrades into opinion performance.

    4. Six Core Capabilities for a Reliable Architecture

    1. Role Configuration: Define Responsibilities and Permissions

    Role configuration should include responsibility boundaries, accessible data, callable tools, output formats, and prohibited behaviors.

    For example, the technical analysis role can calculate indicators but should not fabricate fundamental data; the risk role can request additional evidence but should not modify original market data; the synthesizing role can summarize disagreements but cannot rewrite unverified hypotheses into facts.

    The clearer the permissions, the easier the subsequent audit. Relying solely on prompts to demand “do not exceed authority” is insufficient; sensitive operations must also be restricted at the execution layer.

    2. Skill Encapsulation: Turn Repetitive Processes into Verifiable Modules

    Reusable skills should not just be a collection of prompts; they should include input validation, data processing steps, output templates, and failure handling.

    For example, the market analysis skill needs to clarify:

    • How to handle missing and abnormal values;
    • How to distinguish between specific contracts and continuous sequences;
    • What cycle is used for indicator calculations;
    • How to degrade gracefully when data updates are insufficient;
    • How to preserve sources and calculation parameters in the output.

    For frequently repeated calculations, deterministic programs should be prioritized to complete the task, followed by the model interpreting the results. This reduces numerical drift when the same task is executed multiple times.

    3. Task Board: Explicitly Record Execution Status

    The task board is essentially a queryable task state model. Common states include:

    Pending → Claimed → Running → Pending Validation → Completed.

    In addition, states like failed, canceled, and waiting for dependencies are required. Each task should record the task ID, owner, dependencies, deadline, retry count, and artifact location.

    The board solves the question of “what is the system doing right now.” Without state records, users can only wait for the final text, and operations personnel cannot determine whether a task is running slowly or has lost contact.

    4. Scheduler: Handle Dependencies, Do Not Blindly Parallelize

    Parallelism can reduce waiting time, but only mutually independent tasks are suitable for parallel execution.

    Basic data snapshots should usually be completed first; bull, bear, technical, and market research can run in parallel based on the same snapshot; risk review generally needs to read candidate conclusions; and the synthesized report should be generated after necessary results pass validation.

    The scheduler should also control concurrency, timeouts, retries, and resource budgets. The time consumed in raw cases cannot be taken as a system performance guarantee, as duration is affected by data retrieval speed, task scale, model response, and manual confirmation steps.

    5. Temporary Workspace: Isolate Intermediate Products

    Each research task can be allocated an independent directory or storage prefix to save data snapshots, calculation results, drafts, and logs.

    By default, roles do not read each other’s drafts and only exchange information through validated structured results. This can reduce the risk of early opinions cross-contaminating each other. However, this does not mean they possess statistically independent judgments: the same model, the same data, and similar instructions can still lead to common biases.

    File directory isolation also does not equate to a security sandbox. If code execution is required, network, file access, and system permissions should be further restricted.

    6. Heartbeat and Garbage Collection: Prevent Tasks from Getting Stuck Indefinitely

    Execution instances should periodically report their alive status. When the scheduler detects a heartbeat timeout, it can mark the task for inspection, then decide to retry, hand over, or terminate.

    The key is to avoid side effects from duplicate execution. Each task should have a stable task identifier, artifact submission should pass version checks, and external operations like sending notifications require idempotent control.

    Heartbeat recovery only solves execution reliability; it cannot prove that the research conclusion is correct.

    5. Execution Path of a Methanol Research Task

    The following is an illustrative execution path and does not represent any tool’s actual interface or fixed performance.

    Step 1: Establish Research Context

    The system confirms the target contract, analysis timeframe, and data timestamp to form a unified research brief. If the user does not have account information, specific account position recommendations are disabled, and only risk calculation methods are provided.

    Step 2: Freeze Data Snapshot

    Collect authorized data on prices, trading volume, open interest, inventory, plant operations, imports, and downstream demand, recording the source and update time.

    Different roles must use the data snapshot from the same research batch; otherwise, “inventory decline” and “inventory rise” might simply stem from different statistical dates.

    Step 3: Independent Role Research

    The bull role analyzes the conditions for supply contraction or demand improvement; the bear role checks risks of inventory accumulation, profit changes, and demand weakening; the technical role describes the price structure; the market role explains industry variables.

    Every key argument should be tied to evidence and labeled as either a fact, a calculation result, or an inference.

    Step 4: Cross-Examination and Risk Review

    The system aggregates contradictions, such as “inventory is declining but prices are weakening,” and requires relevant roles to check statistical parameters, time lags, and alternative explanations.

    The risk role reviews liquidity, volatility, contract rollovers, price gaps, and insufficient evidence. If critical data is missing, it should output “no actionable conclusion can be formed” rather than forcing a direction to complete the report.

    Step 5: Synthesize Output

    The final report uses conditional expressions:

    • What conditions support the current judgment;
    • What changes would invalidate the judgment;
    • What indicators need continued observation;
    • What actions the current evidence is insufficient to support.

    This type of expression is more suitable for continuous updates than a simple “bullish” or “bearish” stance.

    6. Confidence, Position Sizing, and Five Thresholds to Avoid False Precision

    1. Confidence Is Not a Model-Self-Reported Win Rate

    The “high confidence” generated by a model can only be treated as a qualitative evaluation and cannot be directly interpreted as the probability of future profit.

    A more robust approach is to separately evaluate data completeness, evidence consistency, information timeliness, and conclusion stability, while displaying missing items. Only by establishing a sufficient historical sample, defining the predicted event and time range, and applying probability calibration can a numerical probability have a clearer interpretive basis.

    Consensus among multiple roles also does not automatically increase confidence; they may share the same erroneous data.

    2. Position Recommendations Must Be Based on Risk Budgets

    An illustrative upper limit for a futures position can be written as:

    Max Lots = floor(Tolerable Loss per Trade / Estimated Risk per Lot).

    Where:

    Estimated Risk per Lot = Stop-loss Price Difference × Contract Multiplier + Estimated Fees and Slippage.

    This is only a risk constraint method, not a profit optimization formula. Actual use also requires checking margin, total account exposure, correlation concentration, and liquidity, while considering the risk of loss exceeding stop-loss estimates due to price gaps.

    When this information is missing, precise lot sizes or fixed position percentages should not be output.

    3. Five Observation Thresholds Should Be Calculable and Updatable

    Methanol research can select the following five observation categories:

    1. Inventory changes: Focus on same-parameter inventory and continuous changes, rather than a single data point.
    2. Supply changes: Track plant operating rates, maintenance, and restarts.
    3. Demand changes: Observe major downstream operating rates and profit changes.
    4. Basis and term structure: Identify relationships between spot, futures, and different contracts.
    5. Price and position behavior: Check whether key range changes are accompanied by changes in participation.

    Specific thresholds should be set based on historical distribution, business logic, and data frequency, and should record their validity period. Percentages should not be arbitrarily assigned just to fill five numbers. For continuous trigger conditions, debounce rules should be added to reduce noise alerts.

    7. Three Implementation Checklists

    Checklist 1: Seven-Role Configuration Check

    Each role should be checked for responsibilities, permissions, inputs, outputs, citation rules, and exit conditions. The Research Coordinator cannot mask disagreements; directional researchers must provide counter-evidence; the risk role must be able to propose suspension suggestions; and the reflection role cannot write unverified conclusions into long-term knowledge.

    Checklist 2: Two Basic Skill Packages

    Research Execution Skill Package: Responsible for parameter checking, data organizing, indicator calculation, evidence archiving, and report format validation.

    Research Review Skill Package: Responsible for comparing historical judgments with subsequent observations, distinguishing between data errors, reasoning errors, and execution errors, and updating verified rules.

    The two skill packages should be versioned independently. Reviews should not solely determine research correctness based on profit and loss; they should also check whether conclusions adhered to pre-declared conditions.

    Checklist 3: Ten Operation Entry Points

    Below are general operational intents, not specific product commands:

    1. Create a research task;
    2. Confirm or modify research scope;
    3. View task progress;
    4. View data snapshots;
    5. View role artifacts;
    6. Retry failed tasks;
    7. Cancel research tasks;
    8. Export reports and evidence indexes;
    9. Configure scheduled observation rules;
    10. View historical reviews.

    Operation entry points can be provided via dialogue, admin pages, or APIs, but actions involving cancellation, external push, and permission modifications must have explicit confirmation and audit records.

    8. Expanding from Futures to Stocks and Active Push

    When migrating to stock research, the scheduling, evidence management, and risk review frameworks can be reused, but industry analysis skills cannot be directly copied. Stock research also needs to consider financial statements, corporate governance, equity changes, valuation, industry comparison, and event impacts, while unifying price adjustments and financial parameters.

    Active push requires adding an independent pipeline:

    Timed trigger → Acquire incremental data → Check rules → Generate change summary → Dedupe and rate-limit → Send notification.

    Notifications should answer “what changed, why it is worth noting, and which research it corresponds to,” rather than repeatedly sending full reports. Silent periods, failure retries, expired information filtering, and user subscription scopes should also be set.

    A clear boundary must be maintained between automated research and automated trading. Push alerts can be automated, but trade execution requires a separately designed authorization, risk control, and manual confirmation mechanism.

    9. Evaluating System Reliability over Role Quantity

    A sustainable investment research system should be able to explain conclusion sources, expose missing information, handle failed tasks, and revise judgments when new evidence emerges.

    It is recommended to continuously monitor task completion rates, data freshness, citation traceability, manual correction rates, repeated alert rates, and the time and resource consumption of a single research task. Research quality evaluation should also adopt fixed standards to avoid only showcasing better-performing cases.

    Multi-role is just an organizational method; reliability is the core capability. What is truly worth consolidating is not how much a single report resembles professional research, but whether the system can repeatedly execute the same set of clear, testable, and reviewable research processes.