This repository contains StrategyBot, a chatbot built with Python and Streamlit to support users in navigating strategy-related questions. The chatbot draws from two publicly available strategy documents in PDF format and provides guidance based on their content.
To build the chatbot, I used two strategy documents as the knowledge base and parsed them using SimpleDirectoryReader from LlamaIndex. The app allows users to interact with the documents through a chat interface, ask follow-up questions, and receive context-aware answers grounded in the content of the PDFs.
Additional features include:
- Feedback collection: Users can rate answers with a thumbs up/down.
- Conversation logging: Questions, answers, timestamps, and feedback are recorded and appended to a
.csvfile. - Data export: The collected interaction data can be used for analysis and future improvements.
- Session control: Users can refresh the chat at any time to start a new session.
Here’s a screenshot of the deployed Streamlit app showing the user interface:
Complete-Guide-to-Strategic-Planning.pdf: Strategy resource file from On Strategyhow-to-formulate-successful-business-strategy.pdf: Strategy resource file from Harvard Business School
StrategyBot_ChatBot.py: Main Python script to run the Streamlit app
bot.png: Avatar image for the chatbot assistantmagnifying-glass.png: Avatar image for the usergiuseppe-buccola-zcKLLpMAbXU-unsplash.jpg: Header image used as a banner in the appStrategyBot_preview.png: Screenshot of the deployed chatbot interface
To run this app, you'll need a Hugging Face account and an API token. You can create one at huggingface.co and generate a token.
- Clone or download this repository.
- In
StrategyBot_ChatBot.py, update the file paths and insert your Hugging Face API token. - From your terminal, run the Streamlit app with:
streamlit run [your_file_path]/StrategyBot_ChatBot.py
- Python 3.10.12
- pandas 2.2.2
- llama-index 0.12.31
- Streamlit
- Hugging Face (for LLM inference)
