run-llama/llama_index · error · ValueError

vector_store must be a BasePydanticVectorStore

Error message

vector_store must be a BasePydanticVectorStore

What it means

Error "vector_store must be a BasePydanticVectorStore" thrown in run-llama/llama_index.

Source

Thrown at llama-index-core/llama_index/core/memory/memory_blocks/vector.py:70

        description="Maximum number of messages to include for context when retrieving.",
    )
    format_template: BasePromptTemplate = Field(
        default=DEFAULT_RETRIEVED_TEXT_TEMPLATE,
        description="Template for formatting the retrieved information.",
    )
    node_postprocessors: List[BaseNodePostprocessor] = Field(
        default_factory=list,
        description="List of node postprocessors to apply to the retrieved nodes containing messages.",
    )
    query_kwargs: Dict[str, Any] = Field(
        default_factory=dict,
        description="Additional keyword arguments for the vector store query.",
    )

    @field_validator("vector_store", mode="before")
    def validate_vector_store(cls, v: Any) -> "BasePydanticVectorStore":
        if not isinstance(v, BasePydanticVectorStore):
            raise ValueError("vector_store must be a BasePydanticVectorStore")
        if not v.stores_text:
            raise ValueError(
                "vector_store must store text to be used as a retrieval memory block"
            )

        return v

    @field_validator("format_template", mode="before")
    @classmethod
    def validate_format_template(cls, v: Any) -> "BasePromptTemplate":
        if isinstance(v, str):
            if "{{" in v and "}}" in v:
                v = RichPromptTemplate(v)
            else:
                v = PromptTemplate(v)

        return v

View on GitHub (pinned to afd0fef371)

Solutions

  1. Pass an instance of BasePydanticVectorStore as vector_store.
  2. Wrap or replace the store with a supported vector store integration.

When it happens

Trigger: Thrown at llama-index-core/llama_index/core/memory/memory_blocks/vector.py:70 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of run-llama/llama_index@afd0fef371 (2026-08-15). Data as JSON: /api/errors/9bfce278ff9e20fb. Report an issue: GitHub.