{"record":{"id":"c64d278953649171","repo":"microsoft/graphrag","slug":"no-follow-up-queries-found-in-primer-response-ens","errorCode":null,"errorMessage":"No follow-up queries found in primer response. Ensure that the primer response includes follow-up queries.","messagePattern":"No follow-up queries found in primer response\\. Ensure that the primer response includes follow-up queries\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"packages/graphrag/graphrag/query/structured_search/drift_search/search.py","lineNumber":147,"sourceCode":"        response = search_results.response\n        if isinstance(response, list) and isinstance(response[0], dict):\n            intermediate_answers = [\n                i[\"intermediate_answer\"] for i in response if \"intermediate_answer\" in i\n            ]\n\n            if not intermediate_answers:\n                error_msg = \"No intermediate answers found in primer response. Ensure that the primer response includes intermediate answers.\"\n                raise RuntimeError(error_msg)\n\n            intermediate_answer = \"\\n\\n\".join([\n                i[\"intermediate_answer\"] for i in response if \"intermediate_answer\" in i\n            ])\n\n            follow_ups = [fu for i in response for fu in i.get(\"follow_up_queries\", [])]\n\n            if not follow_ups:\n                error_msg = \"No follow-up queries found in primer response. Ensure that the primer response includes follow-up queries.\"\n                raise RuntimeError(error_msg)\n\n            score = sum(i.get(\"score\", float(\"-inf\")) for i in response) / len(response)\n            response_data = {\n                \"intermediate_answer\": intermediate_answer,\n                \"follow_up_queries\": follow_ups,\n                \"score\": score,\n            }\n            return DriftAction.from_primer_response(query, response_data)\n        error_msg = \"Response must be a list of dictionaries.\"\n        raise ValueError(error_msg)\n\n    async def _search_step(\n        self,\n        global_query: str,\n        k_followups: int,\n        search_engine: LocalSearch,\n        actions: list[DriftAction],\n    ) -> list[DriftAction]:","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag/graphrag/query/structured_search/drift_search/search.py#L129-L165","documentation":"After extracting intermediate answers from the primer response, DRIFT search requires follow_up_queries entries to drive its iterative refinement loop. If every item in the parsed response omits follow_up_queries (or all are empty lists), this RuntimeError is raised because the search cannot proceed to its next step.","triggerScenarios":"Calling DriftSearch.search where the primer LLM response parses successfully but contains no follow_up_queries keys or only empty lists, often because the model skipped that part of the instructed output schema.","commonSituations":"Weak or small models ignoring the multi-field JSON instruction, customized primer prompts that dropped the follow-up instructions, or truncated responses that cut off before follow-up queries were emitted.","solutions":["Retry the search; models intermittently omit fields","Use a stronger instruction-following model for the primer step","Restore/verify the default DRIFT primer prompt includes explicit follow_up_queries instructions if you customized it","Increase output token limits to prevent truncation before follow-ups are generated"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"def has_follow_ups(response) -> bool:\n    return any(i.get(\"follow_up_queries\") for i in response if isinstance(i, dict))","tryCatchPattern":"for attempt in range(3):\n    try:\n        result = await drift_search.aresolve(query)\n        break\n    except RuntimeError as e:\n        if \"follow-up queries\" in str(e) and attempt < 2:\n            continue\n        raise","preventionTips":["Keep the default primer prompt's explicit follow_up_queries instruction when customizing","Use low temperature and a capable model for reliable schema adherence","Retry once or twice on this error; field omission is often intermittent"],"tags":["graphrag","drift-search","llm-response-parsing","follow-up-queries"],"backgroundTag":"llm-output-parsing-failed","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}