An advanced, stateful artificial intelligence agent designed to automate and enhance the IT recruitment process. The system is built on a decoupled Model Context Protocol (MCP) architecture, combining LangGraph state machine routing, LangChain, and FAISS RAG capabilities to screen and compare resumes.
The assistant connects to multiple MCP servers concurrently to handle local document extraction, semantic searches, live web searches, and salary benchmarking.
The client application (matching_agent.py) acts as the MCP host. On startup, it launches and connects to two local MCP servers over standard input/output (StdIO) transport, dynamically aggregates their tools, and binds them to the OpenRouter LLM.
graph TD
User([User CLI]) <--> Agent[matching_agent.py Client]
Agent <--> LLM[OpenRouter LLM GPT-4o-mini]
subgraph MCP Server Infrastructure
Agent <-->|JSON-RPC 2.0 / StdIO| FS_MCP[filesystem_mcp_server.py]
Agent <-->|JSON-RPC 2.0 / StdIO| Ext_MCP[external_services_mcp_server.py]
end
subgraph RAG & Filesystem
FS_MCP -->|Reads| PDF_Dir[data/resumes/*.pdf]
FS_MCP -->|Embeds| HF[HuggingFace Embeddings]
FS_MCP -->|Indexes| FAISS_DB[(FAISS Vector Store)]
end
subgraph External APIs & Services
Ext_MCP -->|Scrapes| DDG[DuckDuckGo Lite Web Search]
Ext_MCP -->|Matches| DB[(IT Salary Benchmark DB)]
end
- Vector Search & Ingestion: Dynamically loads, chunks, and embeds local PDF resumes on startup using Hugging Face's
all-MiniLM-L6-v2model and FAISS. - Requirements Extraction: Extracts structured
must_haveandnice_to_haveskills from raw job descriptions. - Deep Candidate Comparison: Performs detailed head-to-head analysis of shortlisted candidates based on their resumes.
- Interview Preparation: Identifies resume gaps and dynamically generates target screening questions.
- Directory Monitoring (
watch_directory): Runs an async polling task that monitors for new PDF resume additions to auto-ingest and update the vector store index. - Batch Ingestion (
batch_process): Handlers multiple PDF files efficiently in a single transactional vector update.
- Live Web Search: Queries DuckDuckGo Lite dynamically for IT and networking market trends, with a built-in offline fail-safe fallback to handle rate-limiting.
- Salary Benchmarks: Resolves salary ranges (Junior, Mid, Senior) and recommended certifications for IT and networking roles.
- Stateful Memory: Maintains conversational context across turns using a LangGraph
MemorySavercheckpointer. - Dynamic Binding: Automatically discovers tools from connected MCP servers and binds them, decoupling tool logic from the agent execution layer.
- Python 3.9 or higher
- An OpenRouter API Key
- A folder containing PDF resumes inside
data/resumes/
-
Clone the repository and enter the directory:
git clone <your-repository-url> cd <repository-directory>
-
Install dependencies:
pip install -r requirements.txt pip install mcp mcp[cli] duckduckgo-search beautifulsoup4
-
Configure environment variables: Create a
.envfile in the root directory and add your API credentials:OPENROUTER_API_KEY=your_openrouter_api_key_here OPENROUTER_MODEL=openai/gpt-4o-mini
-
Verify Candidate Data: Ensure your PDF resumes are placed inside
data/resumes/. The filesystem server will automatically index them on boot.
Validate the entire Multi-MCP client-server architecture, tool discovery, resource querying, and fallback search flows:
python test_mcp_flow.pyRun the main agent application to start an interactive terminal session:
python matching_agent.py- Search:
"Find candidate resumes matching CCNA/Active Directory and Group Policy." - Salary Check:
"What is the standard salary range for a mid-level Systems Administrator?" - Live Search:
"What are the latest CCNP certification trends in 2026?" - Compare:
"Compare 10089434.pdf and 10247517.pdf side-by-side." - Screen:
"Generate interview questions for 10089434.pdf based on their gaps."