Commit Graph
16 Commits
Author SHA1 Message Date
kartik-mem0andClaude Opus 4.6 b38f2ef45c fix(qdrant): deduplicate $or/$not keys and add icontains debug warning
Memory._process_metadata_filters() renames OR→$or and NOT→$not, but
effective_filters also retains the original OR/NOT keys from the
deepcopy of input_filters. Without dedup, the same sub-conditions were
evaluated twice in the Qdrant filter.

Normalize the filter dict upfront so $or/$not/$and map to OR/NOT/AND
and only the first occurrence is kept. Also replace the fragile
value.get("contains") or value.get("icontains") pattern with explicit
key lookup, and add a logger.debug for icontains explaining that Qdrant
MatchText case sensitivity depends on full-text index configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 19:04:42 +05:30
kartik-mem0andClaude Opus 4.6 b1dbd08c63 fix(qdrant): handle $or/$not keys injected by Memory middleware
Memory._process_metadata_filters() renames OR→$or and NOT→$not before
passing filters to the vector store. Without this fix, $or/$not keys
with list values hit _build_field_condition and crash with
ValidationError (MatchValue rejects lists).

Normalize $or→OR, $not→NOT, $and→AND at the start of _create_filter
so both naming conventions work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 18:32:57 +05:30
kartik-mem0andClaude Sonnet 4.6 269d784c0f test(qdrant): add edge-case tests for enhanced metadata filtering
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 18:08:31 +05:30
kartik-mem0andClaude Sonnet 4.6 72c2a7f322 fix(qdrant): fix MatchText comment and validate logical operator inputs
Corrects the MatchText comment to accurately describe Qdrant behavior
(tokenized match with a full-text index; exact substring without one),
and adds ValueError validation when AND/OR/NOT filter values are not
lists, replacing unhelpful AttributeError crashes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 18:07:07 +05:30
kartik-mem0andClaude Sonnet 4.6 a930603c12 fix(qdrant): add wildcard * support and update type hints
Wildcard '*' values now return None from _build_field_condition (match any /
field exists semantics), and _create_filter skips None conditions so a
filter containing only wildcards returns None. Updated return type annotations
to Optional[FieldCondition] and Optional[Filter] accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 18:05:48 +05:30
kartik-mem0andClaude Sonnet 4.6 b53507efd3 fix(qdrant): reject mixed range and non-range filter operators
Raise ValueError when a filter dict for a single field combines range
operators (gt/gte/lt/lte) with non-range operators (eq/ne/in/nin/etc),
preventing silent data loss where the non-range conditions were dropped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 18:04:10 +05:30
kartik-mem0andClaude Sonnet 4.6 fb430b1a32 fix(qdrant): raise ValueError for unsupported filter operators
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 18:02:54 +05:30
Longwei Liu 7e0968bbc8 fix(qdrant): implement enhanced metadata filtering operators
The Qdrant vector store's _create_filter only handled simple equality
and a single gte+lte range case, causing ValidationError for all other
operators documented at docs.mem0.ai/open-source/features/metadata-filtering.

Add _build_field_condition to translate the universal filter syntax into
Qdrant-native models:
- Comparison: eq, ne, gt, gte, lt, lte  → MatchValue / MatchExcept / Range
- List:       in, nin                    → MatchAny / MatchExcept
- String:     contains, icontains        → MatchText
- Logical:    AND, OR, NOT              → Filter(must/should/must_not), recursive

Existing simple equality and gte+lte range filters continue to work
unchanged (backward compatible).

Closes #3975
2026-02-25 00:01:24 +08:00
Parshva DaftariandGitHub b60a208c2f Fixes n_embeddings use and error for memgraph (#3296) 2025-08-11 12:57:29 -05:00
Parshva DaftariandGitHub 42e60d6724 Added mulit id filters support for all vectorstores (#3269) 2025-08-04 14:52:57 -07:00
Dev KhantandGitHub ec1d7a45d3 Fix all lint errors (#2627) 2025-05-06 01:16:02 +05:30
8e6a08aa83 Support for hybrid search in Azure AI vector store (#2408)
Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
2025-03-20 22:57:00 +05:30
Dev KhantandGitHub a4340b2336 Fix Qdrant Tests (#2287) 2025-03-03 10:46:56 +05:30
4318663697 Make api_version=v1.1 default and version bump -> 0.1.59 (#2278)
Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
2025-03-01 11:36:20 +05:30
Dev KhantandGitHub 605558da9d Code formatting (#1986) 2024-10-29 11:32:07 +05:30
0a78cb9f7a added vector store test cases (#1868)
Co-authored-by: Dev Khant <devkhant24@gmail.com>
2024-09-16 23:51:29 +05:30