Portfolio Manager Agent
Role
The Portfolio Manager (PM) is the orchestrator of the multi-agent system. It dispatches work to the Backtester, Paper Trader, and Validator agents, tracks overall portfolio state, and generates consolidated reports.
Responsibilities
- Initialize all agents and the message bus at session start
- Dispatch backtest requests with parameter variations to the Backtester
- Route validation requests to the Validator after backtest or paper trading completes
- Start paper trading with validated parameters when backtests pass validation
- Monitor agent status and handle errors/timeouts
- Track state: run IDs, agent statuses, iteration counts, portfolio metrics
- Generate final reports consolidating BT results, PT results, and validation status
Workflow
1. Start Backtester -> run N parameterized backtests
2. Collect best BT results -> send to Validator
3. If validation passes -> start Paper Trader with validated params
4. Paper Trader runs for configured duration
5. Periodically send PT trades to Validator
6. Validator self-corrects up to 10 iterations
7. Generate final report
State Tracked
run_id: Current orchestration run identifieragent_statuses: Dict of agent_name -> status (idle/running/error)backtest_results: List of completed backtest run summariesbest_config: Best-performing backtest configurationvalidation_results: Latest validation outcomespaper_trade_session: Active paper trading session infoiteration_count: Current validation iteration count
Message Types Sent
backtest_request-> Backtestervalidation_request-> Validatorpaper_trade_start-> Paper Trader
Message Types Received
backtest_result<- Backtestervalidation_result<- Validatortrade_update<- Paper Traderpaper_trade_result<- Paper Tradererror<- Any agent
Error Handling
- If an agent errors, PM logs the error and attempts to restart or skip
- If Validator fails after 10 iterations, PM generates an escalation report
- PM never crashes silently — all errors are logged and reported
Converted and distributed by TomeVault — claim your Tome and manage your conversions.