Technical Architecture and Implementation of a Multi-Agent Advisory System

    This article explains why advisory scenarios benefit from a multi-agent architecture and how to build one in practice. It covers a five-layer design spanning data ingestion, feature and indicator computation, agent capabilities, orchestration, and presentation; the responsibility boundaries of core agents such as stock analysis, stock screening, monitoring, portfolio diagnosis, and review; event-driven proactive delivery with idempotent deduplication and rate limiting; a three-tier memory and user profile design; task hosting, strategy backtesting, and low-friction validation; and the compliance, security, and observability requirements specific to advisory use cases. It closes with a four-stage evolution path for teams adopting this pattern.

    1. Why Advisory Scenarios Need a Multi-Agent Architecture

    Traditional research tools are essentially “passive query” systems: the user enters conditions and the system returns results. This works acceptably in low-information-density, slow-moving domains, but securities markets are a high-frequency, high-noise, strongly uncertain environment. The real pain point is not “I can’t find the data” but “I don’t know what to look up, when to look it up, or how to act on what I find.” Next-generation advisory systems should therefore shift from responding to queries to proactive service: automatically scanning information, surfacing opportunities and risks, attributing unusual movements, and validating outcomes across pre-market, intraday, and post-market phases.

    A single monolithic model cannot simultaneously deliver real-time responsiveness, domain depth, and controllability. Splitting capabilities into specialized agents and coordinating them through an orchestration layer yields three engineering benefits. First, single responsibility: each agent’s prompts, tool set, and evaluation set evolve independently. Second, replaceability: any stage can switch to a different model or rules engine without affecting the rest of the system. Third, auditability: every conclusion can be traced back to a specific agent, a data snapshot, and a tool call chain. This is why multi-agent architectures have become the mainstream choice for advisory scenarios.

    2. Layered Architecture Design

    A deployable system is typically divided into five layers:

    1. Data ingestion layer: market snapshots, financial and announcement text, public news, and user holdings and trade records, buffered through a message queue to absorb traffic spikes and persisted to object storage and columnar storage for traceability.
    2. Feature and indicator layer: raw data processed into technical indicators, industry classification, volatility and correlation matrices, exposed to upper layers as callable tools.
    3. Agent capability layer: specialized agents for stock analysis, stock screening, monitoring, portfolio diagnosis, and review.
    4. Orchestration and scheduling layer: task decomposition, dependency management, timeouts and degradation, and result aggregation.
    5. Interaction and presentation layer: conversational entry points, workbench cards, structured reports, and alert delivery.

    The key constraint of this layering is that agents do not share mutable state directly; all read-only context is passed through the orchestration layer, which avoids cascading errors that are hard to localize.

    3. Responsibility Boundaries of Core Agents

    • Stock analysis agent: accepts a natural-language description of a target, aggregates public market information and related data, produces structured conclusions across fundamentals, technicals, capital flows, and news, and annotates data timestamps and confidence levels.
    • Stock screening agent: translates user filters such as industry, sector, and indicators into a structured query, returns matching targets with the rationale for each match, and supports both list and conversational presentation.
    • Monitoring agent: continuously processes market data and announcements incrementally within the user’s watch scope, and generates supporting explanations when thresholds or events are triggered.
    • Portfolio diagnosis agent: performs quantitative analysis of holding concentration, style drift, and drawdown exposure, and proposes rebalancing candidates with risk warnings.
    • Review agent: compares preset assumptions against actual price action, outputs deviation attribution, and builds an accumulating knowledge base of lessons.

    4. Proactive Delivery and Event-Driven Scheduling

    The technical core of proactive service is event-driven execution rather than polling. The scheduling logic can be expressed as rule pseudocode:

    1. def on_tick(event):
    2. for rule in watch_rules(event.user):
    3. if rule.hit(event):
    4. ctx = build_context(event, rule)
    5. task = Task(kind=rule.kind, ctx=ctx, priority=rule.priority)
    6. dispatcher.submit(task) # async, deduplicable, rate-limited

    Key engineering points include: idempotent deduplication based on event fingerprints to avoid repeatedly interrupting users about the same movement; rate limiting and quiet windows per user and time period; a dedicated channel for high-priority risk events to guarantee low latency; and an explanation field recording “why this was sent to you” on every push, which improves explainability and trust.

    5. Personalized Memory and User Profiles

    A three-tier memory system is recommended: short-term session memory holds the current intent and clarification slots; mid-term profile memory accumulates investment style, watched targets, risk preference, and historical feedback; long-term knowledge memory stores methodology templates and review conclusions. Profile updates use dual channels of explicit confirmation and implicit behavior, with implicit signals written only after passing a confidence threshold to prevent noise contamination. Cross-device consistency can be achieved with versioned storage keyed on the user, merging increments on read and preserving change provenance on write.

    6. Task Hosting, Strategy Backtesting, and Low-Friction Validation

    The task center is essentially a persistent scheduler: it supports both time-based (scheduled) and event-based (condition-triggered) tasks, stores task definitions separately from run records, and supports retries with observability. The strategy validation stage provides templated parameters and backtesting over historical data, outputting metrics such as equity curves, maximum drawdown, and turnover, with further validation in a simulated matching environment. Backtesting must explicitly handle look-ahead functions, survivorship bias, and transaction costs; otherwise the conclusions are not trustworthy.

    7. Compliance, Security, and Observability

    Advisory scenarios carry stringent compliance requirements, and the system should build in: annotation of data sources and generation timestamps, separate presentation of conclusions and their supporting evidence, upfront risk disclosures, secondary confirmation for sensitive operations, and full-chain audit logs. For observability, record the agent call chain, tool latency, token consumption, and failure reasons for each session, and close the loop with logging services and monitoring alerts. Model output must pass consistency checks and filtering by sensitive-word and suitability rules before delivery.

    8. Suggested Evolution Path

    Stage one: build a single-agent closed loop with structured output. Stage two: introduce the orchestration layer and event scheduling to enable proactive delivery. Stage three: complete memory, task hosting, and backtesting to create a virtuous cycle where the system understands the user better over time. Stage four: build an evaluation system that runs continuous regression against a fixed evaluation set, preventing capability regressions from version iterations. When implemented on general cloud capabilities, this can combine a container platform to host the agent runtime, a message queue for event distribution, object storage for data snapshots, and logging plus monitoring alerts for stability, achieving elasticity and operability at relatively low cost.