This repository hosts an AI-powered chat application designed to provide information from a corporate knowledge base.
- AI-Powered Chat: Uses AI to answer questions based on corporate knowledge base materials.
- Streamlit Integration: Includes a Streamlit app for interactive chat.
- Telegram Bot: Implements a Telegram bot for chat functionality.
root/
├── src/ # Source code
│ ├── document_searching/ # Code related to document searching
│ ├── documents/ # Code related to document handling
│ ├── preprocessing/ # Preprocessing scripts
│ ├── question_answering/ # Question answering system code
│ ├── streamlit_app/ # Streamlit app scripts
│ ├── telegram_bot/ # Telegram bot scripts
│ └── utils/ # Utility scripts
│ ├── config.py # Configuration handling
│ ├── loader.py # General loaders
│ └── question_handler.py # Handling questions logic
├── tests/ # Test functionality
├── .gitignore # Git ignore file
├── README.md # Project documentation
├── requirements.txt # Python dependencies
├── start_streamlit_app.py # Script to start the Streamlit app
└── start_telegram_bot.py # Script to start the Telegram bot
To install the necessary dependencies, use:
pip install -r requirements.txt
To define document directories, use:
export DOCUMENT_DIRS=<dir1>:<dir2>:...:<dirN>
Each directory will be analyzed recursively
To start the Streamlit application, run:
python start_streamlit_app.py
To start the Telegram bot, do next steps:
- Set up the Telegram bot token
export BOT_TOKEN=<your token>
- Launch Telegram bot
python start_telegram_bot.py
The bot can work in 2 modes:
-
Search for the most suitable document and search for the answer to the question in it
To do this, you just need to write your question in a message to the bot -
Search for several most suitable documents
To do this you need to use the command
/top <number of documents in answer> <question>