| name | multi-turn contextual query synthesis |
| description | Use this skill when the user asks a follow-up or clarification question that depends on previous conversation history. Trigger it for requests that use pronouns like 'he', 'it', or 'that', or elliptical phrases like 'what about its address?', 'why was he there?', or 'any more examples of those?'. This skill is specifically for RAG agents that need to rewrite a non-standalone user turn into a standalone search query by resolving conversational co-references and context. |
Skill: multi-turn contextual query synthesis
1. Capability Definition & Real Case
- Professional Definition: The ability to perform contextual query rewriting (CQR) in a multi-turn RAG pipeline by resolving anaphoric references, elliptical expressions, and implicit constraints found in the conversation history. The agent must synthesize a standalone retrieval query that incorporates relevant entities and topics from prior turns, ensuring that the retriever fetches documents relevant to the actual current intent rather than just the literal words of the most recent turn.
- Dimension Hierarchy: Multi-Source Evidence Composition->Conversational Context Integration->multi-turn contextual query synthesis
Real Case
[Case 1]
- Initial Environment: A RAG environment containing a Wikipedia-derived corpus about the Marvel Cinematic Universe.
- Real Question: Why was he referenced in the film?
- Real Trajectory: 1. Analyze conversation history to resolve 'he' (Doctor Strange) and 'the film' (Captain America: The Winter Soldier). 2. Synthesize a standalone query: 'Why was Doctor Strange referenced in the film Captain America: The Winter Soldier?' 3. Retrieve relevant passages explaining the scrying crystal ball and the Hydra target list. 4. Verify that the answer describes Hydra's algorithm targeting Stephen Strange as a threat.
- Real Answer: Doctor Strange was referenced in Captain America: The Winter Soldier because Jasper Sitwell mentions him as one of the high-level threats being tracked by Hydra's Zola algorithm.
- Why this demonstrates the capability: The question 'Why was he referenced in the film?' is completely non-standalone. The agent must integrated context from two turns prior (where Doctor Strange and the specific Captain America movie were first mentioned) to create a valid search intent. Successful execution demonstrates the ability to bridge the conversational gap to fetch specific, grounded evidence.
[Case 2]
- Initial Environment: A RAG environment with 2024 quarterly financial slide decks from a major technology company.
- Real Question: What about its address?
- Real Trajectory: 1. Identify 'its' as a placeholder for the company discussed in the previous turn (Apple Inc.). 2. Rewrite the query to 'What is the corporate headquarters address for Apple Inc. in 2024?'. 3. Retrieve the slide containing the 'Company Profile' or 'Contact Information' section. 4. Extract the physical address: One Apple Park Way, Cupertino, CA.
- Real Answer: The corporate headquarters address for Apple Inc. is One Apple Park Way, Cupertino, California, 95014.
- Why this demonstrates the capability: This case tests the resolution of possessive pronouns ('its') that anchor a new request to a previously established entity. Without this capability, the agent would search for 'address' in a vacuum, likely returning irrelevant results or failing to retrieve specifically for the company in question.
Pipeline Execution Instructions
To synthesize data for this capability, you must strictly follow a 3-phase pipeline. Do not hallucinate steps. Read the corresponding reference file for each phase sequentially:
-
Phase 1: Environment Exploration
Read the exploration guidelines to discover raw knowledge seeds:
references/EXPLORATION.md
-
Phase 2: Trajectory Selection
Once Phase 1 is complete, read the selection criteria to evaluate the trajectory:
references/SELECTION.md
-
Phase 3: Data Synthesis
Once a trajectory passes Phase 2, read the synthesis instructions to generate the final data:
references/SYNTHESIS.md