The Problem

Algorithmic‑trading pipelines are typically hard‑coded, single‑threaded scripts that cannot retain context across runs or flexibly recombine components. Teams that need a mutable, memory‑backed workflow must stitch together data ingestion, signal generation, risk, and execution manually, leading to duplicated effort and fragile integrations.

What This Does

FinAgents/ implements a multi‑agent orchestration framework that maps each trading stage to an autonomous LLM‑powered agent. Core pools live under FinAgents/agent_pools/ – e.g. alpha_agent_pool, risk_agent_pool, execution_agent_pool, and a shared Memory Agent that persists state in Neo4j.

The demo entry point FinAgents/agent_pools/alpha_agent_demo/alpha_signal_agent.py (function run at line 462) shows a full end‑to‑end run: it loads market data, builds technical features, calls a model for inference, writes results to a JSON file, and records metadata in the memory graph.

The orchestration backbone resides in FinAgents/agent_pools/alpha_agent_pool/core.py (functions initialize, parse_command, execute_structured_task) and the observability package corepkg/observability/metrics.py, which aggregates counters used by 69 other modules.

How It Is Wired

Execution begins at the CLI entry point FinAgents/agent_pools/alpha_agent_demo/alpha_signal_agent.py → run().

  1. run() → data loading (_load_price_series) reads CSV files from FinAgents/agent_pools/alpha_agent_pool/qlib_local/qlib_data/….
  2. Feature construction (create_technical_features) → calls add_returns and calculate_indicators_tool (both in the same file).
  3. Model inference (_calculate_technical_indicators) invokes a LLM / ML model (counted as 30 outbound inference calls).
  4. Results are persisted via json.dump to alpha_signals_output.json (filesystem write) and a Neo4j memory node through FinAgents/agent_pools/memory_agent_pool/... (database write).

The orchestrator path is FinAgents/agent_pools/alpha_agent_pool/core.py → execute_structured_task (called 35 times across the repo) → call_tool_http (network POST) → external service (client.post). The most‑used internal symbols are sum (195 callers) and initialize (42 callers), indicating that many agents share a common bootstrap routine.

A circular import exists in FinAgents/agent_pools/data_agent_pool/registry.py, linking back to the data pool’s core modules; this creates a tight coupling that inflates the blast radius of any change to the registry. The most‑connected module FinAgents/agent_pools/alpha_agent_pool/corepkg/observability/metrics.py touches 28 functions and is imported by 69 files, making it a change‑impact hotspot.

How To Use It

# Clone the repository
git clone https://github.com/moses-y/AgenticTrading
cd AgenticTrading

# Install the top‑level dependencies (pyproject.toml)
python -m venv .venv
source .venv/bin/activate
pip install -e .

# Install demo‑specific deps
pip install -r FinAgents/agent_pools/alpha_agent_demo/requirements.txt

Configuration files live alongside each pool:

  • FinAgents/agent_pools/alpha_agent_pool/config/alpha_pool.yaml – orchestrator settings.
  • FinAgents/agent_pools/alpha_agent_pool/config/autonomous.yaml – LLM prompt and tool definitions.

Run the demo:

python FinAgents/agent_pools/alpha_agent_demo/alpha_signal_agent.py

The script prints a short summary and writes alpha_signals_output.json. To start the data‑agent server (used by other pools):

python FinAgents/agent_pools/data_agent_pool/server.py

Real‑World Use

A hedge‑fund quant team can replace a static back‑test script with the alpha_signal_agent demo, feeding live market CSVs into the pipeline. The Memory Agent will automatically log each run, enabling the planner to query historical performance and adapt future signal generation without code changes.

from FinAgents.agent_pools.alpha_agent_demo.alpha_signal_agent import run
run(data_path="data/latest_prices.csv")

Code Health & Issues

  • High – CI missing – No GitHub Actions workflow; 288 source files have never been gated by automated builds.
  • Medium – Dependabot absent – Six manifest files (requirements.txt, pyproject.toml) lack an update bot; security advisories stay unpatched.
  • Medium – Large binary – tests/data_error_rate/comparison_log.csv (7 MB) is stored directly in the repo, inflating clone size.

Additional observations from the static analysis:

  • High – Deep nesting – 46 files contain indentation depth ≥ 6, making control flow hard to follow (e.g., transaction_cost_agent_pool/schema/cost_models.py).
  • High – Import cycle – FinAgents/agent_pools/data_agent_pool/registry.py participates in a circular import, increasing maintenance risk.
  • High – Oversized files – portfolio_construction_agent_pool/core.py (≈ 1500 LOC) bundles many responsibilities; splitting is advisable.
  • Medium – Broad exception handling – Several agents swallow all exceptions, potentially hiding runtime failures.

The Bottom Line

AgenticTrading delivers a modular, LLM‑driven trading orchestration layer with clear separation of concerns across agent pools, but the codebase suffers from high cyclomatic complexity, import cycles, and missing production safeguards (CI, dependency bots, binary management). It is suitable for teams willing to invest in refactoring and adding CI pipelines to unlock the framework’s full potential.