Skip to main content

Multi-agent AI trading analysis for Japanese stocks — powered by the Japan Finance Data Stack

Project description

japan-trading-agents

Multi-agent AI trading analysis for Japanese stocks — powered by real government data, not just LLM reasoning.

CI PyPI License Python

What is this?

9 AI agents analyze Japanese stocks using real financial data from government and market data sources:

Agent Role Data Source
Fundamental Analyst Financial statements, DuPont analysis EDINET (有報)
Macro Analyst GDP, CPI, interest rates e-Stat + BOJ
Event Analyst Earnings, dividends, M&A TDNet (適時開示)
Sentiment Analyst News sentiment scoring Japan News RSS
Technical Analyst Price action, volume Yahoo Finance (yfinance)
Bull Researcher Builds the bullish case All analyst reports
Bear Researcher Challenges with risks All analyst reports
Trader BUY/SELL/HOLD decision Debate + analysis
Risk Manager Risk validation Final approval

How it works

jta analyze 7203  (Toyota)
      |
      v
  [Data Fetch] ── yfinance + 5 MCP sources in parallel
      |
      v
  [5 Analysts] ── Fundamental, Macro, Event, Sentiment, Technical (parallel)
      |
      v
  [Bull vs Bear Debate] ── Sequential argumentation
      |
      v
  [Trader Decision] ── BUY / SELL / HOLD with confidence
      |
      v
  [Risk Manager] ── Approve or reject with concerns

Quick Start

# Install with all data sources
pip install "japan-trading-agents[all-data]"

# Set your LLM API key
export OPENAI_API_KEY=sk-...

# Analyze a stock
jta analyze 7203

Use Any LLM

Powered by litellm — supports 100+ LLM providers:

# OpenAI
jta analyze 7203 --model gpt-4o

# Anthropic
jta analyze 7203 --model claude-sonnet-4-5-20250929

# Google
jta analyze 7203 --model gemini/gemini-2.0-flash

# Local (Ollama)
jta analyze 7203 --model ollama/llama3.2

# Any litellm-supported model
jta analyze 7203 --model deepseek/deepseek-chat

CLI Commands

# Full analysis
jta analyze 7203

# With EDINET code override
jta analyze 7203 --edinet-code E02144

# Multi-round debate
jta analyze 7203 --debate-rounds 2

# JSON output
jta analyze 7203 --json-output

# Check data sources
jta check

# MCP server mode
jta serve

Data Sources

Each data source is an independent MCP package. Install only what you need:

pip install japan-trading-agents                        # Core only
pip install "japan-trading-agents[edinet]"              # + EDINET
pip install "japan-trading-agents[all-data]"            # All 6 sources
Source Package API Key Required
Yahoo Finance (stock prices) yfinance (bundled) No
EDINET (financial statements) edinet-mcp Yes (free)
TDNet (disclosures) tdnet-disclosure-mcp No
e-Stat (government statistics) estat-mcp Yes (free)
BOJ (central bank data) boj-mcp No
News (financial news RSS) japan-news-mcp No

The system gracefully degrades — agents work with whatever sources are available.

Architecture

  • No LangChain/LangGraph — pure asyncio for orchestration
  • litellm for multi-provider LLM support (single interface, 100+ providers)
  • Pydantic models for structured agent outputs
  • Rich CLI with streaming progress
  • FastMCP server for MCP integration
  • All LLM calls are mocked in tests — no API keys needed to run tests

Part of the Japan Finance Data Stack

Layer Tool Description
Corporate Filings edinet-mcp XBRL financial statements
Disclosures tdnet-disclosure-mcp Real-time corporate disclosures
Government Statistics estat-mcp GDP, CPI, employment
Central Bank boj-mcp Interest rates, money supply
Financial News japan-news-mcp RSS news aggregation
Stock Prices yfinance Yahoo Finance (TSE coverage)
Benchmark jfinqa Japanese financial QA benchmark
Analysis japan-trading-agents Multi-agent trading analysis

See awesome-japan-finance-data for a complete list of Japanese finance data resources.

Development

git clone https://github.com/ajtgjmdjp/japan-trading-agents
cd japan-trading-agents
uv sync --extra dev
uv run pytest -v
uv run ruff check src tests
uv run mypy src

Disclaimer

This is not financial advice. For educational and research purposes only. Do not make investment decisions based on this tool's output.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

japan_trading_agents-0.4.0.tar.gz (288.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

japan_trading_agents-0.4.0-py3-none-any.whl (41.2 kB view details)

Uploaded Python 3

File details

Details for the file japan_trading_agents-0.4.0.tar.gz.

File metadata

  • Download URL: japan_trading_agents-0.4.0.tar.gz
  • Upload date:
  • Size: 288.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for japan_trading_agents-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b72c2191b131f77e0c031f5342a937a4ddd6e0fbb9fbf8ec3e5d76fdbceb1a55
MD5 8e600ebb6c95c3b8295ca46adac0c837
BLAKE2b-256 d353de907f1e238a34c408bfa9b50c7b3ab88503a429c1bf04cca2f7384addd6

See more details on using hashes here.

File details

Details for the file japan_trading_agents-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: japan_trading_agents-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 41.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for japan_trading_agents-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5c0771852db0405f27c1de5347d5c7183e51f59be0cd60ae07cf94cbb5c9336
MD5 6604bd6b81a102c186ebb81f1b47ff0a
BLAKE2b-256 1a38d3474aa621b227e572b0806f40b79d1f9bc45b24dd21bc2970f2695c4b5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page