Engineering a Multi-Agent Investment Research System: From Chatbots to Deliverables
This article explains how to engineer a multi-agent system for investment research on commodity futures, moving beyond conversational demos toward reproducible, auditable output. It covers a six-role architecture with least-privilege write access, sandboxed execution and directory isolation, structured handoff contracts, rule-based confidence and position sizing, continuous scheduling with incremental monitoring, and layered evaluation, cost, and risk controls. Readers will find practical architecture patterns, a directory layout, a JSON handoff schema, and pseudocode for turning subjective judgments into computable metrics.
1. The Starting Problem: The Gap Between “Can Chat” and “Can Deliver”
Most teams experimenting with agents for investment research stop at the stage where the system can hold a conversation and run commands. The model can explain what a metric means and execute a script, but three typical failures appear once a real task begins. First, context pollution: information from multiple subtasks ends up in the same session, so the conclusion for one instrument biases the judgment for the next. Second, the process is not reviewable: the final conclusion has no evidence chain and cannot be traced back to data sources and calculation steps. Third, there is no continuity: every run must be initiated manually, and the system never proactively detects market changes.
The engineering goal, therefore, should not be a longer conversation. It should be to turn the agent into a research pipeline with role boundaries, execution isolation, persistent state, and proactive triggering. The sections below use a commodity futures research scenario to describe a general, workable architecture.
2. Overall Architecture: Dividing Responsibilities Across Six Roles
The first step toward a stable multi-agent system is to break “research” into responsibility units that can be accepted and verified independently. One workable division:
- Data steward: acquires, cleans, and aligns data such as prices, inventories, operating rates, and freight, and outputs timestamped data snapshots.
- Supply chain analyst: maps transmission relationships from upstream raw materials to downstream demand and indicates the direction of change in the supply-demand balance.
- Technical analyst: handles volume-price structure, basis, and calendar spreads, and outputs key levels and invalidation conditions.
- Event and sentiment analyst: tracks plant maintenance, policy changes, and import/export shifts, and labels the credibility of information.
- Risk officer: runs stress tests and checks for correlation regime shifts and liquidity constraints, with the power to recommend a veto.
- Chief investment officer: performs synthesis and adjudication only, outputting the conclusion, confidence, position range, and observation thresholds.
The key design principle is least-privilege writes: each role can write only to its own output directory, and the final report is aggregated one-way by the adjudicating role, which prevents roles from overwriting each other.
3. Isolated Execution: Sandboxes and Least Privilege
Isolation is not security decoration; it is a precondition for reproducibility. Assign each role a separate working directory and runtime environment, sharing only read-only input snapshots. Network access should be tiered by role: the data role may reach public data sources, while all other roles are offline by default. A sample directory convention:
/workspace/shared/inputs # read-only data snapshots/role_data/out/role_chain/out/role_technical/out/role_event/out/role_risk/out/role_chief/final
Three hard constraints apply: roles may not read or write each other’s directories directly; all external commands run in restricted containers with timeouts; and artifacts must be structured files so they can be validated by machine.
4. Handoff Protocol: Structured Contracts Instead of Natural Language
Multi-role failures usually stem from vague handoffs. Define a unified artifact schema, for example:
{"role": "chain_analyst","target": "a chemical product","conclusion": "supply-demand margin weakening","confidence": 0.62,"evidence": [{"source": "public inventory data", "period": "last four weeks", "direction": "accumulating"}],"invalidators": ["inventory turns to destocking", "downstream operating rates rebound significantly"],"next_questions": ["whether import arrivals exceed expectations"]}
The adjudicating role consumes only this structure and never reads process logs directly. This compresses context length and closes the loop between conclusion, evidence, and invalidation conditions, so any conclusion can be questioned and reviewed.
5. Confidence and Position Sizing: Turning Subjective Judgment into Computable Values
Confidence should not be produced off the cuff by the model. It should be synthesized from explainable rules, for example a weighted combination of evidence agreement, data freshness, and historical hit rate. Position sizing is then determined jointly by confidence and a risk budget, where the risk budget is constrained by volatility and maximum drawdown. Sample pseudocode:
confidence = 0.5 * evidence_agreement + 0.3 * data_freshness + 0.2 * historical_hitrisk_budget = min(0.02, 0.5 * annualized_vol)position = base_size * confidence * (risk_budget / annualized_vol)
The final report always contains five categories of observation thresholds: inventory turning points, basis extremes, operating rate ranges, cross-product spreads, and changes in position structure. Thresholds make the report falsifiable: readers know under what conditions the conclusion should be overturned.
6. Continuous Operation and Proactive Observation
Long-running operation depends on three things: scheduled triggering, incremental state storage, and alerting. The scheduling layer triggers data updates daily or weekly. The state layer stores the previous conclusion and thresholds, forming a comparable time series. When any threshold is breached, monitoring triggers an incremental research run rather than a full rerun. General cloud capabilities can carry this: object storage holds snapshots and reports, a message queue decouples tasks, a container platform runs the sandboxes, and logging plus monitoring and alerting provide observability. If you use the relevant general products from Baidu AI Cloud, the same principles of responsibility separation and least privilege should apply.
7. Evaluation, Cost, and Risk Control
Evaluation should be layered: the data layer checks completeness and alignment; the role layer checks schema compliance and evidence sufficiency; the system layer checks that the report contains confidence, position, and thresholds. For cost, use a two-stage strategy of cheap screening first and deep analysis second, and cache repeated queries. For risk control, state clearly that the system output is research assistance rather than investment advice, keep a human review step, and label every conclusion with its data timestamp and sources of uncertainty.
8. Conclusion
The value of a multi-agent investment research system lies not in the number of roles but in responsibility boundaries, handoff contracts, and falsifiable mechanisms. Make these three solid, and a single natural-language instruction can be reliably converted into institutional-grade output that is reviewable and can evolve over time.
