{"record":{"id":"bf043bd09970a5c8","repo":"HKUDS/DeepTutor","slug":"graphrag-embedding-incompatible","errorCode":"graphrag_embedding_incompatible","errorMessage":"The active embedding model did not accept or return the vector response required by GraphRAG.","messagePattern":"The active embedding model did not accept or return the vector response required by GraphRAG\\.","errorType":"exception","errorClass":"GraphRagEmbeddingResponseError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/rag/pipelines/graphrag/engine.py","lineNumber":255,"sourceCode":"\n\nasync def _probe_embedding_model_impl(config: Any) -> None:\n    \"\"\"Run one bounded embedding request through GraphRAG's actual client.\"\"\"\n    embedding, expected_dimension = _create_probe_embedding(config)\n    try:\n        response = await embedding.embedding_async(\n            input=[EMBEDDING_PROBE_TEXT],\n            timeout=PROBE_TIMEOUT_SECONDS,\n        )\n    except Exception as error:  # noqa: BLE001 - classified into secret-free metadata\n        classified = classify_embedding_error(error)\n        if classified is not None:\n            raise classified from error\n        raise GraphRagEmbeddingProbeError() from error\n\n    vector = getattr(response, \"first_embedding\", None)\n    if not isinstance(vector, list) or not vector:\n        raise GraphRagEmbeddingResponseError(EMBEDDING_RESPONSE_MESSAGE)\n    if expected_dimension and len(vector) != expected_dimension:\n        raise GraphRagEmbeddingDimensionError(\n            configured=expected_dimension,\n            actual=len(vector),\n        )\n\n\nasync def preflight_embedding(root_dir: Path) -> None:\n    \"\"\"Validate one settings snapshot through GraphRAG's real embedding client.\"\"\"\n    await _run_isolated(lambda: _preflight_embedding_impl(root_dir))\n\n\nasync def preflight_completion(root_dir: Path) -> None:\n    \"\"\"Validate the completion model from the exact persisted settings snapshot.\"\"\"\n    try:\n        await _run_isolated(lambda: _preflight_completion_impl(root_dir))\n    except Exception as error:\n        classified = classify_model_error(error)","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/rag/pipelines/graphrag/engine.py#L237-L273","documentation":"GraphRagEmbeddingResponseError (code graphrag_embedding_incompatible): the embedding endpoint answered, but response.first_embedding was not a non-empty list — the model did not return the vector format GraphRAG requires.","triggerScenarios":"The embedding probe succeeds at HTTP level but returns empty data, an object instead of an array, or a response shape the adapter can't extract a first embedding from (e.g. native Gemini batch response routed through the OpenAI client).","commonSituations":"OpenAI-compatible façades with incomplete /embeddings implementations; empty input string being embedded; endpoint returning {\"data\": []} on certain models; wrong model name silently yielding empty responses.","solutions":["Test the endpoint directly with curl POST /embeddings and confirm data[0].embedding is a non-empty array.","Use a fully OpenAI-compatible embedding endpoint/model.","Check the model name in the embedding profile is valid."],"exampleFix":"curl $ENDPOINT/embeddings -d '{\"model\":\"text-embedding-3-small\",\"input\":\"hi\"}'\n# expect {\"data\":[{\"embedding\":[...numbers...]}]}","handlingStrategy":"validation","validationCode":"resp = await client.embeddings.create(model=m, input=[\"ping\"])\nvec = resp.data[0].embedding\nassert isinstance(vec, list) and vec, \"endpoint not OpenAI-compatible\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Smoke-test custom endpoints with a single embedding before wiring them to GraphRAG."],"tags":["graphrag","embeddings","response-format"],"backgroundTag":"embedding-response-invalid","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}