Skip to main content

A RAG-based HR chatbot with MCP server for document retrieval and email functionality

Project description

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_imvirtue_ragchatbot_mcpserver-0.1.0.tar.gz.

File metadata

File hashes

Hashes for iflow_mcp_imvirtue_ragchatbot_mcpserver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c76351669efdca219c74a836f49e98a7b6976fc312917fb51c2e4c4bdcf29e8
MD5 14e38c599a1fe5751f1cd45c25355668
BLAKE2b-256 b670e8219e2c8d353eb4c8793c30909db502836ce138c3f5e2f3ceaca349e43a

See more details on using hashes here.

File details

Details for the file iflow_mcp_imvirtue_ragchatbot_mcpserver-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for iflow_mcp_imvirtue_ragchatbot_mcpserver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec688ddf3164dc6e0fbe56c4378b97d1fd8f4b91309cbdcef1bab9379aa65647
MD5 b24095e384466dda63e0b7126f3d3275
BLAKE2b-256 bdfa9977d93f02736532dcbe0f3e98c731c91a3dad85707483f81a6512b1a0e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page