Llama-Index QnA Bot is a Flask-based application that allows users to ask questions based on uploaded documents. Using LlamaIndex and OpenAI's API, the bot extracts relevant answers from stored materials in the data
folder. Supported document formats include .txt
and .pdf
.
Ensure you have the following installed:
- Python (latest stable version recommended)
- Flask - Web framework for the application
- OpenAI API Key - Required for generating responses
- LlamaIndex - For indexing and querying documents
To get started using this application, please follow the steps below:
- Install Python on your computer.
- Navigate to the directory where you have cloned this repository.
- Run the command
pip install -r requirements.txt
to install the necessary Python packages. - To use OpenAI’s models, you need to set up an API key.
- macOS / Linux
export OPENAI_API_KEY=your_api_key_here
- Windows
set OPENAI_API_KEY=your_api_key_here
- macOS / Linux
- Run the command
python app.py
to start the application. - Access the web interface:
- Open index.html in your browser.
- Enter your question, and the bot will retrieve answers from the uploaded documents using LlamaIndex.
Once the application is running, you can use it to generate text based on a prompt that you provide. Simply enter a prompt, and the application will use OpenAI's API to generate a response.
Additionally, the application supports document-based Q&A (Retrieval-Augmented Generation - RAG), allowing users to upload .txt and .pdf files for intelligent responses. It leverages OpenAI's language models to provide accurate and context-aware answers.
The user-friendly web-based UI ensures easy interaction, making the experience seamless and efficient.
Starter Tutorial (OpenAI) LlamaIndex
