This publication presents Agentic Forex AI, a fully containerized multi-agent system that automates daily forex market analysis using news streams, technical indicators, and rule-based validation. It integrates FastAPI, Streamlit, and Prometheus-based observability for a real-time, interactive decision-support dashboard. The solution demonstrates how open-source orchestration of AI agents can produce trustworthy recommendations (BUY / SELL / AVOID) with traceable logic, logs, and performance metricsβdeployable via Docker and Railway.

Agentic Forex AI represents the culmination of the Agentic AI Developer Capstone Project, transforming a modular multi-agent prototype into a production-grade, observable, and reliable forex decision-support system. It integrates five coordinated agents β Market, News, Strategy, Validation, and Email β to generate daily recommendations across 20 major and minor currency pairs.
Each recommendation is derived from real-time market data (via yFinance) and sentiment cues (via RSS news parsing), validated through safety guards, and automatically delivered to users through an email notification pipeline. The system is fully containerized, combining FastAPI for orchestration, Streamlit for visualization, and Prometheus for monitoring and metrics collection.
Beyond its technical implementation, the project demonstrates key principles of responsible AI deployment: input validation, operational resilience, performance logging, and transparent observability. Deployed via Docker and Railway, it showcases how open, reproducible architectures can bridge the gap between intelligent automation and production reliability in real-world financial applications.
Forex traders and analysts often rely on fragmented toolsβsuch as economic calendars, RSS feeds, and chart patternsβto make time-sensitive decisions. Agentic Forex AI unifies these signals into a reproducible, explainable multi-agent system that delivers consistent, transparent recommendations daily.
By automating routine analysis and embedding observability, the system:
The architecture unifies five operational layers inside a Docker container:
| Layer | Function | Technology |
|---|---|---|
| API Layer | Exposes REST endpoints (/api/run, /api/metrics, /api/health) | FastAPI + Uvicorn |
| Dashboard Layer | Streamlit interface for user interaction | Streamlit |
| Agent Layer | Market, News, Strategy, Validation, and Email agents | Custom Python Agents |
| Tools Layer | Core logic encapsulated as reusable tools | Python (Pydantic + Requests) |
| Monitoring Layer | Tracks metrics, health, and latency | Prometheus + Loguru |
| Agent | Function |
|---|---|
| Market Agent | Retrieves hourly/daily forex candles using yfinance_tool.py. |
| News Agent | Fetches and filters sentiment-rich news via RSS (news_tool.py). |
| Strategy Agent | Synthesizes insights to generate BUY/SELL/AVOID stances (strategy_tools.py). |
| Validation Guard | Validates currency pair formats and manages error resilience. |
| Email Agent | Sends summarized recommendations directly to the traderβs Gmail (email_tool.py). |
The system executes end-to-end pipelines via safe_run_pipeline_once() to ensure isolation, reliability, and safety.
| Tool File | Purpose |
|---|---|
strategy_tools.py | Defines strategy logic and confidence scoring. |
yfinance_tool.py | Retrieves live market candles and handles exceptions. |
news_tool.py | Fetches financial headlines with timestamp parsing and deduplication. |
email_tool.py | Automates daily strategy email delivery. |
mcp.py | MCP-compatible logging decorator for trace-based evaluations. |
Major Pairs:
EURUSD, USDJPY, GBPUSD, USDCHF, AUDUSD, USDCAD, NZDUSD
Minor Pairs:
EURGBP, EURJPY, GBPJPY, EURCHF, EURAUD, AUDJPY,
GBPCHF, NZDJPY, CADJPY, AUDNZD, EURCAD, CHFJPY, GBPAUD
All validated by input_validation.py with dynamic whitelist logic.

| Layer | Technology |
|---|---|
| Backend | FastAPI, Uvicorn |
| Frontend | Streamlit |
| Agents | Python async, Requests, Pydantic models |
| Monitoring | Prometheus client + Loguru logging |
| Deployment | Docker / Railway PaaS |
| Data Sources | yFinance candles, RSS news feeds |
βββ api.py # FastAPI backend (main API routes) βββ dashboard.py # Streamlit dashboard UI βββ Dockerfile # Docker image configuration βββ requirements.txt # Python dependencies βββ supervisord.conf # Supervisor config for API + Dashboard βββ README.md # Project documentation β βββ src/ β βββ agents/ β β βββ market_agent.py # Fetches forex candles via yfinance β β βββ news_agent.py # Parses news from FXStreet, Investing.com, DailyFX β β βββ strategy_agent.py # Combines data β issues BUY/SELL/AVOID β β βββ email_agent.py # Sends daily strategy report to Gmail β β β βββ tools/ β β βββ yfinance_tool.py # Handles price data retrieval β β βββ rss_tool.py # RSS parsing and cleaning β β βββ strategy_tools.py # Core logic for combining market + news data β β βββ email_tool.py # Email sending utility (smtplib-based) β β β βββ guards/ β β βββ input_validation.py # Validates currency pairs and API input β β βββ pipeline_safety.py # Safe execution wrapper for resilience β β βββ validation_guard.py # Ensures runtime safety & fallback logic β β β βββ utils/ β β βββ logger.py # Logging utilities with Loguru β β β βββ graph.py # Defines multi-agent pipeline graph β βββ schemas.py # Pydantic models (Candle, NewsItem, Recommendation) β βββ main.py # Entry point for multi-agent orchestration β βββ data/ β βββ traces/ # JSON logs of each pipeline execution β βββ samples/ # Example test data or responses β βββ tests/ β βββ test_agents.py # Unit tests for each agent β βββ test_pipeline.py # Integration tests across agents β βββ test_end_to_end.py # End-to-end system tests
| Type | Description |
|---|---|
| Unit Tests | Validate each agent and tool independently. (pytest/test_agents.py) |
| Integration Tests | Simulate full pipeline execution across agents. (pytest/test_pipeline.py) |
| End-to-End Tests | Verify /api/run β /api/health β /api/metrics flow correctness. |
| Coverage Goal | β₯ 70% of all core functions under src/agents/ and src/tools/. |
Example run:
pytest --maxfail=1 --disable-warnings -q --cov=src
| Aspect | Description |
|---|---|
| Purpose Clarity | Well-defined use case focused on automated forex strategy generation and daily execution. |
| Value & Impact | Real-world decision-support relevance β helping users interpret forex signals with actionable insights. |
| Technical Credibility | Reproducible pipelines with validated inputs and synchronized agent execution. |
| Usability & Documentation | Includes setup instructions, API routes, Streamlit interface, and monitoring endpoints. |
Each pipeline run logs structured JSON traces in /data/traces/ including:
Metrics exposed at /api/metrics include:
-# HELP api_request_total Total API requests
-# HELP api_request_latency_seconds API request latency in seconds
-# HELP api_health_status 1 if healthy, 0 otherwise
All accessible via:
curl http://localhost:8000/api/metrics
To build and run the project locally:
docker build -t forex-ai . docker run -p 8501:8501 -p 8000:8000 forex-ai
Then open in your browser:
Connect your GitHub repository to Railway.
Select Dockerfile as the deployment method.
Set the environment variable:
API_URL=https://<your-railway-app>.up.railway.app/api
Deploy your project.
Verify the logs β you should see messages like:
success: api entered RUNNING state success: dashboard entered RUNNING state
| Area | Current State | Planned Enhancement |
|---|---|---|
| Sentiment Analysis | Rule-based (TextBlob) | Integrate transformer-based FinBERT sentiment agent |
| Data Sources | Limited to RSS + yFinance | Add real-time broker feeds (Oanda API) |
| Evaluation | Binary confidence score | Implement historical performance tracking |
| Scalability | Single Docker instance | Deploy using Kubernetes or AWS Fargate for scaling |
Agentic Forex AI embodies the principles of safety, stability, and explainability, delivering practical value in real-world decision-making contexts. It is a fully monitored, tested, and documented system that illustrates the hallmark of professional AI engineering.
The Creative Commons Attribution-ShareAlike (CC BY-SA) license was chosen to encourage open collaboration while protecting authorship. It permits others to use, modify, and redistribute this work βincluding its code and documentationβprovided they give appropriate credit to the original author and share derivative works under the same terms. This ensures the project remains freely accessible and improves collectively, which aligns with Ready Tensorβs ethos of transparent and reproducible AI innovation.
/api/metrics/api/health