Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fashion Graph RAG

A Fashion Product Search and Recommendation Assistant built using:

  • Streamlit
  • Neo4j Graph Database
  • Ollama
  • Nomic Embeddings
  • Local LLMs (DeepSeek / Qwen)

The application combines semantic search, graph retrieval, and local language models to provide product recommendations without requiring any external API keys.


Architecture

User Query
    ↓
Embedding Search
    ↓
Nearest Graph Entities
    ↓
Graph Retrieval
    ↓
Product Context
    ↓
Local LLM (Ollama)
    ↓
Structured Product Recommendations

Features

  • Semantic product search
  • Graph-based product retrieval
  • Local embeddings using Nomic
  • Local LLM inference using Ollama
  • No API keys required
  • Product recommendation cards
  • Neo4j knowledge graph integration

Prerequisites

Install the following software before running the application.

Python

Recommended:

Python 3.11+

Neo4j

Install Neo4j Desktop or Neo4j Community Edition.

Create a database and ensure it is running.

Example:

URI: bolt://localhost:7687
Username: neo4j
Password: yourpassword

Ollama

Install Ollama:

https://ollama.com

Pull the required models:

ollama pull nomic-embed-text
ollama pull deepseek-r1:1.5b

Optional:

ollama pull qwen3:4b

Clone Repository

git clone https://github.com/codersbranch/graph_rag_search_app.git

cd graph_rag_search_app

Create Virtual Environment

Windows

python -m venv venv

venv\Scripts\activate

Linux / Mac

python3 -m venv venv

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Configuration

Create a file named:

.env

Example:

NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=yourpassword

Update your application to read values from the configuration file.


Neo4j Dataset

Import your fashion product dataset into Neo4j.

Sample data will be available under the directory /data

Import the sample data using the command

neo4j stop
neo4j-admin database load neo4j --from-path=your_path_to_file --overwrite-destination=true
neo4j start

Example graph structure:

Product
 ├── HAS_TYPE → ProductType
 ├── HAS_COLOR → Color
 ├── HAS_SIZE → Size
 ├── MADE_BY → Brand
 ├── MADE_OF → Material
 └── BELONGS_TO → Category

Example:

Fashion Product 28
 ├── HAS_TYPE → Jeans
 ├── MADE_BY → Reebok
 ├── HAS_COLOR → Red
 ├── HAS_SIZE → L
 ├── MADE_OF → Denim
 └── BELONGS_TO → Kids

Start Ollama

Verify Ollama is running:

ollama list

Expected models:

nomic-embed-text
deepseek-r1:1.5b

Run Application

streamlit run app.py

Application URL:

http://localhost:8501

Example Queries

Nike Blue Jeans

Show me red shirts

Kids denim products

Reebok products in size L

Show products similar to jeans

Project Structure

fashion-graph-rag/
│
├── app.py
├── .env
├── requirements.txt
├── README.md
│
└── data/

Hardware Requirements

Minimum

CPU: Intel i5 / Ryzen 5
RAM: 16 GB
Storage: 10 GB

Recommended

CPU: Intel i7 / Ryzen 7
RAM: 32 GB
GPU: RTX 3060 or higher
Storage: SSD

Future Improvements

  • Neo4j Vector Indexes
  • Hybrid Retrieval
  • Product Re-ranking
  • Qwen3 Integration
  • Product Images
  • Chat History
  • Advanced Recommendation Engine

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages