## Technical Document: Prompt Template of Graph-RFT
### Overview
The image displays a technical document titled "Prompt Template of Graph-RFT." It is a text-based instructional template outlining a structured reasoning and retrieval process for an AI system. The template mandates a step-by-step reasoning approach based on Descartes' Principles, encapsulated within specific XML-like tags (`<think>`, `<plan>`, `</plan>`, `<relation_search>`, `</relation_search>`, `<relation_information>`, `</relation_information>`, `<web_search>`, `</web_search>`, `<neighbor_search>`, `</neighbor_search>`, `<neighbor_information>`, `</neighbor_information>`, `<web_information>`, `</web_information>`, `<answer>`, `</answer>`).
* **Defined Functions:**
* **Sub-problem Search Function:** `Ans=SearchKG ( t=target_type | h = topic_entity, r = relation_type of h and t)` and its sequential variant `Ans2=SearchKG ( t=target_type | h = Ans1, r = relation_type of h and t)`.
* **Sub-problem Logic Functions:** `Intersect (sub-problem1, sub-problem2...)`, `Union (sub-problem1, sub-problem2...)`, `Negation (sub-problem1, sub-problem2...)`.
### Detailed Analysis
The template prescribes a precise workflow:
**1. Reasoning & Planning Phase:**
* The system must first conduct reasoning inside `<think>` tags.
* Reasoning must follow Descartes' Principles, starting from basic, independent sub-problems.
* The solution to each sub-problem becomes the background for retrieving information for subsequent, more dependent sub-problems.
* After reasoning, a plan must be output inside `<plan>` and `</plan>` tags. This plan must encompass each step's problem and its associated logic function.
**2. Execution & Search Protocol:**
* The process begins with the first step of the plan.
* **KG Search Initiation:** If a step requires a `SearchKG()` call, the system must first call `<relation_search>h, r</relation_search>`.
* **Relation Selection:** This returns the top 15 relevant relations within `<relation_information>` and `</relation_information>` tags. The system must select the appropriate relation based on the sub-problem.
* **Fallback to Web Search (for relations):** If no relevant relation is found, the system can call `<web_search>h, r</web_search>`.
* **Neighbor Search:** After obtaining a relation, the system must call `<neighbor_search>h, r</neighbor_search>`. This searches for neighbors of the entity `h` with the specified relation `r` in the KG, returning results between `<neighbor_information>` and `</neighbor_information>`.
* **Fallback to Web Search (for neighbors):** If no neighbor information is found, the system can call `<web_search>h, r</web_search>`, which returns top search results between `<web_information>` and `</web_information>`.
**3. Answer Formulation:**
* The system can search based on the plan process.
* If no further external knowledge is needed, the final answer is provided directly inside `<answer>` and `</answer>` tags.
### Key Observations
* **Structured Dependency:** The template enforces a strict, sequential dependency where solved sub-problems inform the retrieval for unsolved ones.
* **Hybrid Search Strategy:** It integrates structured Knowledge Graph retrieval (`SearchKG`, `relation_search`, `neighbor_search`) with unstructured web search as a fallback mechanism.
* **Explicit Tagging:** Every phase of the process (thinking, planning, relation info, neighbor info, web info, final answer) is demarcated by specific XML-like tags, suggesting a system that parses these tags to structure its output.
* **Logic Operations:** The inclusion of `Intersect`, `Union`, and `Negation` functions indicates the system is designed to combine results from multiple sub-problems set-theoretically.
* **Error Handling:** The protocol includes clear fallback paths (`web_search`) when KG searches yield no results.
### Interpretation
This document is a meta-prompt or system prompt designed to govern the behavior of an AI model, likely a Large Language Model (LLM) integrated with a Knowledge Graph. Its purpose is to force the model to adopt a rigorous, transparent, and auditable reasoning process before attempting to retrieve information.
The "Graph-RFT" in the title likely stands for "Graph-based Reasoning and Fine-Tuning" or a similar concept. The template's core innovation is the **decoupling of reasoning from retrieval**. The `<think>` block forces the model to decompose a complex question into a logical sequence of sub-problems *before* it looks up any facts. This prevents the model from jumping to conclusions based on initial, potentially misleading, retrieved information.
The subsequent `<plan>` and search protocol then execute this pre-defined reasoning chain against a Knowledge Graph, using web search as a safety net. This approach aims to produce more accurate, explainable, and reliable answers by ensuring that information retrieval is guided by a sound logical structure rather than being a haphazard process. The strict use of tags suggests this output is meant to be parsed by another system component, making the AI's reasoning process machine-readable and integrable into a larger application pipeline.