This project is a Retrieval-Augmented Generation (RAG) stock assistant, built using:
- Python CLI interface
- KDB.AI Cloud as the vector store
- HuggingFace embeddings
- Real-time stock data sources: yFinance, RSS, and SEC EDGAR filings
This project implements a Retrieval-Augmented Generation (RAG) pipeline tailored for financial use cases. It ingests real-time stock prices (via yFinance), market-moving news (via RSS), and company disclosures (via SEC EDGAR).
The documents are embedded using a HuggingFace transformer and stored in KDB.AI Cloud, a high-performance vector database. Queries from users are embedded, top-k relevant documents are retrieved, and responses are generated via an LLM.
Designed for easy replication with Docker, this assistant can support decision-making for investors, researchers, or algorithmic trading environments.
Category | Example Queries |
---|---|
Market Summaries | "Summarize today’s financial news." "What happened in the stock market today?" |
Stock-specific News | "Any news about Reliance today?" "What's new with TCS stock?" |
Sentiment or Trend Inference | "Is the market sentiment bullish today?" "What's the tone of today's financial headlines?" |
Keyword Searches | "Find documents mentioning interest rates." "Which news mentions inflation?" |
Sector-based Questions | "What's going on in the IT sector?" "Any updates in the banking industry?" |
- Ingest stock prices, news, and SEC filings.
- Embed documents using a SentenceTransformer model.
- Store embeddings in KDB.AI Cloud.
- Accept a user query via CLI.
- Embed the query and retrieve top-k similar documents.
- Generate a natural-language answer using an LLM.
Component | Description |
---|---|
ingest.py |
Fetch & preprocess news, stock data, filings |
embed.py |
Generate embeddings using HuggingFace |
query.py |
Query KDB.AI and trigger LLM-based response |
docker-compose.yml |
Run CLI + processing modules in containers |
KDB.AI |
Vector DB (SaaS) used for storing and querying embeddings |
CLI Interface |
User interacts with RAG system via terminal |
- Add Streamlit UI
- Add alerts for stock anomalies
- Key management in Docker