MCP-Based Enterprise Knowledge Search Assistant
MCP-Based Enterprise Knowledge Search Assistant
This repository contains a proof-of-concept implementation of an enterprise knowledge assistant that compares a traditional RAG-style experience with an MCP-driven retrieval flow.
Architecture
Frontend: Claude Desktop style chat experience
Backend: FastAPI + Python 3.12
Retrieval: Elasticsearch-style hybrid search abstraction with BM25 + dense vector similarity
LLM: Ollama with gemma3:latest
MCP: Custom Python MCP-style tool server exposing domain-specific retrieval tools
Key features
Question routing to the correct MCP tool
Hybrid retrieval with ranked chunks and source citations
Ollama integration for answer generation
Evaluation metrics logging to JSON
Docker Compose support for local development
Running locally
Install dependencies:
pip install -e .
Start Ollama and ensure
gemma3:latestis available.Start the API:
uvicorn app.core.app:app --reload
Call the chat endpoint:
POST /chatwith{ "question": "What is the maternity leave policy?" }
Sample questions
What is the maternity leave policy?
How do I submit a travel reimbursement request?
What are the annual appraisal guidelines?
What should I do for a security incident?
Evaluation
Run the evaluation helper to write a metrics record:
from app.services.evaluation import EvaluationService
service = EvaluationService()
print(service.compare("What is the maternity leave policy?"))