This project is an advanced, AI-powered retail assistant built on a multi-agent framework (CrewAI) and a powerful Neo4j graph database backend. It is designed to intelligently understand and respond to complex customer queries by leveraging graph-based data relationships and Retrieval-Augmented Generation (RAG).
The core of this system is its ability to perform sophisticated tasks like personalized product recommendations through collaborative filtering, which is made possible by the Neo4j graph architecture.
The application provides a clean, conversational UI for users to interact with the AI assistant.
All data, including customers, products, and orders, is stored as an interconnected graph, allowing the system to understand complex relationships.
- Graph-Powered Backend: All data is stored and queried from a Neo4j database.
- Advanced Recommendation Engine: Uses collaborative filtering on the graph to provide personalized "customers who bought this also bought..." suggestions.
- Multi-Agent System (CrewAI): Orchestrates a team of specialized AI agents for robust and modular task handling.
- Hybrid Search (RAG): Performs semantic vector search for FAQs and products directly within Neo4j.
- Specialized Tools: A full suite of tools for retrieving order history, processing returns, and generating recommendations.
- Persistent Knowledge: Uses Docker for running the Neo4j database, ensuring data persistence.
- AI Framework: CrewAI
- LLM Provider: OpenAI (GPT-4o)
- Graph Database: Neo4j (run via Docker)
- Vector Search: Neo4j Vector Index
- Embedding Model: Sentence Transformers
- Web UI: Streamlit
- Language: Python 3.12
- Python 3.10+
- Docker Desktop
- An OpenAI API Key
-
Clone Repository:
git clone [https://github.com/neelabhpant/retail-assistant-graph.git](https://github.com/neelabhpant/retail-assistant-graph.git) cd retail-assistant-graph
-
Set Up Environment & Install Dependencies:
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt
-
Configure Environment Variables:
- Create a
.env
file in the project root. - Add your credentials:
OPENAI_API_KEY="your_api_key_here" NEO4J_URI="bolt://localhost:7687" NEO4J_USERNAME="neo4j" NEO4J_PASSWORD="password123" OPENAI_MODEL_NAME="gpt-4o"
- Create a
-
Launch Neo4j using Docker:
docker run -d --name neo4j-retail-db -p 7474:7474 -p 7687:7687 -v neo4j_retail_data:/data -e NEO4J_AUTH=neo4j/password123 neo4j:latest
-
Ingest Data into Neo4j:
python -m graph_db.ingest_data
- Ensure your virtual environment is active and the Neo4j Docker container is running.
- From the project root, launch the Streamlit app:
streamlit run streamlit_app.py