Skip to content

Shenguo1/ShopAgents

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛍️ 智能电商导购系统

一个融合 AI Agent、评分预测模型与推荐引擎的电商演示平台,展示现代化智能导购的完整链路。

📸 功能展示

首页

首页

电商首页展示商品分类、热销排行、新品推荐等多维度内容,为用户提供丰富的浏览体验。

Agent 对话框

Agent 对话框

智能导购 Agent 支持自然语言交互,理解用户需求并实时响应,提供个性化的商品推荐建议。

Agent 推荐结果

推荐结果

基于用户对话意图,系统综合评分预测模型与推荐策略,生成精准的商品推荐列表及详细解释。


🏗️ 技术栈

层级 技术
前端 HTML5 + CSS3 + JavaScript (原生) + localStorage
后端 Spring Boot 3.3.5 + Java 17
模型服务 FastAPI + Python 3.12 + Pydantic
推荐引擎 评分预测模型 + 策略候选 + 并集聚合
Agent 能力 DeepSeek LLM + 工具调度 + 对话编排
数据存储 JSON 数据源 + 事件日志

📁 项目结构

shopping_website/
├── index.html                          # 首页
├── goods_classification.html           # 分类页
├── product1_detail.html                # 商品详情页
├── cart.html                           # 购物车
├── agent_recommend.html                # Agent 对话页面
│
├── JavaScript/                         # 前端逻辑
│   ├── index.js                        # 首页交互
│   ├── goods_classification.fix.js     # 分类页逻辑
│   └── ...
│
├── CSS/                                # 样式表
│   ├── index.css
│   ├── agent_recommend.css
│   └── ...
│
├── src/                                # 前端模块化代码
│   ├── core/                           # 核心库 (API、存储、事件)
│   ├── modules/                        # 业务模块 (购物车、推荐、认证)
│   └── pages/                          # 页面逻辑
│
├── backend/                            # Spring Boot 推荐中台
│   ├── src/main/java/com/shopping/reco/
│   │   ├── api/controller/             # REST 接口
│   │   ├── service/                    # 业务服务
│   │   │   ├── ProductCatalogService   # 商品目录
│   │   │   ├── RatingModelService      # 模型调用
│   │   │   ├── StrategyCandidateService # 策略候选
│   │   │   ├── UnionComposerService    # 结果聚合
│   │   │   ├── DeepSeekAgentService    # Agent 编排
│   │   │   └── ...
│   │   └── domain/                     # 数据模型
│   └── pom.xml
│
├── model_service/                      # FastAPI 评分预测服务
│   ├── app/main.py                     # 模型推理接口
│   └── requirements.txt
│
├── data/                               # 数据文件
│   ├── products.json                   # 商品目录
│   ├── goods_in_cart.json              # 购物车数据
│   └── ...
│
├── scripts/                            # 启动脚本
│   ├── setup-model-python.ps1          # 模型环境初始化
│   ├── run-model.ps1                   # 启动模型服务
│   ├── run-backend.ps1                 # 启动后端
│   └── use-java17.ps1                  # 配置 Java 17
│
└── assets/                             # 演示截图
    ├── first_page.png
    ├── Agent_talk.png
    └── Agent_Recommend.png

🚀 快速启动

前置要求

  • Windows 系统 (PowerShell 5+)
  • 网络连接(用于 DeepSeek API 调用)

1️⃣ 启动模型服务

cd [Your Path]\shopping_website
.\scripts\setup-model-python.ps1
.\scripts\run-model.ps1

模型服务地址:http://127.0.0.1:18082

2️⃣ 启动后端

cd [Your Path]\shopping_website
powershell -ExecutionPolicy Bypass -File .\scripts\use-java17.ps1
powershell -ExecutionPolicy Bypass -File .\scripts\run-backend.ps1

后端服务地址:http://127.0.0.1:18081

3️⃣ 启动前端

cd [Your Path]\shopping_website
node -e "const http=require('http'),fs=require('fs'),path=require('path');const root=process.cwd();const m={'.html':'text/html; charset=utf-8','.js':'text/javascript; charset=utf-8','.css':'text/css; charset=utf-8','.json':'application/json; charset=utf-8','.png':'image/png','.jpg':'image/jpeg','.jpeg':'image/jpeg','.gif':'image/gif','.svg':'image/svg+xml','.ico':'image/x-icon','.webp':'image/webp'};http.createServer((req,res)=>{let u=decodeURIComponent((req.url||'/').split('?')[0]);if(u==='/')u='/index.html';const f=path.join(root,u);if(!f.startsWith(root)){res.writeHead(403);return res.end('Forbidden')}fs.stat(f,(e,s)=>{let p=f;if(!e&&s.isDirectory())p=path.join(f,'index.html');fs.readFile(p,(err,d)=>{if(err){res.writeHead(404);return res.end('Not Found')}res.setHeader('Access-Control-Allow-Origin','*');res.setHeader('Content-Type',m[path.extname(p).toLowerCase()]||'application/octet-stream');res.end(d)});});}).listen(5500,'127.0.0.1',()=>console.log('Static server: http://127.0.0.1:5500'));"

前端访问地址:http://127.0.0.1:5500


💡 核心特性

智能导购 Agent
基于 DeepSeek LLM,支持自然语言理解与多轮对话,为用户提供个性化推荐。

🎯 评分预测模型
FastAPI 模型服务,实时预测用户对商品的评分,驱动精准推荐。

🔄 推荐引擎
融合策略候选、模型评分、并集聚合,支持页面推荐与对话推荐两大链路。

📊 事件追踪
完整的用户行为记录与推荐日志,支持后续数据分析与模型优化。


📝 总结

本项目展示了一个完整可运行的智能电商导购系统,融合了电商场景、AI Agent 对话、评分预测模型与推荐引擎。通过前后端分离、模型服务独立部署的架构,实现了高效的智能推荐链路。系统既支持传统页面推荐的低时延需求,也支持对话式导购的高智能需求,是电商 AI 应用的典型演示。

About

An intelligent shopping website that combines a multi-agent framework with personalized recommendation, interactive assistance, and product exploration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 91.2%
  • JavaScript 2.8%
  • TSQL 1.9%
  • HTML 1.4%
  • CSS 1.3%
  • PowerShell 0.6%
  • Other 0.8%