An intelligent crypto news analysis system powered by RAG (Retrieval Augmented Generation) that automatically scrapes, processes, and analyzes cryptocurrency news to provide real-time insights and answers to your questions! 🚀
- 🔄 Real-time News Scraping: Automatically scrapes crypto news from TradingView
- 🧠 Intelligent Analysis: Uses advanced RAG architecture to provide context-aware responses
- 💡 Flexible Model Support: Works with both OpenAI and local models
- 🔍 Hybrid Search: Combines vector and keyword search for better results
- 🎯 Smart Reranking: Uses Cohere for intelligent result reranking
- Clone the repository:
git clone https://github.com/marsidmali/Crypto-News-Assistant.git
cd Crypto-News-Assistant
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Creat
config.json
(see Configuration example) - Add your API keys and configuration
- Creat
- Get your API key from OpenAI
- Add it to your
config.json
:
{
"model_type": "openai",
"openai_api_key": "your-key-here",
"openai_model": "gpt-4o-mini"
}
- Install Ollama from ollama.ai
- Pull your preferred model:
ollama pull deepseek-r1:32b
- Update your
config.json
:
{
"model_type": "ollama",
"ollama_model": "deepseek-r1:32b"
}
- Create an account at Cohere
- Get your API key and add it to your
config.json
:
{
"cohere_api_key": "your-cohere-key-here"
}
- Start the application:
streamlit run src/app.py
- Wait for the initial news scraping and indexing
- Start asking questions about crypto news and trends!
The app uses the following RAG (Retrieval Augmented Generation) architecture:
-
Data Ingestion:
- Scrapes crypto news from TradingView
- Processes and chunks articles for optimal retrieval
-
Hybrid Retrieval:
- Vector Search (FAISS) with MiniLM embeddings
- Keyword Search (BM25)
- Weighted ensemble combination
-
Smart Reranking:
- Cohere Rerank for context-aware result selection
- Top-N filtering for most relevant context
-
Response Generation:
- Context-aware prompt engineering
- Flexible model support (OpenAI/Ollama)
- Streaming response generation
crypto-news-assistant/
│
├── src/ # Source code
│ ├── app.py # Streamlit application
│ ├── scraper.py # TradingView scraping logic
│ └── rag.py # RAG system implementation
│
├── config.json # Configuration file
├── requirements.txt # Dependencies
└── README.md # Documentation
Example config.json
:
{
"model_type": "openai or ollama"
"openai_api_key": "",
"openai_model": "gpt-4o-mini",
"ollama_model": "deepseek-r1:32b",
"cohere_api_key": ""
}
This project is licensed under the MIT License - see the LICENSE file for details.