This project focuses on building a customer support agent/chatbot in python for an online flower shop using:
Probably be used for ordering flowers for an anniversay or valentine. Customers can also ask about the business processes such as order deliveries
- Streamlit (frontend)
- LangGraph (agent logic)
- Chromadb (local vector database)
- HuggingFace (RAG embedding model)
- LlamaIndex (local hosting)
I will build features into the chatbot such as:
- Managing customer profiles
- Getting customer order updates
- Placing customer orders
- Answering customer FAQ
- Getting product reccommendations
Libraries Needed: langchain-openai python-dotenv langchain-groq langgraph
Create and Ultilize a Local RAG
we will setup a local RAG database with ChromaDB, HuggingFace and LlamaIndex in order to be able to retrieve relevant products and FAQ questions. We will also connect it to the frontend we built in the previous episode to test it interactively.
In this part we created a vector database with ChromaDB, and connected it to our streamlit frontend. With this setup we were able to ask FAQ style questions and also ask for product recommendations for our Flower Shop. Within the chroma database we created two knowledge base collections:
IMAGE
FAQ Question and Answer pairs Product descriptions We also updated the front end to choose between which knowledge base e.g Inventory to query:
-
- What to will build;
-
- Setting up FAQs & Product reccommendations
-
- New packages
-
- Finding RAG embedding model
-
- Local Vector Database (Chroma)
-
- LlamaIndex Embeddings
-
- Ingest FAQs into Vector DB
-
- Querying Vector DB
-
- Update Streamlit Frontend
-
- Tidy up python
-
- Adding Product Inventory
-
- Adding Radio Button to guide user on which knowledge base to query i.e FAQ or Inventory descriptions
Libraries Needed: langchain-openai python-dotenv langchain-groq langgraph
will setup LangGraph to act as an an Agentic Chatbot. We will connect our Agent with the RAG database we setup in the last chapter with two tools that the Agent can use to retrieve information on demand. We will use few shot prompting in our tool definition to teach our language model how to use them effectively Image
-
What we will build
-
Package Setup
-
Setup LangGraph without prompt
-
Test with single node
-
Create Prompt
-
ChatTemplate
-
Create LLM Intialisation
-
Use LLM in node
-
Cmd line test of script
-
Connect to frontend
-
Test Frontend
-
Create tool for Querying Knowledge base ---> tools.py
-
Product Reccommendation tool ---> tools.py
-
Bind tools to LLM + ChatPrompt
-
Add tools to LangGraph Agent
-
LangGraph Conditional Edge
-
Updating frontend & testing
Create customers database and give our LangGraph chatbot the ability to manage it with two new agent tools:
- Retrieving customer details with a DPA check
- Creating a new customer
-
What we will build
-
Creating customers database
-
Creating tools
-
Data protection check tool
-
Create new customer tool
-
Connecting tools to LangGraph
-
Updating prompt
-
Updating frontend
-
Demo and wrapup