This is a RAG system which creates a RAG system where we can scrape any web URL. Once done, we can ask questions based on the information that was scrapred.
This application uses
- Llama 3.1 model (we are expecting the ollama service is running locally)
- Chroma DB to store the embeddings
To start the Flask APIs, we just need to run python app.py
There are 3 APIs that this application exposes
Pass it a valid web URL and it will try to crawl the information.
curl -X POST \
'http://localhost:8080/scrape' \
--header 'Accept: */*' \
--header 'User-Agent: Thunder Client (https://www.thunderclient.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://www.amitavroy.com/about"
}'
This URL will allow you to ask a question to the bot based on the information crawled.
curl -X POST \
'http://localhost:8080/ask_bot' \
--header 'Accept: */*' \
--header 'User-Agent: Thunder Client (https://www.thunderclient.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
"question": "Who is Amitav Roy?"
}'
The CSV is inside the data folder. To generate the embeddings, run python intent.py
This URL assumes the basic intent training is done.
curl -X POST \
'http://localhost:8080/get_intent' \
--header 'Accept: */*' \
--header 'User-Agent: Thunder Client (https://www.thunderclient.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
"question": "do you have shoes for sports?"
}'