Skip to content

sanikasalunke/E-commerce-_Copilot_Fullstack_AI_Engineering_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛒 E-Commerce Copilot

A production-grade agentic RAG pipeline for intelligent product search and cart/checkout Q&A, powered by LangChain orchestration, LlamaIndex retrieval, FAISS vector store, and asynchronous Kafka inference workers.


Architecture

CSV/JSON Product Dump
        │
        ▼
 Ingestion Worker (Kafka Producer)
        │
        ▼
 LlamaIndex Indexer → FAISS Vector Store
        │
        ▼
 LangChain Agent (ReAct)
   ├── Semantic Search Tool
   ├── Cart Q&A Tool
   └── Kafka Consumer (async inference)
        │
        ▼
 FastAPI REST + WebSocket API
        │
        ▼
    React Frontend

Features

  • 🔍 Semantic Product Search — natural language queries over FAISS-indexed product catalog
  • 🛒 Cart & Checkout Q&A — context-aware answers about cart state, pricing, shipping
  • Async Inference Workers — Kafka-backed worker pool for scalable, non-blocking inference
  • 🧠 Agentic ReAct Loop — LangChain agent decides which tool to invoke per query
  • 📦 CSV/JSON Ingestion — plug in any product dump, auto-indexed on startup
  • 🐳 Docker Compose — one command to spin up the full stack

Tech Stack

Layer Technology
Orchestration LangChain (ReAct Agent)
Retrieval LlamaIndex + FAISS
Async Messaging Apache Kafka
API FastAPI + WebSocket
Embeddings OpenAI text-embedding-3-small
LLM OpenAI gpt-4o
Frontend React + Vite
Containerization Docker Compose

Quickstart

1. Clone & configure

git clone https://github.com/yourname/ecommerce-copilot
cd ecommerce-copilot
cp .env.example .env
# Fill in your OPENAI_API_KEY in .env

2. Add your product data

Drop a products.csv or products.json into the data/ directory.

CSV format:

id,name,description,price,category,stock
1,Widget Pro,A premium widget,29.99,Tools,150

3. Run with Docker

docker-compose up --build

4. Access


Local Development (without Docker)

# Backend
cd backend
pip install -r requirements.txt
uvicorn api.main:app --reload

# Worker (separate terminal)
python -m workers.inference_worker

# Frontend
cd frontend
npm install
npm run dev

Project Structure

ecommerce-copilot/
├── backend/
│   ├── agents/         # LangChain ReAct agent + tools
│   ├── api/            # FastAPI app, routes, WebSocket
│   ├── core/           # Config, logging, dependencies
│   ├── kafka/          # Producer/consumer abstractions
│   ├── retrieval/      # LlamaIndex indexer + FAISS store
│   └── workers/        # Async inference worker
├── frontend/           # React + Vite app
├── data/               # Drop CSV/JSON product dumps here
├── docker/             # Dockerfiles
├── scripts/            # Seed data, index builder scripts
├── docker-compose.yml
└── .env.example

Environment Variables

Variable Description
OPENAI_API_KEY Your OpenAI API key
KAFKA_BOOTSTRAP_SERVERS Kafka broker address (default: localhost:9092)
FAISS_INDEX_PATH Path to persist FAISS index
PRODUCTS_DATA_PATH Path to CSV/JSON product file
LOG_LEVEL DEBUG / INFO / WARNING

License

MIT

About

A production-grade agentic RAG pipeline for intelligent product search and cart/checkout Q&A, powered by LangChain orchestration, LlamaIndex retrieval, FAISS vector store, and asynchronous Kafka inference workers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors