{"id":25008798,"url":"https://github.com/phrugsa-limbunlom/picksmart","last_synced_at":"2025-09-02T01:33:11.484Z","repository":{"id":268174939,"uuid":"903380922","full_name":"phrugsa-limbunlom/PickSmart","owner":"phrugsa-limbunlom","description":"PickSmart AI-powered shopping assistant platform for personalized product recommendations implemented by Groq API, Tavily, Langchain, and Langgraph","archived":false,"fork":false,"pushed_at":"2025-03-20T19:15:54.000Z","size":1631,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T01:37:42.074Z","etag":null,"topics":["agents","fast-api","kafka","langchain","langgraph","mongodb","rag","tavily"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phrugsa-limbunlom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-14T13:12:28.000Z","updated_at":"2025-03-20T19:15:57.000Z","dependencies_parsed_at":"2025-01-18T22:50:39.344Z","dependency_job_id":"8ba9ce13-09a9-4878-9ae3-b6bd92591abf","html_url":"https://github.com/phrugsa-limbunlom/PickSmart","commit_stats":null,"previous_names":["phrugsa-limbunlom/llm-chatbot-with-rag","phrugsa-limbunlom/rag-llm-bot","phrugsa-limbunlom/picksmart"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrugsa-limbunlom%2FPickSmart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrugsa-limbunlom%2FPickSmart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrugsa-limbunlom%2FPickSmart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrugsa-limbunlom%2FPickSmart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phrugsa-limbunlom","download_url":"https://codeload.github.com/phrugsa-limbunlom/PickSmart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250472049,"owners_count":21436071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","fast-api","kafka","langchain","langgraph","mongodb","rag","tavily"],"created_at":"2025-02-05T03:53:33.689Z","updated_at":"2025-04-23T16:42:42.623Z","avatar_url":"https://github.com/phrugsa-limbunlom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e PickSmart 🛒 \u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n\u003cimg alt=\"Langchain\" src=\"https://img.shields.io/badge/-Langchain-013243?style=flat\u0026logo=langchain\u0026logoColor=white\"\u003e \u003cimg alt=\"Langgraph\" src=\"https://img.shields.io/badge/-Langgraph-013243?style=flat\u0026logo=Langgraph\u0026logoColor=white\"\u003e \u003cimg alt=\"Tavily\" src=\"https://img.shields.io/badge/-Tavily-231F20?style=flat\u0026logo=Tavily\u0026logoColor=white\"\u003e \u003cimg alt=\"MongoDB\" src=\"https://img.shields.io/badge/MongoDB-%234ea94b.svg?style=flat\u0026logo=mongodb\u0026logoColor=white\"\u003e\u003cimg alt=\"Tavily\" src=\"https://img.shields.io/badge/-Groq-231F20?style=flat\u0026logo=Groq\u0026logoColor=white\"\u003e\u003cimg alt=\"FastAPI\" src=\"https://img.shields.io/badge/-Fastapi-009688?style=flat\u0026logo=Fastapi\u0026logoColor=white\"\u003e \u003cimg alt=\"Kafka\" src=\"https://img.shields.io/badge/-Kafka-231F20?style=flat\u0026logo=kafka\u0026logoColor=white\"\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\nAI-powered shopping assistant platform for real-time product search with contextual question-answering and personalized product recommendations empowered by the intelligent search and analyst agent:\n\u003c/p\u003e\n\u003cbr\u003e\n\n![image](https://github.com/user-attachments/assets/3d2d0ca7-cfa9-4fec-8b2c-c802e5134411)\n\n\n## 📌 Overview\n\nPickSmart is a distributed and AI-powered product discovery platform that leverages the large language model and distributed system to provide real-time product search, contextual question-answering, and personalized product recommendations. The system integrates a Retrieval-Augmented Generation (RAG) architecture with a search agent (Hybrid RAG) for product discovery across multiple e-commerce marketplaces.\n\n\n## 🚀 Features\n|   Name  | Description |\n|-------|-------------|\n| **Ask a question about a product** | Submit a query to get detailed information, including specifications, pricing, and availability. |\n| **Search multiple marketplaces and rank the results**| The system aggregates product listings from various online marketplaces, compares and ranks them based on relevance, price, and customer reviews. |\n| **Receive personalized recommendations** |  Get AI-driven suggestions tailored to users' preferences, helping users make informed decisions. |\n\n## ⚡Core Capabilities\n|  Function | Description |\n|-----------|-------------|\n|**Natural Language Query Processing** | Advanced query decomposition and semantic analysis\n| **Vector Database Integration** | Efficient data ingestion and storage for embedding-based semantic retrieval.\n| **Distributed Real-time Search** | Multi-marketplace product discovery with parallel processing\n| **Intelligent Product Ranking** | AI-powered relevance scoring and personalization\n| **Context-Aware Recommendations** | Detailed answers with product suggestions\n| **Scalable Data Processing** | Event-driven architecture for high-throughput data handling\n\n\n## 🎥 Demo\n\n\nhttps://github.com/user-attachments/assets/47f57b9d-7c8b-4d37-8943-06d1eba58961\n\n\n\n## 🛠️ Tech Stack\n- **Frontend**: React\n- **Backend**: FastAPI\n- **Streaming**: Kafka\n- **RAG System**: LangChain, MongoDB (vector store)\n- **Agents**: LangGraph, Tavily (search)\n- **API Client**: Groq API\n\n\n## 📐System Architecture\n\n\u003cdiv align=\"center\"\u003e\n   \u003cimg src=\"https://github.com/user-attachments/assets/1bf2a44d-06b2-4599-8b1e-9403e0684424\"\u003e\n\u003c/div\u003e\n\n### Frontend Layer\n- **Framework**: React.js with TypeScript\n- **State Management**: Redux for predictable state container\n- **API Integration**: Axios for HTTP client\n\n### Backend Services\n- **API Framework**: FastAPI with asynchronous request handling and high-performance routing\n- **Message Broker**: Apache Kafka for event streaming and distributed processing\n- **Vector Store**: MongoDB for efficient similarity search and embedding storage\n- **Search Engine**: Tavily API integration for real-time and accurate web search capabilities\n\n### AI Components\n- **LLM Integration**: Groq API for high-performance inference\n- **Agent Framework**: LangChain for composable AI components\n- **Workflow Orchestration**: LangGraph for agent coordination and planning\n- **RAG System**: MongoDB for vector index implementation and semantic retrieval\n\n### Agent Workflow\n\nThe system implements a search and analyst agent with a multi-step workflow using LangGraph for orchestration:\n\n```python\ngraph = StateGraph(SearchAgentState)\ngraph.add_node(\"analyze_query\", self.analyze_query_node)\ngraph.add_node(\"search_online_shop\", self.search_online_node)\ngraph.add_node(\"analyze_and_rank\", self.analyze_rank_node)\ngraph.add_node(\"search_product_source\", self.search_source_node)\ngraph.set_entry_point(\"analyze_query\")\ngraph.add_edge(\"analyze_query\", \"search_online_shop\")\ngraph.add_edge(\"search_online_shop\", \"analyze_and_rank\")\ngraph.add_edge(\"analyze_and_rank\", \"search_product_source\")\ngraph.set_finish_point(\"analyze_and_rank\")\nself.graph = graph.compile(checkpointer=checkpointer)\n```\n\nThe search and analyst agent progresses through the following sequential states:\n\n| State | Name | Description |\n|:-----:|-------|-------------|\n|   1   | 🔍 **Query Analysis State** | Analyzes and decomposes the user query before identifying search intent and extracts key product attributes, serving as the entry point for all search requests |\n|   2   | 🛒 **Online Shop Search State** | Performs search across multiple online websites, retrieves initial product information from available sources, and gathers raw product data for further analysis |\n|   3   | ⭐ **Analysis and Ranking State** | Evaluates and ranks products using multiple criteria, prioritizing results based on relevance and quality to deliver the most appropriate options to users |\n|   4   | 🔗 **Product Source Search State** | Extends search to discover additional product sources across e-commerce platforms, provides a direct purchasing link, and validates product availability |\n\nThe workflow follows a linear progression through these states, from which each state is built upon the results of the previous states.\n\n## 📂 Folder Structure\n\nThis project contains a chatbot application with a backend server, Kafka integration, and a frontend interface.\n\n```bash\nchatbot-app  \n├── public              # Static assets for the frontend  \n├── src                 # Source code for the frontend  \n├── .gitignore          # Git ignore file for frontend  \n├── Dockerfile          # Dockerfile for frontend containerization  \n├── package-lock.json   # Dependency lock file  \n├── package.json        # Node.js project configuration  \n\nchatbot-server  \n├── src                 # Source code for the backend  \n│   ├── agent           # AI agent-related logic  \n│   ├── constants       # Configuration and constant values  \n│   ├── data            # Data handling and storage logic  \n│   ├── processor       # Data processing and transformation logic  \n│   ├── service         # Business logic and service layer  \n│   ├── utils           # Utility functions and helpers  \n│   ├── chatbot.py      # Main chatbot logic  \n│   ├── main.py         # Entry point for the backend server  \n├── .gitignore          # Git ignore file for backend  \n├── Dockerfile          # Dockerfile for backend containerization  \n├── __init__.py         # Marks the package directory  \n├── model.yaml          # AI model configuration file  \n├── requirements.txt    # Python dependencies  \n\nkafka  \n├── config              # Kafka configuration files  \n├── Dockerfile          # Dockerfile for Kafka setup  \n├── .gitignore          # Git ignore file for Kafka  \n\nLICENSE                 # Project license file  \n\n```\n   \n## ⚙️ Configuration\n\n### Environment Variables\nCreate ```.env``` file under ```chatbot-server``` folder and add API keys and MongoDB configuration as below:\n\n```env\nGROQ_API_KEY=\"\u003cAPI_KEY\u003e\"\nTAVILY_API_KEY=\"\u003cAPI_KEY\u003e\"\nCO_API_KEY=\"\u003cAPI_KEY\u003e\"\nMONGO_USER_NAME=\"\u003cUSERNAME\u003e\"\nMONGO_PASSWORD=\"\u003cPASSWORD\u003e\"\nMONGO_CLUSTER=\"picksmart-cluster\"\nMONGO_DATABASE=\"picksmart\"\n```\n- To get Groq api key: https://console.groq.com/keys\n- To get Tavily api key: https://tavily.com/\n- To get Cohere api key: https://dashboard.cohere.com/\n- To set up MongoDB: https://www.mongodb.com/\n\n### Model Configuration\n\nConfigure the LLM model in ```model.yaml``` file:\n```yaml\nLLM: \u003cLLM_MODEL\u003e\n```\n\n## 🚢 Deployment\n\n### Docker Deployment\nThe application supports containerized deployment using Docker and Docker Compose for simplified orchestration.\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/phrugsa-limbunlom/PickSmart.git\ncd PickSmart\n```\n\n2. Create the network:\n```bash\ndocker network create chatbot-network\n```\n\n3. Deploy services:\n```bash\ndocker-compose up --build\n```\n\nThe application will be accessible at `localhost:3000`.\n\n### Manual Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/phrugsa-limbunlom/PickSmart.git\ncd PickSmart\n```\n\n2. Install backend dependencies:\n```bash\npip install -r /chatbot-server/requirements.txt\n```\n\n3. Install frontend dependencies:\n```bash\ncd chatbot-app\nnpm install\n```\n\n4. Initialize Kafka services\n\n5. Launch backend server:\n```bash\nuvicorn main:app --reload\n```\n\n6. Start frontend application:\n```bash\nnpm start\n```\n\n## 💻 System Requirements\n- Python 3.8+\n- Node.js 14+\n- Docker 20.10+\n- Docker Compose 2.0+\n- 8GB RAM minimum\n- 4 CPU cores recommended\n\n## 📜 License\nPickSmart is released under the MIT License. See the [LICENSE](https://github.com/phrugsa-limbunlom/PickSmart/blob/main/LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrugsa-limbunlom%2Fpicksmart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphrugsa-limbunlom%2Fpicksmart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrugsa-limbunlom%2Fpicksmart/lists"}