Home / Market / axonx

axonx

Develop AxonX research plugins and operate quantitative research tasks through CLI or MCP, inspecting execution status, logs, artifacts, and lineage.

skill★ 508380 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: axonx description: "Develop AxonX research plugins and operate quantitative research tasks through CLI or MCP, inspecting execution status, logs, artifacts, and lineage." category: finance risk: critical source: "https://github.com/FlowLLM-AI/AxonX/tree/862b90da9c49c3bdee4c2ab9ef896c415aee9f45/skills/axonx" source_repo: FlowLLM-AI/AxonX source_type: community license: Apache-2.0 license_source: "https://github.com/FlowLLM-AI/AxonX/blob/862b90da9c49c3bdee4c2ab9ef896c415aee9f45/LICENSE" date_added: "2026-10-04" tags: [quantitative-research, mcp, backtesting, python]

---

AxonX Development and Operations Guide

This guide can be read independently or installed as an Agent skill. Documentation and source links use absolute URLs, so copying this file does not depend on its original directory. The maintained project is FlowLLM-AI/AxonX.

Source paths such as plugins/a158/... are relative to the root of an AxonX source checkout, not to this document or the Agent workspace. Run source development and plugin build commands from that checkout. Workspace paths passed to Jobs such as preview_file are relative to the selected service's workspace. Package installation alone does not provide the example plugin sources.

When to Use This Skill

Security & Safety Notes

This skill is labeled critical because it documents package installation, task submission, remote shell execution, cancellation, deletion, and artifact replacement. Establish the user's requested operation and exact service/workspace first. Do not treat command examples as authorization. Request clarification when the execution target or the scope of a destructive operation is unclear; existing explicit authorization remains valid. Never expose service or data-provider tokens in reports, logs, or committed files. Back up irreplaceable artifacts before authorized replacement or deletion.

Prepare the Environment and Service

Use Python 3.12+ on macOS or Linux for local Task execution. In your chosen working directory, create and activate a virtual environment, then install the core:

python3 -m venv .venv
source .venv/bin/activate
pip install axonx
axonx help

For the prebuilt Studio UI, install axonx[studio] instead. Research plugins are installed separately. For source development, clone the project, enter its root, and install it in an activated virtual environment:

git clone https://github.com/FlowLLM-AI/AxonX.git
cd AxonX
pip install -e .

Configure credentials through environment variables or a .env file discovered from the process working directory or its parents. Before starting a local service, replace the token placeholder with your own value:

export AXONX_SERVICE_TOKEN='replace-with-your-local-service-token'
axonx start --service.host 127.0.0.1

Keep that process running. In another terminal, activate the same environment and configure the same token, then run axonx version to verify the connection. The default port is 1024; the default workspace is .axonx under the startup directory. If using an existing service, obtain its address and authentication configuration before making calls. Keep one execution target for plugin queries, submissions, status, logs, and artifact inspection.

For MCP clients, connect to http://127.0.0.1:1024/mcp using Streamable HTTP and the header Authorization: Bearer <service-token>; replace the address and token with those of your service. Discover tools from the connected service rather than assuming a fixed tool catalog. The CLI examples below describe the same operations; use the discovered MCP input schemas when calling tools.

The built-in demo Task can verify submission and tracking without market-data or model credentials; the Alpha158 workflow requires its research plugin and prepared input data. Market-data downloads require AXONX_TUSHARE_TOKEN; model-backed Agents require separate model configuration. See Quick start, Research workflow, and MCP integration for complete setup examples.

When using this document as a skill, perform only the operations required by the user's request. Documentation examples do not authorize installation, task execution, deletion, or remote changes by themselves. For changes to the source checkout, follow its AGENTS.md and contribution guide.

Background

AxonX is a harness framework for financial quantitative research, organizing data acquisition and ETL, factor analysis, model training, prediction, and backtesting into Tasks with consistent input/output contracts. Plugins register research implementations; Tasks link upstream and downstream work through Task IDs. The CLI and HTTP service support submitting execution on local or remote machines and querying machine resources, runtime status, and logs. The framework records task configuration, dependencies, result metadata, and artifacts in the workspace, and provides Agents with task, dependency graph, and file query tools to verify research results, investigate failures, and reuse upstream data.

