Build This Project · AI Portfolio
RAG-Based Customer Support Assistant — Complete Project Guide
Quick summary — build a RAG-based customer support assistant
RAG (Retrieval-Augmented Generation) is one of the most in-demand AI skills. This project demonstrates your ability to build an AI assistant that can answer customer questions using company documentation — exactly what enterprises need.
In this guide you will learn:
- Project overview — what you'll build and why.
- Data source — where to get support documentation.
- Vector database setup — Chroma or Pinecone.
- RAG implementation — retrieval + generation.
- Building the app — Streamlit interface.
- Portfolio presentation — how to show it to employers.
SECTION 01Project overview
Here's what you'll build in this project:
- Business problem: Customer support teams spend hours answering repetitive questions. An AI assistant can provide instant, accurate answers using existing documentation.
- Your solution: A RAG-based assistant that retrieves relevant documents from a vector database and generates answers using an LLM.
- Tools: Python, LangChain, Chroma/Pinecone, OpenAI/Claude API, Streamlit.
- Outcome: A portfolio-ready AI application that demonstrates RAG, vector databases, and LLM integration.
SECTION 02Data source
Here are the best data sources for this project:
| Source | Data | Link |
|---|---|---|
| Public FAQs | Company FAQ pages | Various sources |
| Kaggle | Customer support datasets | kaggle.com/datasets |
| Own documents | Create your own | Use any text documents |
SECTION 03Vector database setup
Here's how to set up a vector database for your RAG system:
import chromadb
from chromadb.utils import embedding_functions
# Initialize Chroma client
client = chromadb.PersistentClient(path="./chroma_db")
# Create embedding function
embedding_fn = embedding_functions.SentenceTransformerEmbeddingFunction(
model_name="all-MiniLM-L6-v2"
)
# Create collection
collection = client.get_or_create_collection(
name="support_docs",
embedding_function=embedding_fn
)
# Add documents
documents = [
"How to reset password...",
"What are your shipping policies?...",
"How to track an order?..."
]
ids = [f"doc_{i}" for i in range(len(documents))]
collection.add(
documents=documents,
ids=ids
)
print(f"Added {len(documents)} documents to vector database")
# Query the vector database
def search_docs(query, n_results=3):
results = collection.query(
query_texts=[query],
n_results=n_results
)
return results['documents'][0]
# Test search
query = "How do I reset my password?"
relevant_docs = search_docs(query)
print("Relevant documents:")
for doc in relevant_docs:
print(f"- {doc}")
SECTION 04RAG implementation
Here's how to implement RAG with LangChain:
from langchain.embeddings import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.chat_models import ChatOpenAI
from langchain.chains import RetrievalQA
# Setup
embeddings = OpenAIEmbeddings()
llm = ChatOpenAI(model="gpt-3.5-turbo")
# Load vector store
vectorstore = Chroma(
persist_directory="./chroma_db",
embedding_function=embeddings
)
# Create RAG chain
qa_chain = RetrievalQA.from_chain_type(
llm=llm,
chain_type="stuff",
retriever=vectorstore.as_retriever(search_kwargs={"k": 3})
)
# Query
query = "How do I reset my password?"
answer = qa_chain.run(query)
print(answer)
# Custom RAG without LangChain
import openai
def rag_answer(query):
# 1. Retrieve relevant docs
relevant_docs = search_docs(query)
context = "\n".join(relevant_docs)
# 2. Create prompt
prompt = f"""You are a customer support assistant.
Use the following context to answer the question.
If the answer isn't in the context, say you don't know.
Context:
{context}
Question: {query}
Answer:"""
# 3. Generate answer
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{"role": "user", "content": prompt}]
)
return response.choices[0].message.content
# Test
answer = rag_answer("How do I reset my password?")
print(answer)
SECTION 05Building the app
Here's how to build a Streamlit app for your RAG assistant:
import streamlit as st
st.title("Customer Support Assistant")
st.markdown("Ask questions about our products and services.")
# Initialize RAG system
@st.cache_resource
def load_rag():
# Load vector store and RAG chain
return qa_chain
qa_chain = load_rag()
# User input
query = st.text_input("Your question:", placeholder="e.g., How do I reset my password?")
if query:
with st.spinner("Searching for answers..."):
answer = qa_chain.run(query)
st.subheader("Answer")
st.write(answer)
# Show sources
with st.expander("Sources"):
docs = vectorstore.similarity_search(query, k=3)
for doc in docs:
st.write(f"- {doc.page_content[:200]}...")
# Deploy on Streamlit Cloud
# 1. Create requirements.txt with:
# streamlit
# chromadb
# langchain
# openai
# 2. Add OPENAI_API_KEY to secrets
# 3. Push to GitHub and deploy
# Environment variables (secrets.toml)
# OPENAI_API_KEY = "sk-..."
# Run locally:
# streamlit run app.py
SECTION 06Portfolio presentation
Here's how to present this project to employers:
- GitHub: Upload your code, vector DB setup, and app code.
- README: Write a clear README with project overview, RAG methodology, and deployment instructions.
- Live demo: Deploy your app on Streamlit Cloud.
- Screenshots: Add screenshots of your app in action.
- LinkedIn post: Share your project with a brief explanation of the business problem you solved.
SECTION 07Interview Q&A — RAG assistant
Q1Why did you choose a RAG-based customer support assistant?
RAG is one of the most in-demand AI skills. I wanted to show I can build systems that combine retrieval and generation — exactly what enterprises need.
Q2What vector database did you use?
I used Chroma for development and Pinecone for production. Chroma is great for local development, and Pinecone scales well for production.
Q3What embedding model did you use?
I used sentence-transformers/all-MiniLM-L6-v2 for local development and OpenAI embeddings for production.
Q4What was the biggest challenge?
Handling different document formats and ensuring the retrieval retrieved the most relevant documents was the biggest challenge.
Q5What would you do differently next time?
I'd add document chunking strategies, reranking, and evaluation metrics to measure retrieval quality.
SECTION 08Test yourself — RAG assistant quiz
Five questions. No sign-up.
0 / 5Pick an answer to see why it is right or wrong.
SECTION 09Frequently asked questions
What is RAG?
RAG (Retrieval-Augmented Generation) is a technique that combines retrieval of relevant documents with LLM generation to produce accurate, context-aware answers.
What vector database is best for RAG?
Chroma is great for development and prototyping. Pinecone, Weaviate, and Qdrant are excellent for production.
What embedding model should I use?
For local development, use sentence-transformers/all-MiniLM-L6-v2. For production, use OpenAI or Cohere embeddings.
How long does this project take?
3-4 weeks — 1 week for data prep, 1 week for vector DB, 1 week for RAG, 1 week for app and deployment.
Do I need an OpenAI API key?
You can use open-source LLMs (Llama, Mistral) to avoid API costs, but OpenAI is easier to start with.
SECTION 10Related reads
Classroom & online · Noida
Build a RAG project — get hired
Our Artificial Intelligence Training Course includes RAG and other AI projects with step-by-step guidance.
₹18,500 · full programme- RAG & LLM projects
- Vector databases
- Mock interviews
- Weekday & weekend batches