A DeFi/Crypto Investment Coach Chatbot powered by RAG (Retrieval-Augmented Generation) technology. This chatbot provides insights and education about crypto correlations and DeFi investing strategies, enhanced with real-time market data.
- 🎮 AI-powered chat interface
- 🌐 Real-time cryptocurrency market data
- 📈 Live price tracking for top cryptocurrencies
- 🔚 Content-aware responses based on your materials
- 🚡 Educational focus with investment disclaimers
- ⚡ Real-time streaming responses
- 🎨 Modern, responsive UI
- 📄 Easy content updates
- 🗄️ Persistent ChromaDB storage for embeddings
- 📝 Chunk-based document processing
- 🧠 Memory-based conversation tracking
The chatbot includes a live market data panel that displays:
- Total cryptocurrency market capitalization
- 24-hour trading volume
- Bitcoin dominance
- Top 5 cryptocurrencies with current prices and 24h changes
- Automatic 1-minute data refresh
Market data is provided by CoinGecko API and is automatically included in chat responses when discussing prices or market conditions.
-
Clone this repository:
git clone https://github.com/RobertYoung2022/uig-ai-chatbot.git cd uig-ai-chatbot -
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile and add your OpenAI API key:cp .env.example .env
Fill in the required environment variables in
.env:OPENAI_API_KEY: Your OpenAI API keyCOMPLETION_MODEL: OpenAI model to use (default: gpt-4)EMBEDDING_MODEL: OpenAI embedding model (default: text-embedding-3-small)
-
Ensure you have the following directory structure:
. ├── data/ │ ├── raw/ # Source content files │ ├── processed/ # Processed content │ ├── tech-analy-uig.md # Knowledge base document │ └── chromadb/ # Vector database storage ├── app.py ├── requirements.txt └── .env
- Document Processing: Uses CharacterTextSplitter with 500-character chunks and 50-character overlap
- Vector Store: ChromaDB with persistence enabled
- Embeddings: OpenAI Embeddings
- LLM: GPT-4 with temperature 0.7
- Memory: ConversationBufferMemory with message history
- Retrieval: Top-3 most relevant chunks for each query
- Make sure you're in the project directory
- Run the Streamlit app:
streamlit run app.py
- Open your browser and navigate to the URL shown in the terminal (usually http://localhost:8501)
Simply type your questions about crypto correlations, DeFi investing, or related topics in the chat input. The bot will provide detailed responses based on its knowledge base and current market data.
Example questions:
- "What is correlation in crypto?"
- "How do market sentiments affect crypto correlations?"
- "What are the different types of correlations?"
- "How can I use correlation in my DeFi investment strategy?"
- Articles:
.txtfiles - Video Transcripts:
.vttor.srtfiles
- Add new files to
data/raw - Run the ingestion script:
npm run ingest
uig-ai-chatbot/
├── app/
│ ├── api/
│ ├── chat/ # Chat API endpoint
│ │ ├── Chat.tsx # Chat interface component
│ │ └── MarketData.tsx # Live market data component
│ └── lib/
│ ├── content/ # Content processing utilities
│ ├── market/ # Market data services
│ ├── embeddings/ # Embedding utilities
│ └── vectorstore/ # Vector database interface
├── data/
│ ├── raw/ # Source content files
│ ├── processed/ # Processed content
│ └── chromadb/ # Vector database storage
└── scripts/
└── ingest.ts # Content ingestion script
The chatbot's features can be configured in app/config/chat.ts:
features: {
enableWalletIntegration: false, // Future feature
enableLiveData: true, // Live market data
enablePersonalization: false, // Future feature
}
market: {
updateInterval: 60000, // Update interval in ms
maxCoins: 5, // Number of top coins to display
includePriceHistory: false, // Future feature
}The project is designed to be extensible with:
- Wallet integration for portfolio tracking
- Price history and charts
- Personalized investment recommendations
- Additional market data sources
- Technical analysis indicators
MIT