mcpField
R
Rag chatbot with a localhost MCP server

Rag chatbot with a localhost MCP server

Local
github.com/ImVirtueAI & Agents7Updated 80w ago

About Rag chatbot with a localhost MCP server

A RAG-based HR chatbot that answers workplace-rules questions using uploaded PDFs. It combines document retrieval with a Streamlit chat interface and GPT-4 answer generation.

Key features

  1. 01Upload and parse PDFs
  2. 02Split text into chunks
  3. 03Index documents in memory
  4. 04Retrieve relevant passages by similarity
  5. 05Generate answers with GPT-4
  6. 06Streamlit chat interface

Use cases

  1. 01Ask questions about rules in uploaded workplace PDFs
  2. 02Retrieve relevant passages from indexed documents

MCP support

The localhost MCP server coordinates tools for document indexing, retrieval, and answer generation.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Rag chatbot with a localhost MCP server

Building a RAG-based HR chatbot for providing rules in the workplace with the localhost MCP server as a function-calling hub README image README image

Overview

This project implements a Retrieval-Augmented Generation (RAG) chatbot using Streamlit and the MCP server. Users can upload PDF files, and the chatbot retrieves relevant information from the PDFs to answer natural language questions. The system leverages OpenAI models, LangChain utilities, and an in-memory vector store for efficient document retrieval.

Features

  • MCP Tool Integration:
    Tool orchestration with MCP ensures smooth communication between document indexing, retrieval, and answer generation. The backend tools can be extended or replaced easily as new functionalities are added.

  • PDF Upload and Parsing:
    Upload a PDF file which is then parsed using PDFPlumberLoader to extract text content.

  • Text Chunking:
    The extracted text is split into smaller chunks using RecursiveCharacterTextSplitter to facilitate efficient indexing and retrieval.

  • Document Indexing:
    Chunks are indexed in an in-memory vector store with embeddings generated via OpenAIEmbeddings.

  • Similarity Search (Consine Similarity):
    When a user submits a query, the chatbot performs a similarity search to retrieve the most relevant document chunks based on the query.

  • Prompt-Based Answer Generation:
    A custom prompt template combines the user question with retrieved context, and a GPT-4 powered LLM (using ChatOpenAI) generates the final answer.

  • Interactive Interface:
    The application uses Streamlit to provide an interactive, chat-like interface where user questions and bot responses are displayed.

Result

README image

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.