{"record":{"id":"48ae371628bd100c","repo":"microsoft/graphrag","slug":"invalid-entityvectorstorekey-value","errorCode":null,"errorMessage":"Invalid EntityVectorStoreKey: {value}","messagePattern":"Invalid EntityVectorStoreKey: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag/graphrag/query/context_builder/entity_extraction.py","lineNumber":38,"sourceCode":"    from graphrag_llm.embedding import LLMEmbedding\n\n\nclass EntityVectorStoreKey(str, Enum):\n    \"\"\"Keys used as ids in the entity embedding vectorstores.\"\"\"\n\n    ID = \"id\"\n    TITLE = \"title\"\n\n    @staticmethod\n    def from_string(value: str) -> \"EntityVectorStoreKey\":\n        \"\"\"Convert string to EntityVectorStoreKey.\"\"\"\n        if value == \"id\":\n            return EntityVectorStoreKey.ID\n        if value == \"title\":\n            return EntityVectorStoreKey.TITLE\n\n        msg = f\"Invalid EntityVectorStoreKey: {value}\"\n        raise ValueError(msg)\n\n\ndef map_query_to_entities(\n    query: str,\n    text_embedding_vectorstore: VectorStore,\n    text_embedder: \"LLMEmbedding\",\n    all_entities_dict: dict[str, Entity],\n    embedding_vectorstore_key: str = EntityVectorStoreKey.ID,\n    include_entity_names: list[str] | None = None,\n    exclude_entity_names: list[str] | None = None,\n    k: int = 10,\n    oversample_scaler: int = 2,\n) -> list[Entity]:\n    \"\"\"Extract entities that match a given query using semantic similarity of text embeddings of query and entity descriptions.\"\"\"\n    if include_entity_names is None:\n        include_entity_names = []\n    if exclude_entity_names is None:\n        exclude_entity_names = []","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag/graphrag/query/context_builder/entity_extraction.py#L20-L56","documentation":"EntityVectorStoreKey.from_string parses the configured vector-store key type for entity search; only 'id' and 'title' are valid. Any other string (e.g. 'name', 'ID', or a typo) raises ValueError. This value typically comes from the query config's vector store key setting.","triggerScenarios":"Running a local/global query with vector store config where key is misspelled or wrong case (e.g. 'Name', 'entity_id'); passing a custom string through code that calls from_string directly.","commonSituations":"Editing settings.yaml and changing the entities vectorstore key to something not supported; upgrading GraphRAG versions where valid keys changed; copy-pasted config from other projects.","solutions":["Set the vector store key to exactly 'title' or 'id' in your query settings/config","If calling from_string directly, validate/normalize input to lowercase first","Check settings.yaml under vector_stores default_vector_store.key"],"exampleFix":"# before\nvector_store_kwargs={'key': 'name'}\n# after\nvector_store_kwargs={'key': 'title'}","handlingStrategy":"validation","validationCode":"key = (cfg_key or 'title').lower()\nif key not in ('id', 'title'):\n    key = 'title'\nEntityVectorStoreKey.from_string(key)","typeGuard":"def is_valid_store_key(v: object) -> bool:\n    return isinstance(v, str) and v in ('id', 'title')","tryCatchPattern":null,"preventionTips":["Restrict vector store key config to id/title via schema/enums in settings validation","Lowercase config values before parsing"],"tags":["graphrag","vector-store","enum-parsing","configuration"],"backgroundTag":"enum-value-invalid","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}