Skip to content

ThanusriPyarasani/Customer-Support-Resolution-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ DummyCart β€” Customer Support Resolution Agent

Python LangChain Groq Streamlit FAISS

A production-style agentic RAG system that resolves customer support issues end-to-end β€” answering policy questions, looking up live order data, and escalating to a human when needed.

Features β€’ Architecture β€’ Tech Stack β€’ Getting Started β€’ Demo


πŸš€ Features

  • 🧠 Agentic RAG β€” combines retrieval-augmented generation with tool-calling so the agent grounds every answer in real data
  • πŸ“¦ Live order lookups β€” fetches order status, tracking, and item details, gated on customer email verification
  • πŸ“„ Knowledge-grounded answers β€” semantic search over FAQ, refund policy, and shipping policy docs via FAISS
  • 🎫 Smart escalation β€” automatically creates a human support ticket when confidence is low or the customer requests it
  • ⚑ Powered by Groq β€” blazing fast LLM inference using Llama 3.3 70B, completely free
  • πŸ–₯️ Streamlit UI + CLI β€” run as a beautiful chat app or directly in the terminal

πŸ—οΈ Architecture

User Message
      β”‚
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     LangGraph ReAct Agent       β”‚
β”‚       (Groq Β· Llama 3.3 70B)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚ picks the right tool
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                  β”‚
    β–Ό                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ lookup_orderβ”‚  β”‚   kb_search /    β”‚
β”‚ orders.json β”‚  β”‚refund_policy_    β”‚
β”‚ email-gated β”‚  β”‚search β†’ FAISS    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚                  β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚create_ticketβ”‚  ← escalation
      β”‚tickets.json β”‚
      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β–Ό
      Final Response

🧰 The Four Tools

Tool What it does
lookup_order Fetches order status, items, totals, tracking β€” gated on customer email
kb_search Semantic search across FAQ + all policy docs
refund_policy_search Targeted search restricted to refund & returns policy
create_ticket Opens a human support ticket and escalates the conversation

πŸ› οΈ Tech Stack

Layer Technology
Agent Framework LangChain + LangGraph (ReAct agent)
LLM Groq β€” Llama 3.3 70B Versatile (free)
Embeddings HuggingFace β€” all-MiniLM-L6-v2 (local, free)
Vector Store FAISS (local)
UI Streamlit
Language Python 3.10+

πŸ“¦ Getting Started

Prerequisites

  • Python 3.10+
  • A free Groq API key β€” no credit card needed

1. Clone the repo

git clone https://github.com/YOUR_USERNAME/dummycart-support-agent.git
cd dummycart-support-agent

2. Create virtual environment

python -m venv .venv

# Mac/Linux
source .venv/bin/activate

# Windows
.venv\Scripts\Activate.ps1

3. Install dependencies

pip install -e .

4. Configure environment

cp env.example .env

Edit .env and add your Groq API key:

GROQ_API_KEY=your_groq_api_key_here
GROQ_MODEL=llama-3.3-70b-versatile

5. Build the knowledge base (one-time)

python ingest.py

6. Run

Streamlit UI:

streamlit run app.py

Terminal CLI:

python main.py

πŸ’¬ Demo Prompts

πŸ“¦ Order Lookups

"Check order DC-10234, my email is alex@example.com"
"What's the status of DC-10235? Email: priya@example.com"
"Can you track my order DC-10236? Email: jordan@example.com"

πŸ“„ Policy & FAQ

"What's your refund policy?"
"How long does shipping take?"
"Can I cancel my order?"
"What payment methods do you accept?"

🎫 Escalation

"My package arrived broken, I need help"
"I think someone used my card to place an order"
"I want to speak to a human agent"

πŸ”€ Combination

"Where's order DC-10234 (alex@example.com)? Can I still cancel it?"
"What's the return policy for damaged items? My order DC-10236 arrived broken"

πŸ“‚ Project Structure

dummycart-support-agent/
β”œβ”€β”€ agent.py            # LangGraph ReAct agent + system prompt
β”œβ”€β”€ tools.py            # lookup_order, kb_search, refund_policy_search, create_ticket
β”œβ”€β”€ ingest.py           # Builds FAISS index from data/*.md
β”œβ”€β”€ app.py              # Streamlit chat UI
β”œβ”€β”€ main.py             # Terminal CLI
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ faq.md
β”‚   β”œβ”€β”€ refund_policy.md
β”‚   β”œβ”€β”€ shipping_policy.md
β”‚   β”œβ”€β”€ orders.json     # Sample order database
β”‚   └── tickets.json    # Tickets created by the agent
β”œβ”€β”€ kb_index/           # FAISS index (auto-created by ingest.py)
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ env.example
└── .gitignore

πŸ” Extending It

  • Swap data/orders.json for a real database query
  • Replace FAISS with a managed vector DB (Qdrant, Pinecone) β€” only ingest.py changes
  • Add tools: update_shipping_address, issue_store_credit, start_return
  • Plug create_ticket into Zendesk / Linear / your real ticketing system
  • Deploy on Streamlit Cloud for free

πŸ“„ License

MIT β€” feel free to use, modify, and build on top of this.


Built with ❀️ using LangChain, Groq, and Streamlit

About

A production-style AI customer support agent built with LangChain, LangGraph, and Groq. Combines agentic tool-calling with RAG to resolve orders, answer policy questions via FAISS semantic search, and auto-escalate to human tickets when needed.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages