π€ An AI-powered chatbot that provides investment wisdom based on Warren Buffett's teachings and philosophy.
- π¬ Interactive Chat: Natural conversation interface for investment questions
- π Semantic Search: AI-powered search through 4,996+ Warren Buffett Q&A pairs
- π§ Contextual Responses: RAG (Retrieval-Augmented Generation) for accurate answers
- π Source Transparency: View the exact knowledge used for each response
- π Investment Categories: Organized wisdom across multiple investment topics
- ποΈ Customizable: Adjust response length, context depth, and model settings
- Embeddings: sentence-transformers/all-MiniLM-L6-v2 for semantic search
- Vector Database: FAISS for fast similarity search
- Language Model: Google FLAN-T5 (base + optional fine-tuned version)
- Frontend: Streamlit for interactive web interface
- Data: 4,996+ curated Warren Buffett Q&A pairs
- Python 3.8+
- 2GB+ RAM
- Internet connection (for initial model downloads)
-
Clone and setup:
git clone <repository> cd buffett-bot
-
Install dependencies:
pip install -r requirements.txt
-
Add your data:
# Place Dataset_Warren_Buffet_Clean.csv in the data/ folder cp Dataset_Warren_Buffet_Clean.csv data/ -
Run the application:
streamlit run app/streamlit_app.py
Ask BuffettBot questions like:
- Value Investing: "Why is margin of safety important in investing?"
- Business Analysis: "How do you evaluate company management quality?"
- Market Philosophy: "What's your view on market timing vs time in market?"
- Risk Management: "How do you think about portfolio diversification?"
- Company Evaluation: "What makes a business worth owning forever?"
- Investment Strategy: "When should I sell a stock?"
- Compare responses from base FLAN-T5 vs fine-tuned BuffettBot
- Switch between models in real-time
- See performance differences
# Train a specialized model on Buffett's teachings (takes 30-60 minutes)
python scripts/train_model.py- Adjust response length and creativity
- Control number of context documents
- Toggle context visibility
- Export chat conversations
buffett-bot/
βββ README.md
βββ requirements.txt
βββ .env.example
βββ data/
β βββ Dataset_Warren_Buffet_Clean.csv
βββ models/
β βββ __init__.py
β βββ embeddings.py # Sentence transformer wrapper
β βββ retriever.py # FAISS semantic search
β βββ generator.py # FLAN-T5 response generation
βββ utils/
β βββ __init__.py
β βββ config.py # Project configuration
β βββ data_processor.py # Dataset handling
βββ app/
β βββ __init__.py
β βββ streamlit_app.py # Main application
β βββ components/
β βββ __init__.py
β βββ chat_interface.py # Chat UI components
β βββ sidebar.py # Sidebar components
βββ scripts/
β βββ setup_models.py # Download and cache models
β βββ build_index.py # Build FAISS search index
β βββ train_model.py # Fine-tune on Buffett data
βββ saved_models/ # Cached models and indices
βββ embeddings/
βββ fine_tuned/
βββ faiss_index/
python -m pytest tests/python scripts/build_index.pypython scripts/setup_models.py- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is for educational purposes. Please respect OpenAI's usage policies and Warren Buffett's intellectual property.
Important: This chatbot is for educational and informational purposes only. It is not intended to provide financial advice or investment recommendations. Always consult with qualified financial advisors before making investment decisions.
- Warren Buffett for his timeless investment wisdom
- Hugging Face for the transformers library
- OpenAI for inspiration in conversational AI
- Streamlit for the excellent web framework