Stockify is a comprehensive AI-powered stock market intelligence platform that combines advanced machine learning, natural language processing, and document analysis for complete investment research. Built with privacy as a core principle, it leverages:
- π§ LSTM Neural Networks for accurate 50/100/200-day price predictions
- π€ Local LLM Integration via LM Studio for on-device AI processing
- π RAG Technology for intelligent document analysis and Q&A
- π Technical Analysis Tools for in-depth market insights
Whether you're analyzing US stocks (NASDAQ) or Indian markets (NSE), Stockify provides AI-powered recommendations, real-time data visualization, and document-based research capabilitiesβall while keeping your data completely private on your local machine.
Core Features:
- β LSTM Price Predictions - 50/100/200-day forecasts trained on 2012-2022 market data
- β Real-time Stock Data - Live market data with dynamic date fetching using Yahoo Finance (up to current date)
- β Historical Charts - Interactive price visualization and trend analysis
- β AI Market Insights - Automated analysis of stock performance
AI RAG Features:
- β Document Q&A - Ask questions about financial PDFs in natural language
- β Source Citations - Answers grounded in actual document content
- β Local LLM Processing - Privacy-first AI analysis (no data leaves your machine)
- β Vector Embeddings - FAISS-powered semantic search for accurate retrieval
Investment Features:
- β BUY/HOLD/SELL Signals - Intelligent recommendations with reasoning
- β Risk Assessment - Comprehensive risk analysis and evaluation
- β Entry/Exit Points - Strategic price targets for trading
- β Streaming Responses - Real-time AI response generation
Data Features:
- β Multi-Market Support - 1000+ NASDAQ and 1000+ NSE stocks
- β Search & Filter - Easy stock discovery and selection
- β Comprehensive Listings - Full stock metadata and information
Technical Features:
- β Moving Averages - 50-day, 100-day and 200-day MA calculations
- β Volatility Analysis - Price fluctuation and risk metrics
- β Trend Detection - Automated pattern recognition
- β AI Interpretation - Natural language explanations of technical data
Streamlit UI β Services (LocalLLM, Embeddings, RAG) β Utils (Stock LSTM, PDF)
Tech Stack: Streamlit β’ Python β’ TensorFlow/Keras β’ LangChain β’ FAISS β’ LM Studio β’ yfinance β’ PyPDF2 β’ Pandas β’ NumPy β’ Google Colab
Prerequisites: Python 3.8+, Google Colab, LM Studio, 8GB+ RAM
# Clone and setup
git clone https://github.com/Preveen369/Stock-Price-Prediction.git
cd Stock-Price-Prediction
python -m venv venv
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
pip install -r rag_requirements.txt
# Setup LM Studio (lmstudio.ai)
# Load models: gemma-3-4b + text-embedding-nomic-embed-text-v1.5
# Start server: http://localhost:1234
# Run application
streamlit run app.py # Opens at http://localhost:8501-
Environment (.env):
LM_STUDIO_URL,LM_STUDIO_MAX_TOKENS,LM_STUDIO_TEMPERATURE,LM_STUDIO_TIMEOUT -
LM Studio: Load
gemma-3-4b(chat) +nomic-embed-text-v1.5(embeddings) β Start server athttp://localhost:1234 -
Settings: See
config/llm_config.pyfor defaults (max_tokens: 2048, temperature: 0.3)
# 1. Ensure LM Studio is running with models loaded
# 2. Start Stockify
streamlit run app.py
# 3. Open browser at http://localhost:8501- Analyze Stock: Main Dashboard β Enter Symbol (AAPL) β View Charts & Predictions
- NASDAQ | NSE Stock Symbols: US (AAPL, TSLA) | India (INFY.NS, TCS.NS)
- Technical Analysis: Technical Analysis Page β View Moving Averages & Trends
- Investment Advice: Investment Summary β Risk Assessment β AI Recommendations
- Document Q&A: Financial Report β Upload PDF β Ask Questions β Get Answers
For detailed API documentation, see API_DOCUMENTATION.md
Core services layer that handles AI/ML operations and external integrations.
LocalLLMService- LM Studio integration for AI analysisLMStudioEmbeddings- Text embedding generationRAGPipeline- Retrieval-augmented generation pipeline
Helper functions for data processing, calculations, and file operations.
stock_utils.py- Stock data fetching and analysispdf_utils.py- PDF processing and chunking
Stock-Price-Prediction/
βββ π app.py # Main dashboard application
βββ π pages/ # Streamlit pages
β βββ π Financial_Report_Analysis.py # RAG-based PDF analysis
β βββ π Investment_Summary.py # AI investment recommendations
β βββ π Stock_Tickers_List.py # Browse stock symbols
β βββ π Technical_Analysis.py # Technical indicators analysis
βββ π services/ # Core services layer
β βββ π local_llm_service.py # LM Studio integration
β βββ π embeddings_service.py # Vector embedding generation
β βββ π rag_pipeline.py # RAG implementation
βββ π utils/ # Utility functions
β βββ π stock_utils.py # Stock data and metrics
β βββ π pdf_utils.py # PDF processing utilities
βββ π config/ # Configuration
β βββ π llm_config.py # LLM settings and env vars
βββ π models/ # Pre-trained models
β βββ πStock Predictions Model.keras # LSTM neural network
βββ π resources/ # Static resources
β βββ π NASDAQ_Active_Stocks_List.csv # US stock listings
β βββ π NSE_Active_Stocks_List.csv # Indian stock listings
βββ π requirements.txt # Core dependencies
βββ π stock_market_prediction.ipynb # LSTM model training notebook
βββ π stocks_list_extraction.ipynb # Stock tickers extraction notebook
βββ π API_DOCUMENTATION.md # Complete API reference
βββ π README.md # This file
| Module | Responsibility |
|---|---|
| app.py | Main dashboard, stock selection, LSTM predictions |
| services/ | LLM integration, embeddings, RAG pipeline |
| utils/ | Stock data fetching, calculations, PDF processing |
| pages/ | Individual analysis pages (UI components) |
| config/ | Environment variables, LLM configuration |
| models/ | Pre-trained LSTM model for predictions |
- What: Neural network architecture for time-series prediction
- How: Uses 100 days of historical prices to predict next 50/100/200 days
- Framework: Built with TensorFlow/Keras for deep learning
- Preprocessing: Scikit-learn for data scaling and normalization
- Accuracy: Typically achieves 75-90% accuracy on test data
- Training: Pre-trained on 2012-2022 historical data across thousands of stock patterns
Document β Chunks β Embeddings β Vector Store
β
Question β Embedding β Similarity Search β Retrieved Chunks
β
Chunks + Question β LLM β Answer
- Benefit: Accurate answers grounded in document content
- Advantage: No hallucinations, includes source citations
- What: Numerical representations of text (384 dimensions)
- Purpose: Enable semantic similarity search
- Model: Nomic Embed Text v1.5
- Use Case: Finding relevant document sections for RAG
- Privacy: All AI processing happens on your machine
- Speed: Depends on your hardware (GPU recommended)
- Models: Gemma 3, Mistral, Llama, etc.
- Benefits: No API costs, full control, offline capable
- LSTM: 100-day history β 50/100/200-day predictions (75-90% accuracy)
- RAG: Document chunks + embeddings + vector search β cited answers
- Embeddings: 384D vectors (Nomic v1.5)
- Local LLM: Privacy-first AI (Gemma/Mistral/Llama)
Symptoms: "LM Studio Not Connected" error in sidebar,
Solutions:
- Verify LM Studio is running
- Check server URL is
http://127.0.0.1:1234
Symptoms: Long processing times, lag
Solutions:
- Use smaller chunk sizes for PDFs (500 instead of 1000)
- Reduce
top_kin RAG queries (3 instead of 4) - Use lighter LLM models (4B instead of 7B)
- Close other applications
- Enable GPU acceleration in LM Studio
Symptoms: Out of memory, crashes
Solutions:
- Use quantized models (Q4 or Q5)
- Reduce max_tokens in config (1024 instead of 2048)
Pull requests are welcome! Feel free to fork the repository and suggest improvements.
Steps to contribute:
# 1. Fork the repository
# 2. Create a feature branch
git checkout -b feature-name
# 3. Commit your changes
git commit -m "Add feature description"
# 4. Push to GitHub
git push origin feature-name
# 5. Open a Pull RequestThis project is licensed under the MIT License - see the LICENSE file for details.
For educational purposes only. NOT financial advice. Past performance β future results. AI predictions may be inaccurate. Consult qualified advisors. Use at your own risk. No warranties or liability.
For queries or suggestions:
- π© Email: spreveen123@gmail.com
- π LinkedIn: www.linkedin.com/in/preveen-s
If you like this project, please consider giving it a β on GitHub!
Built with β€οΈ using DL/ML LSTM + Local AI LLMs + RAG