Reference agent workflow using System R AI finance tools for decision-support examples.
System R AI is a decision intelligence system for trading and investing. This repository shows how an agent, script, or notebook can call the System R AI API Toolkit to structure risk checks, position sizing, performance review, and journal workflows.
System R is software for decision support. It is not financial advice, not a broker, not a signal service, and not a guarantee of profits.
The examples demonstrate a safe builder pattern:
Market idea -> supplied inputs -> System R tool call -> structured output -> user review
The workflow is intentionally framed around decision support. It does not require broker connection or order routing, and it should not be presented as unattended trading automation.
Use the current System R AI developer docs and agents surface for API access.
- Docs: https://docs.systemr.ai/
- Agents: https://agents.systemr.ai/
- OpenAPI: https://agents.systemr.ai/v1/openapi.json
git clone https://github.com/System-R-AI/demo-trading-agent.git
cd demo-trading-agent
pip install -r requirements.txt
cp .env.example .envAdd your System R API key to .env.
# Plain Python examples
python examples/plain_python/workflow_examples.py
# Momentum workflow example
python examples/plain_python/momentum_agent.py
# Backtest comparison example
python examples/plain_python/backtest_comparison.py
# CrewAI example, if dependencies and model keys are configured
pip install -r examples/crewai/requirements.txt
python examples/crewai/trading_crew.py
# LangChain example, if dependencies and model keys are configured
pip install -r examples/langchain/requirements.txt
python examples/langchain/trading_agent.pyimport httpx
gate = httpx.post(
"https://agents.systemr.ai/v1/compound/pre-trade-gate",
headers={"X-API-Key": SYSTEMR_API_KEY},
json={
"symbol": "AAPL",
"direction": "long",
"entry_price": "185.00",
"stop_price": "179.50",
"equity": "100000",
},
).json()
print(gate)pre_trade_gate returns structured sizing, risk, and health fields from supplied inputs. The user remains responsible for interpreting the output and deciding what to do next.
The API Toolkit can support examples across:
- Risk and sizing
- Performance diagnostics
- Market structure analytics
- Scenario planning
- Journal and memory workflows
- Asset or research context where supported or supplied
Use the live tool catalog for current tool names, schemas, and availability.
System R AI uses usage-based credits for paid workflows. Current rates and billing rules should be checked through live pricing endpoints and the System R billing page.
Do not assume every tool, data path, or LLM-backed workflow has the same pricing behavior. Live discovery and billing responses are the source of truth.
- System R AI: https://systemr.ai/
- Agentic Trading Workspace: https://systemr.ai/product/agentic-trading-workspace/
- API Toolkit: https://systemr.ai/product/developer-tools/
- Docs: https://docs.systemr.ai/
- Agents: https://agents.systemr.ai/
- Python SDK: https://pypi.org/project/systemr/
MIT