You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scrape Page Content: For each URL, the scraper extracts the main text content while removing navigation, footer, and script elements.
Store Scrapted Data: The script collects text data from all pages and saves it to a file called company_info.txt.
Run the Scraper: Execute the script to start scraping and save the data locally.
RAG w/ LangChain Overview
Retrieval Augmented Generation (RAG)
A typical RAG application has two main components, indexing and retreival augmented generation
Indexing: A pipeline for ingesting data from a source (i.e., able.co) and indexing it. Usually done offline.
RAG: Takes a user query at run time and retreieves the relevant data from the index, then passes it to the model.
A Common Pipeline
Load: First we need to load our data using a Document Loader.
Split: We need to break these documents into smaller chunks using a Text Splitter. This is useful for indexing and passing data into a model.
Note: Larger chunks are harder to search over and won't fit in a model's finite context window.
We need somewhere to store and index the splits, so that they can be searched over later. This is done with a VectorStore (database) and Embeddings model (semantic representation).
Retreive: Given a user input, releveant splits are retrieved from storage using a Retriever.
Generate: A ChatModel (or LLM) produces an answer using a prompt that includes both the question and retreived data.
Future Improvements
Citing Information: A great way to prevent hallucinations is to implement citations, where a chatbot provides a reference to the specific chunk or document where it pulls information from. This makes it easy to verify the information that the model provides.
System Prompts: System prompts can help a model remember its own identity. For example, we could tell the chatbot that it has a name like AbleBot, that it works for Able and answers questions from Able's customers, etc.
Optimal Text Splitting: When the RAG pipeline is setup we define a few important parameters. The chunk size defines the number of characters per chunk, and the chunk overlap defines the number of characters that should overlap between adjacent chunks. Optimizing these numbers could improve model recall and accuracy of answers. I did not test it much for this prototype.
About
A Chatbot designed to handle basic FAQ about Able [able.co] !