http://192.168.1.10:1024) and health status (healthy) for all machines configured in the local service's targets, then use axonx machine_status --target <host:port> to inspect candidates' CPU, memory, and GPU resources.

192.168.1.10:1024 in the tables is an example target address; replace it before execution. — means remote operation is unsupported.

Plugin Development

A plugin can register multiple Tasks; the a158 example registers five Task types in plugins/a158/axonx_alpha158/plugin.yaml. The a158 paths, class names, registered names, and dependency chain here are illustrative; replace them with actual definitions when developing other research plugins. Plugin installation and Task submission are separate operations.

Required authoring contracts

Every plugin Task must directly or indirectly inherit BaseTask and follow the public authoring contract in axonx/task/core/task.py. Registration alone does not replace this contract:

inherit BaseInputParams and BaseOutputParams from core/params.py.

return a validated instance of the declared output_cls; returning a plain dictionary does not satisfy the contract.

source_task_dir(), and resolve_workspace_path() for task artifacts and workspace paths; leave execution and status recording to the framework runtime.

axonx/task/contracts/ provides optional standard research Task and parameter classes for ETL, Analysis, Train, Predict, and Backtest. For these research stages, prefer the corresponding Base*Task, Base*InputParams, and Base*OutputParams classes. Once adopted, their required fields, types, and validators are part of the plugin's contract: preserve them and declare additional fields in subclasses. A custom Task may inherit BaseTask directly with its own parameter models, but must still follow the core contract; registration does not require every Task to inherit one of the five research base classes.

Before implementation, read Task contracts, Task lifecycle, and Research artifact contracts. Standard Python fields alone do not guarantee compatibility with downstream plugins or Studio; also satisfy the artifact mappings and presentation fields used by the intended consumers.

Task Types

| Type | Concept and purpose | | -------- | --------------------------------------------------------------------------------- | | ETL | Clean and align raw data to generate datasets for subsequent research. | | Analysis | Analyze factors in an ETL dataset to diagnose factor quality and performance. | | Train | Train a model using an ETL dataset, producing the model and training results. | | Predict | Generate predictions using a model produced by Train and its associated ETL data. | | Backtest | Backtest Predict results to evaluate strategy performance. |

Tasks link upstream and downstream through Task IDs. The a158 example's main dependency chain is ETL → Train → Predict → Backtest; Analysis uses ETL data for factor analysis.

Development Steps

1. Modify Code and Registration

For ETL, the minimal structure includes input parameters, output parameters, a Task implementation, and registration. The following is a structural example; replace ... in transform with actual ETL logic that reads input and writes results to self.state["output"].

plugins/a158/axonx_alpha158/etl.py:

from pathlib import Path

from axonx.task.contracts import BaseETLInputParams, BaseETLOutputParams, BaseETLTask


class Alpha158InputParams(BaseETLInputParams):
    input_dir: Path = Path("tushare")


class Alpha158OutputParams(BaseETLOutputParams):
    pass  # Use the ETL base class's output fields directly


class Alpha158Task(BaseETLTask):
    """Clean and align raw market data to create an ETL dataset for training and factor analysis.
    """

    input_cls = Alpha158InputParams
    output_cls = Alpha158OutputParams
    input_params: Alpha158InputParams

    def build_task_steps(self):
        yield self.transform

    def transform(self):
        # Read data from self.resolve_workspace_path(self.input_params.input_dir),
        # save artifacts to self.task_dir, and populate self.state["output"].
        ...

    def build_output_params(self):
        return self.output_cls(**self.state["output"])

A Task class must define a nonempty class docstring, used as the Task definition's description. Without it, Task resolution and definition queries raise TypeError: Task ... must define a detailed class docstring. Describe the task's purpose, input, and artifacts; method docstrings alone are insufficient.

BaseETLOutputParams already defines required fields output_file, rows, and date_range, so self.state["output"] must contain at least these three fields. Add fields to Alpha158OutputParams when additional results are needed.

plugins/a158/axonx_alpha158/plugin.yaml registers the T