This example provides an interface for asking questions to a Web Page content. We will build an application that will read a webpage and answer any question from it. Here users can paste any wesite URL (preferably documentation) and ask questions through a straightforward UI.
Our tech stack is super easy with Langchain, Ollama, and Streamlit.
- LLM Server: The most critical component of this app is the LLM server. Thanks to Ollama, we have a robust LLM Server that can be set up locally, even on a laptop.
- RAG: Undoubtedly, the two leading libraries in the LLM domain are Langchain and LLamIndex. For this project, I’ll be using Langchain. An essential component for any RAG framework is vector storage. We’ll be using Chroma here, as it integrates well with Langchain.
- Chat UI: The user interface is also an important component. Although there are many technologies available, I prefer using Streamlit, a Python library, for peace of mind.
As mentioned above, setting up and running Ollama is straightforward. First, visit ollama website and download the app appropriate for your operating system.
ollama pull llama3
Afterward, run the below command to verify if the model was pulled correctly.
ollama list
Clone this project. Go to project root folder, then install the required libraries:
pip install -r requirements.txt
choco install awk
OR
scoop install gawk
OR
Download from GnuWin32 site and add it to environment variable path.
streamlit run rag_webpage_st.py
A webpage will open on port 8501, where user need to select the ollama model and website URL. Then in the chatbox questions can be asked:
i.e. - for LHC wikipedia page What is the purpose of LHC?
Special Thanks to this article.