My first AI-powered customer support agent for e-commerce, built with Gemini and LangChain.
This agent uses Retrieval-Augmented Generation (RAG) to provide grounded answers from the Hugging Face E-Commerce Customer Support QA dataset. It demonstrates how to build a vector index, retrieve relevant knowledge, and generate concise answers using a modern LLM.
-
Clone the repository
git clone https://github.com/eershr/e-commerce-support-agent.git cd e-commerce-support-agent -
Install dependencies
pip install -r requirements.txt
-
Build the index and run the agent
python scripts/build_index.py python scripts/run_qa.py
Dataset:
- Used the Hugging Face E-Commerce Customer Support QA dataset in parquet format.
Embeddings:
- Chose text-embedding-004 for semantic embeddings.
- Why text-embedding-004? Default choice for new RAG pipelines in 2025.
- Provides better semantic clustering, multilingual support, and domain generalization.
Vector store choice:
- Used FAISS instead of Chroma.
- FAISS is fast, memory-efficient, and ideal for large datasets.
- Ease of integration into local environments and AI frameworks like LangChain.
Pipeline choice:
- Used RetrievalQA instead of a fully Runnable pipeline.
- Simpler to implement for question-answering.
- Runnable pipelines provide more flexibility but require more setup and are better for multi-step reasoning or custom transformations.
Other key learnings:
- Prompt design is critical — adding instructions like “Answer only using the provided context” significantly improves answer quality.
- FAISS retrieval + structured Q&A documents ensures the agent rarely answers “I don’t know.”