Analysis Agents
Three interpretation agents + one deferred reflector. Together they close the Alpha-GPT three-stage loop (Ideation → Implementation → Review) and the TradingAgents-style outcome-reflection loop.
Specs
| Spec | Module | Purpose |
|---|---|---|
analysis.step | alphaswarm/agents/analysis/step_analyst.py | Verdict + improvements for a single agent step. |
analysis.run | alphaswarm/agents/analysis/run_analyst.py | End-to-end interpretation of a backtest / paper / live run. |
analysis.portfolio | alphaswarm/agents/analysis/portfolio_analyst.py | Portfolio aggregate + risk + regulatory exposure. |
| Reflector (helper) | alphaswarm/agents/analysis/reflector.py | Resolve outcomes + write reflections + re-index L0. |
Reflection loop (TradingAgents pattern)
- The reflector pulls every recent decision row that doesn't yet have an outcome.
- It computes raw / benchmark / excess return over a configurable window via the bars adapter.
- It writes one
MemoryOutcomerow + oneMemoryReflectionrow. - It re-indexes the decision into the L0
decisionscorpus so the next research / selection / trader run picks it up viaHierarchicalRAG.
REST + Celery
POST /agents/analysis/step — task
POST /agents/analysis/run — task
POST /agents/analysis/portfolio — task
POST /agents/analysis/reflect — task wrapper for run_reflection_pass
POST /agents/analysis/sync/run — synchronous variant
POST /memory/reflect/run — synchronous reflection pass
Tasks live in alphaswarm/tasks/analysis_tasks.py.