Skip to content

Stock ARA: Stock AI Research Assistant, Inha Univ. Capstone Design in ICT

Notifications You must be signed in to change notification settings

Astro36/stock-ara

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock ARA

Stock AI Research Assistant

Python

Stock ARA(AI Research Assistant) is an innovative stock screening and portfolio optimization system that leverages a Large Language Model(LLM) and Retrieval-Augmented Generation(RAG).

poster

This is an official implementation of the paper: A Novel Stock Screening Approach using Large Language Models and Correlation-Aware Retrieval.

Key Features

  • Advanced stock screening using LLM and RAG
  • User query augmentation for improved search accuracy
  • Correlation-aware retrieval combining business report similarity and stock return correlation
  • Portfolio optimization based on the Mean-Variance model and Black-Litterman approach
  • Cost-efficient use of GPT-3.5 and GPT-4 APIs

Get Started

Technical Specifications

Data Sources

Usage

  1. Clone the repository

    git clone https://github.com/Astro36/stock-ara.git
  2. Set up the required environment variables: .env

  3. Load stock data and business reports into the database

    COPY companies FROM '/tmp/db_data/companies.csv' DELIMITER ',' CSV HEADER;
    COPY company_filings FROM '/tmp/db_data/company_filings.csv' DELIMITER ',' CSV HEADER;
    COPY assets FROM '/tmp/db_data/assets.csv' DELIMITER ',' CSV HEADER;
    COPY asset_stocks FROM '/tmp/db_data/asset_stocks.csv' DELIMITER ',' CSV HEADER;
    COPY asset_prices FROM '/tmp/db_data/db_data/asset_prices.csv' DELIMITER ',' CSV HEADER;
    
    CALL refresh_continuous_aggregate('asset_weekly_close_prices', '2020-01-01', '2024-12-31');
    REFRESH MATERIALIZED VIEW stock_market_caps;
  4. Run docker compose

    docker compose up