Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TFG - Redesigning the User Experience with Artificial Intelligence: Fashion Industry Specialized Chatbot

Poc I: Unimodal RAG Chatbot

Overview

A unimodal RAG (Retrieval-Augmented Generation) chatbot that processes and responds to text queries using external datasets without retraining large language models. Utilizes FAISS for fast semantic search over the Zara Sales dataset, and Cohere’s Command R+ LLM for multilingual conversational responses.

Demo

Demo_PoC_I_Chatbot_Rag_Unimodal Demo_PoC_I_Chatbot_Rag_Unimodal

Features

  • Unimodal chatbot: text input and output only
  • Semantic retrieval of documents using FAISS vector store
  • Each dataset row processed as an individual document for embedding and indexing
  • LLM-powered responses using Cohere Command R+
  • Ready-to-use semantic search index
  • Ready-to-run code with Poetry-managed environment
  • Notebook experimentation and demos included

Architecture

High-level structure of the application: PoC_I_High_level_Architecture_Diagram

Sequence Diagram

PoC_I_Sequence_Diagram

Sequence Flow:

  1. User enters query (text) via Frontend.
  2. Frontend sends the query to the Backend.
  3. Backend retrieves relevant documents using Semantic Search (FAISS).
  4. Backend sends the query along with the retrieved documents to the LLM.
  5. LLM generates a response.
  6. Backend returns the generated response to Frontend.
  7. Frontend displays the generated response (text) to the user.

Tech Stack

Backend

Python 3.13.3 LangChain 0.3.4 Faiss 1.9.0

Frontend

Gradio 5.4.0

Models

Cohere-LLM command-r-plus-08-2024 Cohere-Embeddings embed-multilingual-v3.0

Infraestructure | Dev Tools

Poetry 1.8.5

Setup

# 1. Install Poetry (required) - https://python-poetry.org/docs/#installing-with-the-official-installer
# Windows (PowerShell):
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
poetry --version

# 2. Clone the repository
git clone https://github.com/estelacode/poc_I_tfg_unimodal_rag_chatbot.git
cd poc_I_tfg_unimodal_rag_chatbot

# 3. Install dependencies
poetry install

# Check where the virtual environment is located (optional)
poetry env info

Usage

# Run the project
poetry run python src/rag/main.py

Project Structure

poc_I_tfg_unimodal_rag_chatbot/
β”œβ”€β”€ data/ # Datasets and FAISS index
β”œβ”€β”€ demo/ # demo media
β”œβ”€β”€ docs/ # diagrams
β”œβ”€β”€ notebooks/ # Jupyter notebooks for experiments
β”œβ”€β”€ src/ # Source code
β”œβ”€β”€ .env # Environment variables (keep secret)
β”œβ”€β”€ .gitignore # Git ignore rules
β”œβ”€β”€ poetry.lock # Poetry dependency lock file
β”œβ”€β”€ pyproject.toml # Poetry configuration and dependencies
β”œβ”€β”€ README.md # Project README file

Roadmap

  • Support multimodal inputs: Extend chatbot to handle images, CSVs, or PDFs alongside text.
  • Add more datasets: Integrate additional datasets to broaden knowledge domain beyond Zara Sales.
  • Improve retrieval accuracy: Experiment with different embeddings models and FAISS configurations.
  • Add conversational memory: Maintain context across multiple turns for more natural dialogues.
  • Reranking techniques: Implement reranking of retrieved documents to improve answer relevance.
  • Guardrails / Topic filtering: Define rules to prevent the LLM from responding to unsafe or out-of-scope queries.
  • Evaluation and metrics: Introduce automated and human evaluation (e.g., Recall@k, BLEU/ROUGE) to measure retrieval and response quality.
  • Expose API endpoints: Provide HTTP services to query the chatbot programmatically.
  • Automated testing: Implement unit and integration tests for retrieval and generation components.
  • Cloud deployment: Make the chatbot accessible online via a cloud service or containerized solution.

References

πŸ‘‹ Author

Estela Madariaga

About

RAG-powered chatbot app for fashion products πŸ€–πŸ‘Ÿβš‘

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages