A dual-AI financial intelligence system that combines:
- Time-series forecasting (Prophet-based models)
- LLM-based market reasoning (buy / sell / wait analysis)
The system generates daily market reports, including predictions, AI analysis, visual charts, and distributes them to a list of emails.
- Market forecasting using statistical models (Prophet)
- LLM-based financial analysis (trend interpretation + decision making)
- Local AI usage
- Trend strength calculation (bullish / bearish / sideways)
- Automated chart generation (history + forecast + confidence intervals)
- PDF report generation (one page per asset)
- Email distribution via SMTP
- Fully database-driven architecture
- Extensible design for multiple data providers
This project is for educational and research purposes only.
It does not constitute financial advice. Market predictions are probabilistic and should not be used as sole investment guidance.
The system might fail when tested against a small dataset.
Report example can be found in example
The system has been tested using MetalpriceAPI.com a precious metals data API
The display example has been generated using the following parameters
HISTORIC_DAYS_SHOWN=100
PREDICTION_FORECAST_DAYS=5
- Python (Tested with version 3.13.5)
- PostgreSQL engine.
- LM Studio
- qwen/qwen3.5-9B
- Prophet (Found in
requirements.txt)
Database
|
Data Layer
|
Forecast Engine
|
Trend Analysis
|
LLM Analysis
|
Chart Generation
|
PDF Report
|
Email distribution
Create a .env file:
| Var | Description | Type | Required | Domain |
|---|---|---|---|---|
DB_USER |
User. | string |
true |
DB |
DB_PASSWORD |
Password. | string |
true |
DB |
DB_NAME |
Database Name. | string |
true |
DB |
DB_PASSWORD |
Password. | string |
true |
DB |
DB_PORT |
Port. | int |
true |
DB |
DB_HOST |
Host. | string |
true |
DB |
HISTORIC_DAYS_SHOWN |
Amount of historic days to show. | int |
true |
CHART |
PREDICTION_FORECAST_DAYS |
Amount of days to predict. | int |
true |
PROPHET |
LLM_URL |
Local LLM URL . | string |
true |
LLM |
LLM_MODEL |
LLM Code or name. | string |
true |
LLM |
LLM_MAX_TOKENS |
Maximum amount of tokens. | string |
true |
LLM |
SMTP_HOST |
Host. | string |
true |
SMTP |
SMTP_PORT |
Port. | int |
true |
SMTP |
SMTP_USER |
User. | string |
true |
SMTP |
SMTP_PASSWORD |
Password. | string |
true |
SMTP |
Data source attribution for reports.
CREATE TABLE origins (
code varchar(100) NOT NULL,
name varchar(100) NULL,
url varchar(200) NULL,
image varchar(200) NULL,
label varchar(50) NULL,
CONSTRAINT pk_origins PRIMARY KEY (code)
);
Assets tracked by the system.
CREATE TABLE items (
item varchar(50) NOT NULL,
description varchar(250) NOT NULL,
origin varchar(100) NOT NULL,
unit varchar(20) NULL,
CONSTRAINT pk_items PRIMARY KEY (item),
CONSTRAINT fk_items01 FOREIGN KEY (origin) REFERENCES origins(code) ON UPDATE CASCADE
);
Historical price data for forecasting.
CREATE TABLE history (
created_at date NOT NULL,
item varchar(50) NOT NULL,
currency varchar(5) NOT NULL,
price numeric(20, 15) NOT NULL,
CONSTRAINT pk_history PRIMARY KEY (created_at, item),
CONSTRAINT fk_history FOREIGN KEY (item) REFERENCES items(item)
);
List of users receiving daily reports.
CREATE TABLE email_recipients (
email varchar(255) NULL,
active bool DEFAULT false NULL
);
git pull https://github.com/Angel-del-dev/ai-market-intelligence-engine.git ai-market-intelligence-engine.git
cd ai-market-intelligence-engine.git
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .envpython3 main.py