Rag chatbot with a localhost MCP server

Rag chatbot with a localhost MCP server

Okay, here's a translation of "Building an Rag-based HR chatbot for providing rules in workplace with MCP server" into Chinese, along with some considerations for clarity and nuance: **Option 1 (More Literal):** * **中文:** 构建一个基于RAG的HR聊天机器人,用于提供工作场所规则,使用MCP服务器。 * **Pinyin:** Gòujiàn yī gè jīyú RAG de HR liáotiān jīqìrén, yòngyú tígōng gōngzuò chǎngsuǒ guīzé, shǐyòng MCP fúwùqì. **Option 2 (Slightly More Natural, Emphasizing Purpose):** * **中文:** 创建一个基于RAG的HR聊天机器人,旨在利用MCP服务器提供工作场所的规章制度。 * **Pinyin:** Chuàngjiàn yī gè jīyú RAG de HR liáotiān jīqìrén, zhǐzài lìyòng MCP fúwùqì tígōng gōngzuò chǎngsuǒ de guīzhāng zhìdù. **Option 3 (More Detailed, Specifying "Retrieval-Augmented Generation"):** * **中文:** 开发一个基于检索增强生成 (RAG) 技术的HR聊天机器人,它将使用MCP服务器来提供公司内部的工作场所规章制度。 * **Pinyin:** Kāifā yī gè jīyú jiǎnsuǒ zēngqiáng shēngchéng (RAG) jìshù de HR liáotiān jīqìrén, tā jiāng shǐyòng MCP fúwùqì lái tígōng gōngsī nèibù de gōngzuò chǎngsuǒ guīzhāng zhìdù. **Explanation of Choices and Considerations:** * **RAG:** Keeping "RAG" as is is common in technical contexts, especially if the audience is familiar with the term. Option 3 explains it in full as "检索增强生成 (jiǎnsuǒ zēngqiáng shēngchéng)," which translates to "Retrieval-Augmented Generation." * **HR Chatbot:** "HR 聊天机器人 (HR liáotiān jīqìrén)" is a direct and understandable translation. * **Workplace Rules:** "工作场所规则 (gōngzuò chǎngsuǒ guīzé)" is a general term. "规章制度 (guīzhāng zhìdù)" is a more formal term for rules and regulations. "公司内部的工作场所规章制度 (gōngsī nèibù de gōngzuò chǎngsuǒ guīzhāng zhìdù)" is the most specific, meaning "internal company workplace rules and regulations." * **MCP Server:** Assuming "MCP" is an acronym that's not commonly translated, it's best to leave it as is. If it *is* an acronym that has a standard Chinese translation within your company or industry, use that translation instead. * **"Building" vs. "Creating" vs. "Developing":** "构建 (gòujiàn)," "创建 (chuàngjiàn)," and "开发 (kāifā)" are all reasonable translations of "building." "构建" is more like "constructing," "创建" is more like "creating," and "开发" is more like "developing." The best choice depends on the specific context. * **"For providing" vs. "Aimed at providing":** The phrases "用于提供 (yòngyú tígōng)" and "旨在利用...提供 (zhǐzài lìyòng...tígōng)" both work. The second option emphasizes the *purpose* of the chatbot. * **Clarity:** Option 3 is the most explicit, which is helpful if you need to be very clear about what you're doing. **Recommendation:** The best option depends on your audience and the level of detail required. * For a general audience familiar with technical terms: **Option 1** is a good starting point. * For a slightly more formal or detailed description: **Option 2** is a good choice. * For a technical audience or when you need to be very precise: **Option 3** is the most comprehensive. Remember to consider the specific context and your target audience when making your final decision. If you can provide more context about the project and the intended audience, I can refine the translation further.

ImVirtue

研究与数据
访问服务器

README

基于 RAG 的聊天机器人,使用本地 MCP 服务器

