YP

yichunfu5-prog/langchain-rag-agent

Developer tools

This page was translated automatically. Technical details may differ from the original. View the original

23 stars 1 forks Quality 51 Trend 15

Zhijing Lingjing — An AI intelligent customer service system for sweeping/mopping robots based on LangChain RAG + MCP. Built a dual-page web application using Streamlit (user intelligent Q&A + merchant knowledge base management), using Qwen3-Max as the inference engine and ChromaDB as the vector database for semantic retrieval, and integrating Gaode Maps via MCP protocol to achieve IP positioning and weather perception.

Overview

This is an AI intelligent customer service system for the field of sweeping/mopping robots, offering a dual-page web application: - Semantic retrieval: Vector similarity-based knowledge base search, supporting maintenance, troubleshooting, purchasing guides, and frequently asked questions - Tool calls: LLM autonomously decides when to check the knowledge base and when to use the Gaode Map API to obtain location/weather - Session persistence: Conversation history is automatically saved to local JSON files without loss after refreshing - Deduplication and retrieval ingreduality: Deduplication based on MD5 content to avoid duplicate document fragments contaminating search results The following analysis follows the following principles, where each key decision includes: technologies used, reasons for selection, underlying principles, alternative comparisons, superiority analysis, and knowledge transfer paths. 📌 Designed a hybrid intelligent customer service system architecture combining Streamlit + LangChain Agent + RAG + MCP - LLM training data has deadlines and cannot cover the latest robot vacuum models and fault codes - User issues may involve real-time information (weather impact cleaning recommendations, region-based recommended purchase channels) - A single entry point is needed to handle multiple intents (product consultation / troubleshooting / weather correlation / purchase advice) - The team size is small and cannot develop routing logic separately for each intent - Agent mode allows LLMs to choose which tool to call without manually writing intent classifiers, naturally overriding long-tail problems - Tools can be local retrievers (RAG) or remote APIs (MCP), with unified interfaces for easy expansion - LangChain's create_agent() includes built-in ReAct loops (think → act→ observe → think again), handling multi-step reasoning LangChain create_agent() embeds this loop into agent.ainvoke(), so developers don't need to write the loop logic by hand. Every tool call in the LLM is a complete API request, so the token consumption in Agent mode = N times that of a normal conversation (N = number of tool calls + 1). Tools are the LLM's "hands." Each tool contains three elements: name, description (telling the LLM when to use it), and input schema (parameters). The LLM does not execute the tool but outputs a ToolCall message; The LangChain framework intercepts this message, executes the corresponding function, and then injects the result into the conversation context as a ToolMessage.

Overview (machine translated)

Powered by LangChain RAG + MCP + ChromaDB + Alibaba Bailian DashScope


📋 Table of Contents

  1. Project Overview
  2. In-depth analysis of technical architecture
  • STEP 1 — Overall architecture design
  • STEP 2 — RAG retrieval augmented generation
  • STEP 3 — LangChain Agent agent
  • STEP 4 — Integration of MCP model context protocols
  • STEP 5 — ChromaDB vector database
  • STEP 6 — Streamlit Web interface
  1. Project structure
  2. Start quickly
  3. Knowledge extension and learning paths

1. Project Overview

Zhijing Lingjing is an AI intelligent customer service system for the field of sweeping and mopping robots, offering a dual-page web application:

Page User Function
💬 Intelligent Customer Service End Consumers Natural language Q&A, geolocation awareness, weather-related suggestions
📚 Knowledge Base Management Merchant/Operations Upload documents, check incoming status, fully rebuild the knowledge base

Core Competencies:

  • Semantic Retrieval: Vector similarity-based knowledge base search, supporting maintenance, troubleshooting, buying guides, and frequently asked questions
  • Tool calls: LLMs autonomously decide when to check knowledge bases and when to use the Gaode Maps API to obtain location/weather
  • Session persistence: Conversation history is automatically saved to the local JSON file, refreshing without loss
  • Deduplication Binding: Deduplication based on MD5 content to avoid duplicate document fragments that pollute search results

2. In-depth analysis of technical architecture

The following analysis follows the deep-teach deep teaching model, where each key decision includes: technologies used, reasons for selection, underlying principles, comparison of alternatives, superiority analysis, and knowledge transfer paths.


🎯 STEP 1 Overall Architecture Design

📌 Operation: Design a hybrid intelligent customer service system architecture combining Streamlit + LangChain Agent + RAG + MCP


(1) 🛠️ Technology used

Attributes Content
Architecture Pattern Agent-Tool hybrid architecture (LLM as router, dynamic selection tool)
Category AI Application Architecture / Retrieval-Enhanced Generation / Agent Mode
Role Using LLMs as the central decision-making engine, orchestrating knowledge base retrieval and external API access through tool calling mechanisms

(2) 💡 Why Choose the Agent-Tool Hybrid Architecture

Project Constraints:

  • LLM training data has a deadline and cannot cover the latest robot vacuum models and fault codes
  • User issues may involve real-time information (weather affecting cleaning suggestions, region-based purchasing channels)
  • Requires a single entry point to handle multiple intentions (product consultation / troubleshooting / weather correlation / purchase advice)

This page was translated automatically. Technical details may differ from the original.

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →