# Inquire: Multi-hop Wikipedia Research Agent Based on MCP and Prompt Engineering Practice

> Inquire is a multi-hop Wikipedia research agent implemented via the Model Context Protocol (MCP), demonstrating the complete iterative process from V1 draft to V2 production-level prompts, including prompt evaluation, error handling, and self-check mechanisms.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-05-15T23:15:22.000Z
- 最近活动: 2026-05-15T23:19:27.414Z
- 热度: 130.9
- 关键词: MCP, 多跳推理, 提示词工程, AI代理, 维基百科, 研究代理, 提示词评估
- 页面链接: https://www.zingnex.cn/en/forum/thread/inquire-mcp
- Canonical: https://www.zingnex.cn/forum/thread/inquire-mcp
- Markdown 来源: floors_fallback

---

## 【Main Floor/Introduction】Core Overview of the Inquire Project

Inquire is an open-source project developed by Jayant-Guru-Shrivastava, delivered as an assignment for Lesson 5 of the EAG V3 course. It is a multi-hop Wikipedia research agent based on the Model Context Protocol (MCP). Its core value lies in the complete documentation of the iterative process from V1 draft to V2 production-level prompts, including prompt evaluation, error handling, and self-check mechanisms, providing a reproducible practical example for prompt engineering.

## Project Background and Definition of Multi-hop Research Agent

### Project Background
Inquire is an assignment deliverable for Lesson 5 of the EAG V3 course, developed by Jayant-Guru-Shrivastava. It is positioned as a fully functional multi-hop reasoning AI research agent and also a practical example of prompt engineering iteration.

### Definition of Multi-hop Research Agent
A multi-hop research agent refers to an AI system that can answer complex questions requiring multi-step information retrieval and reasoning. For example, when answering the question "What is the capital of the country where the inventor of the World Wide Web was born?", the following reasoning chain is needed:
1. Search for "World Wide Web" to confirm the inventor Tim Berners-Lee;
2. Search for Tim Berners-Lee to get his birthplace as London, UK;
3. Search for the UK to confirm its capital is London;
4. Synthesize the information to give a cited answer.
This capability can handle complex queries that traditional single-turn Q&A cannot address.

## Technical Architecture and Prompt Evaluation Methods

### Technical Architecture (MCP Integration)
Inquire uses the MCP architecture to separate agent logic from tool execution. Its core components include:
- **talk2mcp.py (Agent Client)**: Contains V2 production-level system prompts, responsible for the JSON-format tool call loop, ensuring output quality via the final_ok gate;
- **mcp_server.py (FastMCP Server)**: Provides 5 Pydantic-validated tools (Wikipedia search, summary retrieval, arithmetic calculation, fact verification, etc.).
Architectural advantages: Tools return structured `{"ok": bool, "error": "..."}` responses, and prompts teach the agent to read errors and retry, improving system robustness and debuggability.

### Prompt Qualification Workflow
Candidate prompts are scored by a prompt evaluation assistant, covering 9 dimensions: explicit reasoning, structured output, tool separation, conversation loop, instruction framework, internal self-check, reasoning type awareness, fallback mechanism, and overall clarity.

## Iterative Process of Prompts from V1 to V2 (Evidence)

### Problems with V1 Version
V1 failed in the dimensions of internal self-check and fallback mechanism:
1. It did not require the agent to perform a rationality check on conclusions;
2. It did not define response strategies for scenarios like no search results or verification failures.

### Improvements in V2 Version
- **Enhanced Internal Self-check**: Added a "self-check before final answer" module, requiring confirmation that all facts come from Wikipedia summaries in the current session and that key facts are verified as supports="yes" via verify_claim;
- **Improved Error Handling**: Established a complete error handling table, defining clear retry strategies for failure modes such as no search results, 404 summaries, failed verification, calculation errors, etc.

### Iteration Results
V2 passed all 8 boolean metrics and became a production-level prompt.

## Application Value and Practical Insights

### Application Value
Inquire provides a practical template for building reliable multi-hop research agents. Its prompt engineering methodology (structured evaluation → targeted improvement → iterative verification) can be applied to the development of various complex AI systems. The project provides an `evaluate_prompt.py` script to ensure the reproducibility of the evaluation process.

### Practical Insights
Key Best Practices:
1. Use the MCP architecture to separate concerns;
2. Implement robust error handling via structured error responses;
3. Introduce explicit self-check gates to ensure output quality.
