ecommerce-retail-rag-mcp
E-commerce Retail RAG + MCP 고객 서비스 시스템
전자상거래/소매 시나리오를 위한 다중 소스 검색 증강 생성(RAG) 고객 서비스 시스템입니다. Google ADK로 Agent를 오케스트레이션하고, 상품 카탈로그와 반품/배송 정책을 검색한 후 RRF(Reciprocal Rank Fusion) 다중 소스 융합 정렬을 거쳐, LLM이 출처가 포함된 컨텍스트를 기반으로 신뢰할 수 있는 답변을 생성하도록 하여 환각을 방지합니다.
✨ 핵심 기능
기능 | 설명 | 상태 |
다중 소스 RAG 검색 | 상품 카탈로그 + A/S 정책 이중 소스 검색, 단일 임베딩, 다중 소스 리콜 | ✅ 사용 가능 |
RRF 융합 정렬 | 데이터 규모 불균형 상황에서 '강한 소스가 약한 소스를 압도하는' 문제 해결 | ✅ 실험 검증 완료 |
엔드투엔드 Demo | Web 인터페이스: 사용자 질문 → 다중 소스 검색 → 인용 포함 답변 | ✅ 현장 실행 가능 |
MCP 도구 캡슐화 | product_search / policy_qa 등의 도구를 MCP로 노출 | ✅ 구현 완료 |
임베딩 일관성 가드 |
| ✅ 내장 완료 |
Related MCP server: ecommerce-catalog-agent
📊 2차 개발 성과(이력서에 바로 작성 가능)
RRF 융합 비교 실험 — 동일한 12개 쿼리로 'RRF 융합'과 '직접 연결'의 리콜 효과를 비교:
지표 | 직접 연결 | RRF 융합 |
정책 관련 쿼리 Top-3 관련 적중률 | 9/12 | 12/12 |
약한 소스(정책) 고관련 문서 순위 | 상품 카탈로그에 묻힘 | 2위로 상승 |
결론: 상품 카탈로그(강한 소스)의 규모가 정책(약한 소스)보다 훨씬 클 때, 직접 연결하면 정책 문서가 완전히 묻힙니다. RRF 융합 후 관련 문서가 크게 상승합니다. 전체 분석은
docs/RRF对比实验报告.html참조.
트러블슈팅 기록(면접 가산점) → docs/RAG二开踩坑记录.html
🚀 빠른 시작 — 현장에서 Demo 실행
로컬 Ollama만 있으면 되며, 클라우드 API Key가 필요 없습니다. 5분이면 실행 가능합니다.
# 1. 启动 Ollama 并拉取所需模型(首次)
ollama serve &
ollama pull nomic-embed-text # 嵌入模型(768维)
ollama pull qwen2.5:3b # 生成模型
# 2. 安装 Python 依赖
pip install -r requirements.txt
# 3.(可选)如预计算嵌入缓存缺失则重建向量库
python scripts/_precompute_embeddings.py
# 4. 启动端到端 Web Demo
python scripts/demo_web.py
# 浏览器打开 http://127.0.0.1:8080시도해 볼 질문: do you refund damaged produce, free delivery over 35 dollars.
Demo의 검색은 사전 계산된 임베딩 캐시
embedding_index.json + embeddings_cache.npy(Ollama로 생성)에 의존하며, 메모리 내 코사인 검색 레이어가 내장되어 있어 ChromaDB를 별도로 실행할 필요가 없습니다. Windows에서 단일 머신 영속화의 함정을 피할 수 있습니다.
🧪 비교 실험 재현
python scripts/compare_rrf_vs_join.py💻 기술 스택
오케스트레이션: Google ADK(
FunctionTool+SequentialAgent)임베딩/생성: Ollama(
nomic-embed-text/qwen2.5:3b), 완전 로컬벡터 검색: 사전 계산된 임베딩 캐시 + NumPy 메모리 내 코사인 검색(기존 ChromaDB 어댑터 레이어 유지)
융합 정렬: 자체 개발 RRF(
agents/tools/rrf_fusion.py)서비스: FastAPI MCP server(
src/mcp_server)
📁 디렉터리 구조
scripts/
demo_web.py # 端到端 Web Demo(问→检→带出处答)
compare_rrf_vs_join.py # RRF vs 直接拼接对比实验
_precompute_embeddings.py # 预计算嵌入缓存
chat_rag_demo.py # 命令行 RAG Demo
src/
embeddings/ollama_client.py # embed_text + generate_answer
rag/
inmemory_cache.py # 内存余弦检索层(二开新增)
vector_store.py # ChromaDB 适配层(保留)
agents/
tools/rrf_fusion.py # RRF 融合算法(二开新增)
rag_agent.py # ADK RAG Agent
workflows.py # ADK 工作流
docs/
RRF对比实验报告.html # 二开:对比实验报告
RAG二开踩坑记录.html # 二开:踩坑技术博客
configs/ # 环境变量模板
tests/ # 含嵌入一致性守卫测试✅ 테스트
pytest tests/ # 单元测试 + 嵌入一致性守卫
bash scripts/checks.sh # 静态检查🌱 향후 방향
더 많은 검색 소스(리뷰, 재고)와 리랭킹 Reranker 연동
평가 파이프라인 추가(recall@k / groundedness)
MCP 도구의 RBAC / 속도 제한
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables hybrid search over policies using Reciprocal Rank Fusion and provides grounded, context-aware answers via a LangGraph agent with COSTAR prompting.3
- FlicenseNot gradedqualityCmaintenanceEnables conversational product search and validation for e-commerce catalogs, with hybrid retrieval and live price/stock checks from a database.
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to independently investigate and resolve e-commerce order issues, particularly refund processing, with tools for order search, refund eligibility checks, and safe refund execution.
- FlicenseAqualityBmaintenanceProvides e-commerce customer support tools for order status, delivery, account, and policy questions, with RAG-grounded retrieval and strict authorization checks over mock data.6
Related MCP Connectors
Policy review and purchase discovery for AI-agent commerce actions.
Agent-native product catalog for AI shopping agents. 296M+ products, 28 countries.
Search your knowledge bases from any AI assistant using hybrid RAG.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Vanity-1/ecommerce-retail-rag-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server