{"id":27111919,"url":"https://github.com/dhanashripatil11/retail-multiagent","last_synced_at":"2025-04-09T22:06:02.924Z","repository":{"id":286430919,"uuid":"961383593","full_name":"DhanashriPatil11/retail-multiagent","owner":"DhanashriPatil11","description":"A collaborative multi-agent system powered by local LLMs (Ollama) for real-time retail inventory optimization and demand-supply balancing.","archived":false,"fork":false,"pushed_at":"2025-04-06T12:24:21.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T22:05:58.507Z","etag":null,"topics":["ai","aiagentsframework","ml","multiagents","ollama","pandas-python","python","retailinventory"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DhanashriPatil11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-04-06T12:04:55.000Z","updated_at":"2025-04-06T12:28:19.000Z","dependencies_parsed_at":"2025-04-06T13:32:54.485Z","dependency_job_id":null,"html_url":"https://github.com/DhanashriPatil11/retail-multiagent","commit_stats":null,"previous_names":["dhanashripatil11/retail-multiagent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DhanashriPatil11%2Fretail-multiagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DhanashriPatil11%2Fretail-multiagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DhanashriPatil11%2Fretail-multiagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DhanashriPatil11%2Fretail-multiagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DhanashriPatil11","download_url":"https://codeload.github.com/DhanashriPatil11/retail-multiagent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119296,"owners_count":21050755,"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":["ai","aiagentsframework","ml","multiagents","ollama","pandas-python","python","retailinventory"],"created_at":"2025-04-07T01:25:18.963Z","updated_at":"2025-04-09T22:06:02.905Z","avatar_url":"https://github.com/DhanashriPatil11.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Agent Retail Inventory Optimization System\n\n\n## 📌 Project Overview\nThis project leverages a multi-agent architecture integrated with local LLMs (Ollama) to optimize retail inventory management. Three autonomous agents—**StoreAgent**, **WarehouseAgent**, and **SupplierAgent**—collaborate to:\n\n- Monitor sales trends and inventory levels\n- Forecast demand and suggest pricing strategies\n- Automate decision-making for reordering and supplier communication\n\nThe agents use structured data and dynamic prompts to interact with a locally hosted LLM (`phi` via Ollama) for context-aware retail decisions.\n\n---\n\n## ⚙️ Setup Instructions\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/your-username/multi-agent-inventory.git\ncd multi-agent-inventory\n```\n\n### 2. Create a Virtual Environment (Optional but Recommended)\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n### 3. Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\n### 4. Download Ollama and Run the Model\n- Install [Ollama](https://ollama.com/)\n- Pull the Phi model:\n```bash\nollama run phi\n```\n- Keep Ollama running locally at `http://localhost:11434`\n\n---\n\n## 🚀 How to Run Agents\n\n### Main File\n```bash\npython agents/main.py\n```\n\n### Store Agent\n```bash\npython agents/store_agent.py\n```\n\n### Warehouse Agent\n```bash\npython agents/warehouse_agent.py\n```\n\n### Supplier Agent\n```bash\npython agents/supplier_agent.py\n```\n\nYou can simulate a particular day by modifying the `simulate_day(day_number)` function call.\n\n---\n\n## 🧠 Ollama Integration\nThe agents communicate with the local Ollama LLM via REST API. Each agent:\n\n- Extracts daily data from CSV files\n- Formats a natural language prompt\n- Sends the prompt to the Ollama server (`phi` model)\n- Parses the streaming NDJSON response for decision output\n\nExample API call:\n```python\nresponse = requests.post(\n    \"http://localhost:11434/api/generate\",\n    json={\"model\": \"phi\", \"prompt\": prompt},\n    stream=True\n)\n```\n\n---\n\n## 📊 Example Output\n```\n[StoreAgent] Day 1 Decision:\nBased on high sales volume and good customer reviews, consider a slight price increase and marketing promotion.\n\n[WarehouseAgent] Day 1 Decision:\nStock levels are low and close to the reorder point. Reorder today to avoid stockouts.\n\n[SupplierAgent] Day 1 Decision:\nPrepare a shipment based on historical lead times and warehouse capacity. Ensure timely dispatch.\n```\n\n---\n\n\n## 📬 Contact\n**Dhanashri Patil**  \n📧 ![Email](https://img.icons8.com/ios-filled/20/000000/email-open.png) patil.dhanashrik@gmail.com  \n🐙 ![GitHub](https://img.icons8.com/ios-glyphs/20/000000/github.png) [DhanashriPatil11](https://github.com/DhanashriPatil11)  \n🔗 ![LinkedIn](https://img.icons8.com/ios-filled/20/000000/linkedin.png) [dhanashri-patil24](https://www.linkedin.com/in/dhanashri-patil24/)\n\n---\n\n\u003e This project was built as part of the Hackathon challenge: **Optimizing Retail Inventory with Multi Agents** 💡\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhanashripatil11%2Fretail-multiagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhanashripatil11%2Fretail-multiagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhanashripatil11%2Fretail-multiagent/lists"}