Vietnames RAG powered AI chatbot for an online flower shop
Create an .env file and populate these ENV variables needed as required in .env.example
for VECTOR_INDEX_NAME, create a MongoDB Atlas vectorSearch index for the DB_COLLECTION collection:
{
"fields": [
{
"numDimensions": 768,
"path": "embedding",
"similarity": "cosine",
"type": "vector"
}
]
}
for KEYWORD_INDEX_NAME, create a MongoDB Atlas search index for the DB_COLLECTION collection:
{
"mappings": {
"dynamic": false,
"fields": {
"title": [
{
"type": "string"
}
]
}
}
}
for SEMANTIC_CACHE_INDEX_NAME, create a MongoDB Atlas vectorSearch index for the SEMANTIC_CACHE_COLLECTION collection:
{
"fields": [
{
"numDimensions": 768,
"path": "embedding",
"similarity": "euclidean",
"type": "vector"
},
{
"path": "llm_string",
"type": "filter"
}
]
}
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Run web scraper, all_urls.json and output.json files will be generated:
Load documents and their embeddings into MongoDB:
Run streamlit app to access chatbot: