An AI-powered conversational assistant for a Website built using Streamlit, LangChain, and Mixtral LLM. It leverages retrieval-augmented generation (RAG) by embedding and indexing website content into Qdrant vector store for contextual question answering.
- Web scraping and chunking of pages using
WebBaseLoaderandRecursiveCharacterTextSplitter - Embedding with
HuggingFace BAAI/bge-small-en - Vector storage using
Qdrant - Chat with memory using LangChain's
create_history_aware_retriever - Context-aware RAG chain for accurate responses
- Interactive UI with
Streamlitand custom html, css template. - Supports Mixtral-8x7B LLM using Groq API.
- Load and split content from a website.
- Embed the content using HuggingFace embeddings.
- Store embeddings in Qdrant.
- Accept user queries via chat interface.
- Use RAG to retrieve relevant context.
- Generate accurate answers using Groq's LLM.
Retrieval-Augmented Generation (RAG) is an architecture that combines information retrieval with generative models. Instead of relying only on a language model's internal knowledge, RAG retrieves relevant information from an external knowledge base (like a vector database) and uses that context to generate more accurate and grounded responses.
This approach improves:
- Accuracy: Answers are based on real documents, not just model memory.
- Freshness: You can update the knowledge base without retraining the model.
- Efficiency: Smaller models can perform better with relevant context.
In this project, we use:
- Qdrant for storing and retrieving embedded chunks of website data
- LangChain to manage retrieval and generation flow
- Mixtral LLM to generate responses based on retrieved context
| Component | Technology |
|---|---|
| UI | Streamlit |
| LLM | Mixtral via Groq API |
| Embeddings | HuggingFace bge-small-en |
| Vector DB | Qdrant |
| Backend Orchestration | LangChain |
| Env Variables | python-dotenv |
-
Clone the repository
git clone https://github.com/Amarta113/AI-Web-Navigator.git
-
Install dependancies
pip install -r requirements.txt
-
Set environment variable
Create a
.envfile and set your Qdrant credentialsqdrant_url = YOUR-QDRANT-VECTORSTORE-URL qdrant_key = YOUR-QDRANT-API-KEY
-
Run the app
streamlit run main.py
Groq API Key (input from sidebar at runtime)
Qdrant API Key (via .env)
1.Open the app in your browser.
2.Paste your Groq API key in the sidebar.
3.Ask questions related to the indexed website.
4.Get instant, context-aware answers.
-
Target Website: Replace the URL in
WebBaseLoader([ ... ]) -
Model Name: You can switch from
bge-small-ento another Hugging Face model based on your needs.Use the Hugging Face MTEB leaderboard to select the best model for your use case.
-
Groq Model: Default is
mixtral-8x7b-32768, changeable in the code -
Collection Name: Change
collectionto anything relevant to your use case -
Logo: You can change the bot and user logos by setting the image URLs in the
style.pyfile.
The app uses custom HTML/CSS templates for chat styling. See:
style.py → contains css, bot_template, user_template