Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Market Intelligence Engine

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.


Features

  • 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

⚠️ Disclaimer

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.


Example

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

Prerequisites

  • Python (Tested with version 3.13.5)
  • PostgreSQL engine.
  • LM Studio
  • qwen/qwen3.5-9B
  • Prophet (Found in requirements.txt)

System Architecture

Database
    |
Data Layer
    |
Forecast Engine
    |
Trend Analysis
    |
LLM Analysis
    |
Chart Generation
    |
PDF Report
    |
Email distribution

Environment Variables

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

Database Schema

Origins

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)
);

Items

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
);

History

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)
);

Subscriptions

List of users receiving daily reports.

CREATE TABLE email_recipients (
	email varchar(255) NULL,
	active bool DEFAULT false NULL
);

Installation

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 .env

Pipeline execution

python3 main.py

About

Generate daily market reports with AI predictions and analysis

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages