This app provides three main features: a standard Chatbot for general conversations, a more advanced SearchBot that leverages Large Language Models (LLMs) with search tools, and a File Q&A feature that allows you to interact with documents by asking questions based on their content.
Explore MultiAI at: https://multi-ai.streamlit.app/
This is just a regular chatbot where you can interact with various open source Large Language Models (LLMs). Whether you want to ask questions, chat about random topics, or just explore what these models can do, this chatbot is here to help. It's a fun and simple way to see how LLMs handle different kinds of conversations.
SearchBot is a bit more advanced. It combines the power of LLMs with search tools, like DuckDuckGo's LangChain Python modules, to give you more accurate answers. The LLMs generate search queries, and then the results are used to build responses. Not all LLMs are great at using these search tools, so you might see some errors occasionally. Below is a list of LLMs that most consistently perform well with the search tool:
- llama3-70b-8192 (Meta)
- llama3-8b-8192 (Meta)
- gemma2-9b-it (Google)
- llama-3.1-70b-versatile (Meta)
- mixtral-8x7b-32768 (Mistral AI)
With the File Q&A feature, you can upload files in PDF, TXT, or Markdown (MD) formats and ask questions based on the content of those files. The LLMs use Retrieval-Augmented Generation (RAG), which means they retrieve relevant information from the document and generate answers that are contextually accurate. This approach helps the model provide more precise responses based on the actual content of the files, making it a handy way to interact with your documents without having to read through everything yourself.
- Python: The entire app is developed in Python.
- Streamlit: Used to build the app's user interface.
- Groq: Provides the LLMs for chatbot responses, search queries, and file-based Q&A.
- LangChain:
- LangChain Core: Manages LLMs and tool interactions.
- LangChain Agents: Used for
ZERO_SHOT_REACT_DESCRIPTION
agents with web search tools. - LangChain Community Tools: Integrates DuckDuckGo for real-time web searches.
- LangChain Document Loaders: Loads and processes PDF, TXT, and Markdown files.
- LangChain VectorStores: FAISS is used for document embedding and retrieval.
- HuggingFace Embeddings: Utilizes
all-MiniLM-L12-v2
for embedding text data in the File Q&A feature.
- Tempfile: Manages temporary storage during file uploads.
- Python 3.x
- Required Python libraries (see
requirements.txt
)
- Clone the repository:
git clone https://github.com/BilalM04/MultiAI.git
- Navigate to the porject directory:
cd MultiAI
- Install the required libraries:
pip install -r requirements.txt
- Start the app:
streamlit run Chatbot.py
- Open your browser and go to the
localhost
link specified in the command line.
- Chatbot: Start a conversation by typing in the input field and pressing Enter.
- SearchBot: Type your prompt, and the bot will use both LLMs and search tools to give you an answer.
- File Q&A: Upload a PDF, TXT, or MD file and ask questions related to its content.
Explore the live demo: MultiAI