S3 Vectors 與 DynamoDB 向量搜尋篩選功能更新:使用前要核對的限制
S3 Vectors and DynamoDB Vector Search Get Better Filters: What to Check Before Using Them
S3 Vectors 將每個向量可篩選 metadata 上限由 2 KB 提高至 40 KB;DynamoDB SearchVectors 則支援範圍比較、BETWEEN、IN 等更多篩選條件。
Two small vector-search updates landed on 20 November, one for S3 Vectors and one for DynamoDB. Individually they're easy to skim past. Together they say something about where AWS expects RAG metadata filtering to go: filters inside the search, not after it.
I'm going by the announcements and the linked docs here. I haven't run either.
S3 Vectors: 40 KB of filterable metadata
The headline: filterable metadata per vector goes from 2 KB to 40 KB, at no additional cost, in all Regions where S3 Vectors is available. PutVectors and QueryVectors usage doesn't change.
The detail is in the docs, and it's what you'll trip on:
- There are two index modes, ENHANCED and CLASSIC. Buckets created on or after 30 September 2026 create ENHANCED indexes. Older buckets have CLASSIC.
- Existing indexes can move to enhanced mode in place with the UpdateIndexMode API.
- The limits table gives ENHANCED 40 KB filterable and 100 KB total metadata, against 2 KB and 40 KB for CLASSIC.
- Pre-filtering only applies in ENHANCED mode. Individual filterable string values are still capped at 2 KB each, and oversized metadata gets a 400 from PutVectors.
- Up to 50 metadata keys per vector, and non-filterable keys must be declared at index creation. You can't make one filterable later.
Operators in the docs include $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $and, $or and $startsWith. A request can carry up to 100 filter constraints in enhanced mode, with each $in value counting as one.
{"$and": [{"genre": {"$eq": "drama"}}, {"year": {"$gte": 2020}}]}
DynamoDB: richer filters on SearchVectors
The SearchConditionExpression on SearchVectors now accepts range comparisons and BETWEEN on numbers, IN, attribute_exists, attribute_not_exists, and AND, OR and NOT. AWS says filters apply during the search, so every result matches.
The filter reference page has the gotchas:
- The partition key rules are strict: exactly one top-level
=condition on it, joined by AND, and one SearchVectors call per partition key value. - A missing attribute doesn't match
=, range, BETWEEN or IN, but does match<>and NOT. Addattribute_existsif you want to exclude those items. - Numbers are compared as 64-bit doubles, so values beyond 15 significant digits can match wrongly. The docs suggest storing them as strings.
- begins_with, contains, size and nested paths are rejected.
The docs' own example:
SearchConditionExpression="#category = :category AND ( #brand IN (:brand1, :brand2, :brand3) OR #price BETWEEN :lo AND :hi )"
One thing to verify: an older DynamoDB page, VectorSearchWorkingWith, still says comparison, range and IN operators aren't available. The newer filter reference and the announcement say they are. I'd trust the newer pages, but run a live call before building on it.
What I'd take from it
If you're doing RAG, your filter design now matters as much as your embedding choice. Tenant, document type, date and access tags should be filterable metadata, and large blobs should not. On S3 Vectors that decision is permanent per index, so decide before you load a billion vectors.
Pricing for DynamoDB vector search isn't stated in the announcement, and neither service gives per-filter costs. Check your own bill after a test.
Next step: list the five filters your retrieval actually needs, and check each against the operator tables above.
Sources
- https://aws.amazon.com/about-aws/whats-new/2026/11/amazon-s3-vectors-raises-filterable-metadata-40kb-per-vector/
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors-metadata-filtering.html
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors-limitations.html
- https://aws.amazon.com/about-aws/whats-new/2026/11/dynamodb-vector-filters/
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/VectorSearchFilterReference.html
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/VectorSearchWorkingWith.html
Drafted with AI assistance. I review and edit every post.
來源:DEV Community · dev.to