构建一个基于 RAG 的 HR 聊天机器人,用于提供工作场所规则,并使用本地 MCP 服务器作为函数调用中心。 <img src="images/rag.jpg" width="500"> <img src="images/mcp-architecture.png" width="500">

概述

本项目实现了一个使用 Streamlit 和 MCP 服务器的检索增强生成 (RAG) 聊天机器人。用户可以上传 PDF 文件,聊天机器人从 PDF 文件中检索相关信息,以回答自然语言问题。该系统利用 OpenAI 模型、LangChain 实用程序和一个内存向量存储,以实现高效的文档检索。

特性

  • MCP 工具集成: 通过 MCP 进行工具编排,确保文档索引、检索和答案生成之间的顺畅通信。随着新功能的添加,后端工具可以轻松扩展或替换。

  • PDF 上传和解析: 上传 PDF 文件,然后使用 PDFPlumberLoader 进行解析,以提取文本内容。

  • 文本分块: 提取的文本使用 RecursiveCharacterTextSplitter 分割成更小的块,以方便高效的索引和检索。

  • 文档索引: 块被索引到内存向量存储中,并通过 OpenAIEmbeddings 生成嵌入。

  • 相似度搜索(余弦相似度): 当用户提交查询时,聊天机器人会执行相似度搜索,以根据查询检索最相关的文档块。

  • 基于提示的答案生成: 自定义提示模板将用户问题与检索到的上下文相结合,并由 GPT-4 驱动的 LLM(使用 ChatOpenAI)生成最终答案。

  • 交互式界面: 该应用程序使用 Streamlit 提供一个交互式的、类似聊天的界面,用户问题和机器人响应都会显示在该界面中。

结果

<img src="images/HRwithMCP.png" width="700">

推荐服务器

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

一个模型上下文协议 (MCP) 服务器,它使用 CoinCap API 提供全面的加密货币分析。该服务器通过一个易于使用的界面提供实时价格数据、市场分析和历史趋势。 (Alternative, slightly more formal and technical translation): 一个模型上下文协议 (MCP) 服务器,利用 CoinCap API 提供全面的加密货币分析服务。该服务器通过用户友好的界面,提供实时价格数据、市场分析以及历史趋势数据。

精选
TypeScript
MCP PubMed Search

MCP PubMed Search

用于搜索 PubMed 的服务器(PubMed 是一个免费的在线数据库,用户可以在其中搜索生物医学和生命科学文献)。 我是在 MCP 发布当天创建的,但当时正在度假。 我看到有人在您的数据库中发布了类似的服务器,但还是决定发布我的服务器。

精选
Python
mixpanel

mixpanel

连接到您的 Mixpanel 数据。 从 Mixpanel 分析查询事件、留存和漏斗数据。

精选
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Nefino MCP Server

Nefino MCP Server

为大型语言模型提供访问德国可再生能源项目新闻和信息的能力,允许按地点、主题(太阳能、风能、氢能)和日期范围进行筛选。

官方
Python
Vectorize

Vectorize

将 MCP 服务器向量化以实现高级检索、私有深度研究、Anything-to-Markdown 文件提取和文本分块。

官方
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

一个服务器,通过 FastMCP 提供对 Mathematica 文档的访问,使用户能够从 Wolfram Mathematica 检索函数文档和列出软件包符号。

本地
Python
kb-mcp-server

kb-mcp-server

一个 MCP 服务器,旨在实现便携性、本地化、简易性和便利性,以支持对 txtai “all in one” 嵌入数据库进行基于语义/图的检索。任何 tar.gz 格式的 txtai 嵌入数据库都可以被加载。

本地
Python
Research MCP Server

Research MCP Server

这个服务器用作 MCP 服务器,与 Notion 交互以检索和创建调查数据,并与 Claude Desktop Client 集成以进行和审查调查。

本地
Python
Cryo MCP Server

Cryo MCP Server

一个API服务器,实现了模型补全协议(MCP),用于Cryo区块链数据提取,允许用户通过任何兼容MCP的客户端查询以太坊区块链数据。

本地
Python