metadata_filter_or_bugTier 1 · 70% confidence
ai-agents-metadata-filter-or-b-when-using-metadatafilters-with-filtercondition-or-43fb7efd
agent: ai_agents
When does this happen?
IF When using MetadataFilters with FilterCondition.OR and multiple ExactMatchFilter on the same key in LlamaIndex, the SimpleVectorStore returns empty results instead of applying OR logic.
How others solved it
THEN Create a custom vector store that overrides the `_process_filters` method to treat multiple filters on the same key as an OR condition (equivalent to an IN filter). Patch the SimpleVectorStore to combine same-key ExactMatchFilter values into a single OR check against the node's metadata dictionary.
class MySimpleVectorStore(SimpleVectorStore):
def _process_filters(self, filters, metadata):
# Group filters by key; combine same-key filters with OR
grouped = {}
for f in filters.filters:
grouped.setdefault(f.key, []).append(f.value)
for key, values in grouped.items():
if key in metadata and metadata[key] not in values:
return False
return TrueRelated patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.