Picking a Vector Store for Bedrock Knowledge Bases and RAG: OpenSearch Serverless, Aurora pgvector, S3 Vectors
When you create a Bedrock knowledge base, the console asks for a vector store. Most people click the default and move on. A few months later two questions come back. "Why are we paying over the weekend when nobody uses it?" And: "Why do I only get three results once I add the department filter?" Both start with the store choice. This post compares the stores that Knowledge Bases supports on four criteria: cost structure, filters and hybrid search, operations, and closed networks. It ends with a decision table by team size and data volume, and the tests to run after you choose.
Field notes · Amazon Bedrock · Vector store · RAG
The full knowledge base setup is in Building RAG on a closed network, and Korean keyword search is in What trips up RAG over Korean internal documents. This post covers only the step in between: which store to put it in.

Know this first: the store is hard to change later
The choice matters because of what it costs to undo.
- Field mappings are fixed at creation. For Aurora, the documentation says the fields cannot be updated after the knowledge base is created. The other stores also take the index name, vector field and text field when you create the knowledge base.
- Changing the store means ingesting everything again. You create a new knowledge base on the new store and parse, chunk and embed every document again. You pay the embedding cost and the ingestion time a second time.
- The embedding model and dimensions narrow the options. Binary vectors are supported only by OpenSearch Serverless and OpenSearch managed clusters. S3 Vectors accepts floating-point vectors only.
So even if you start with the default, weigh the four criteria below at least once before you go to production.
The candidates: stores that knowledge bases support
This list comes from the vector store section of the Bedrock User Guide (prerequisites for a vector store you created). The list changes, so check the current docs again before you apply it.
| Store | In one line |
|---|---|
| Amazon OpenSearch Serverless | The default in the console quick-create flow. Hybrid search, many filter operators, binary vectors |
| Amazon OpenSearch Service managed clusters | You run the domain. To use it with a knowledge base the domain must have public access (VPC domains are not supported) |
| Amazon S3 Vectors | Vector buckets and vector indexes. No infrastructure to run, suited to workloads with infrequent queries |
| Amazon Aurora PostgreSQL (pgvector) | An Aurora cluster in the same account, reached through the RDS Data API and Secrets Manager. You can look inside with SQL |
| Amazon Neptune Analytics | For GraphRAG. When retrieval has to follow relationships between documents |
| Pinecone, Redis Enterprise Cloud, MongoDB Atlas | Third-party managed services. Data is stored in a service outside your AWS account |
There is also the option of not choosing a store at all. The current documentation presents Bedrock Managed Knowledge Base as the recommended choice. Bedrock manages the ingestion, storage, indexing and retrieval infrastructure, and you do not pick or scale a store. In exchange, you cannot reach into the store to inspect or tune it. Check separately in the docs whether its supported Regions, pricing and closed-network requirements fit yours. This post assumes a customer-managed knowledge base where you choose the store, or a RAG you build yourself.
The overall structure
Criterion 1: what is left on a closed network
If the requirement is "data never leaves the account and there is no internet path", the list shrinks first.
| Store | How Bedrock reaches it | How our VPC reaches it |
|---|---|---|
| OpenSearch Serverless | Private access by adding bedrock.amazonaws.com to SourceServices in the network policy | Create an OpenSearch Serverless VPC endpoint and list it in SourceVPCEs in the network policy |
| OpenSearch managed clusters | Public-access domains only | Usually ruled out when there is a closed-network requirement |
| Aurora PostgreSQL | Through the RDS Data API, cluster in the same account | Operators connect with SQL to the DB in private subnets |
| S3 Vectors | s3vectors permissions on the service role | Interface endpoint com.amazonaws.<region>.s3vectors with an endpoint policy |
| Neptune Analytics | Bedrock creates the network connection to the graph itself | Check the Neptune Analytics docs for the operator access path |
| Pinecone, Redis, MongoDB Atlas | Connects to the third-party service address (MongoDB Atlas documents a PrivateLink option) | Data is stored outside the account, so it needs a security review |
A network policy that keeps OpenSearch Serverless VPC-only looks like this. Bedrock access and our VPC endpoint access go into the same rule.
[
{
"Description": "KB collection: Bedrock and our VPC only",
"Rules": [
{"ResourceType": "collection", "Resource": ["collection/kb-hr"]}
],
"AllowFromPublic": false,
"SourceVPCEs": ["vpce-0abc1234def567890"],
"SourceServices": ["bedrock.amazonaws.com"]
}
]
Field tip: When network policies overlap, public access wins. If someone creates a policy on collection/* with AllowFromPublic: true, that collection is reachable from public networks even with the policy above in place. Put the account's network policy list (list-security-policies --type network) into your regular review. Also note that SourceServices applies only to the collection endpoint, not to Dashboards.
Criterion 2: filters and hybrid search
If you plan permission filters (document access control) and Korean keyword search, this criterion comes before cost. Per the knowledge base documentation:
| Item | Per the current docs |
|---|---|
| Hybrid search | Only Amazon RDS (Aurora), OpenSearch Serverless and MongoDB stores that have a filterable text field. Elsewhere, a HYBRID request runs as semantic search |
in, notIn | Marked as best supported on OpenSearch Serverless and Neptune Analytics |
listContains, stringContains | Mainly OpenSearch Serverless. S3 Vectors does not support startsWith or stringContains |
| Metadata size | S3 Vectors allows up to 1 KB of custom metadata and 35 keys per vector. Beyond that the ingestion job fails |
| Aurora metadata | Recommended: one JSONB column for all custom metadata with a GIN index |
There is one more thing to check on S3 Vectors. The S3 User Guide says the S3 Vectors API itself supports full-text (BM25) and hybrid search, but the knowledge base documentation does not yet list S3 Vectors for hybrid search. Behaviour may differ between using it through a knowledge base and calling the API directly, so decide which one you are doing and check that documentation. The docs also note that hierarchical chunking, and parsing that attaches table and figure context, store parent-child relationships and context as non-filterable metadata, which can exceed the metadata limit with large token settings.
If you prepare Aurora yourself, follow the table and index examples in the docs. For Korean documents, watch the dictionary on the text index.
CREATE EXTENSION IF NOT EXISTS vector;
CREATE SCHEMA bedrock_integration;
CREATE TABLE bedrock_integration.bedrock_kb (
id uuid PRIMARY KEY,
embedding vector(1024), -- match the embedding model's dimensions
chunks text,
metadata json,
custom_metadata jsonb
);
CREATE INDEX ON bedrock_integration.bedrock_kb USING hnsw (embedding vector_cosine_ops);
-- 'simple' splits on whitespace: Korean words with particles attached are not matched separately
CREATE INDEX ON bedrock_integration.bedrock_kb USING gin (to_tsvector('simple', chunks));
CREATE INDEX ON bedrock_integration.bedrock_kb USING gin (custom_metadata);
-- so selective filters still return enough results (pgvector 0.8.0 or later)
ALTER DATABASE kbdb SET hnsw.iterative_scan = 'relaxed_order';
PostgreSQL's built-in full-text search has no Korean morphological dictionary. A word with a particle attached and the bare word count as different words, so expect the keyword side of Aurora hybrid search to help less for Korean than for English, and measure it with your eval set. If keyword search is central, designing the index yourself in OpenSearch with the nori analyzer (the Korean documents post above) works better.
Going deeper: why filters shrink the result set
Approximate nearest neighbour indexes such as HNSW are built to find "the k closest vectors" quickly. If the filter is applied after the index scan, most of the candidates it found are thrown away by the filter and you get fewer results than you asked for. The more selective the filter, as permission filters usually are, the worse it gets. That is why the Aurora docs recommend iterative index scans in pgvector 0.8.0 or later: the scan keeps going until enough results pass the filter. Other stores apply filters during the search in their own ways, so whichever store you choose, put "does a filtered query fill the requested count?" on the test list. It is the second item in the test at the end of this post.
Criterion 3: cost structure, especially minimum capacity and idle cost
Prices differ by Region and change over time, so this section lists only what you are charged for. Check unit prices on each service's pricing page.
| Store | Billing units | When nobody uses it |
|---|---|---|
| OpenSearch Serverless | Indexing and search compute in OCUs (one OCU is 6 GiB of memory with matching vCPU), storage billed separately | Scales down to the minimum OCU you set. The current docs say a collection group's minimum can be 0 (no OCUs while idle, but a cold start on the first request) |
| Aurora Serverless v2 | ACU hours, storage, I/O (depending on configuration) | With a minimum of 0 ACUs it auto-pauses and the instance charge is zero. Storage is still billed |
| S3 Vectors | Storage, uploads (PUT, logical GB), a per-query request fee and data processed based on index size | Only storage remains. No always-on compute |
| OpenSearch managed clusters | Instance hours and storage | Billed for the cluster size as is |
What to watch for, store by store:
- OpenSearch Serverless: You set minimum and maximum OCUs per collection group, separately for indexing and search. Older (Classic) collections without a group follow account-level settings, so check your account's current values first. The maximum works as a budget cap. If every knowledge base gets its own collection, every collection brings its own minimum, so it is better to put collections of the same type (vector search) into one collection group to share OCUs. A group holds only one collection type.
- Aurora Serverless v2 auto-pause: PostgreSQL needs version 16.3, 15.7, 14.12, 13.15 or later. Resume typically takes about 15 seconds, and the docs say it can take 30 seconds or more after more than 24 hours paused. When a Data API request arrives, Aurora resumes the writer instance and then processes it. Attaching RDS Proxy or enabling logical replication prevents pausing.
- S3 Vectors: It is described as sub-second for infrequent queries and as low as 100 milliseconds for more frequent ones. For something like an internal chatbot where queries cluster in business hours, measure the latency yourself before deciding.
Field tip: A minimum capacity of 0 gives you "zero on weekends" together with "the first question on Monday morning is slow". For an internal tool, the simple fix is a scheduled light search before the workday to wake it up. Conversely, if you expected auto-pause and costs did not drop, open connections are often the cause (a developer's SQL client, RDS Proxy, a health-check Lambda). Aurora emits events when it pauses and resumes (RDS-EVENT-0370 to 0374), so use those events to see how long it actually paused.
Criterion 4: operations, who looks at what
Whether you can look directly at "what is in the store" during an incident decides much of the operating burden.
- OpenSearch Serverless: If you create the index yourself, the engine must be
faissfor metadata filters to work. You manage three policies: data access, network and encryption. Watch scaling with theSearchOCUandIndexingOCUmetrics and set alarms. You can query the index directly with OpenSearch queries, so "how many chunks of this document are left?" is a quick check. - Aurora: The team handles engine and pgvector upgrades, indexes and VACUUM. In return you can see chunks and metadata with one line of SQL and use relational features as they are, such as joining with a permissions table. For a team that already runs Aurora, there is the least to learn.
- S3 Vectors: No cluster, versions or capacity to manage. Writes are strongly consistent, so data is readable right after it is written. However, the bucket's encryption type cannot be changed after creation, and there are limits such as vectors per index, so check the limits page. Permissions are managed separately in IAM under the
s3vectorsnamespace.
In a RAG you build yourself (the application does embedding and retrieval without a knowledge base), the operations criterion weighs more, because you own the ingestion pipeline, deduplication and reindexing. Calling S3 Vectors directly, the retrieval code looks like this.
import boto3
s3v = boto3.client("s3vectors") # inside the VPC, through the s3vectors interface endpoint
resp = s3v.query_vectors(
vectorBucketName="rag-vectors",
indexName="hr-docs",
queryVector={"float32": query_embedding}, # the question embedded with the same model
topK=5,
filter={"access_group": {"$in": ["all-staff", "hr"]}},
returnMetadata=True,
returnDistance=True,
)
for v in resp["vectors"]:
print(v["key"], v["distance"], v["metadata"].get("source_id"))
Check the current filter syntax and response fields in the S3 Vectors API reference. With a knowledge base, this part becomes the filter syntax of the Retrieve API.
Going deeper: mixing stores
The S3 User Guide describes exporting a snapshot of an S3 Vectors index to OpenSearch Serverless for high-throughput, low-latency search, and using S3 Vectors as a storage tier under OpenSearch Service. A tiered layout is worth considering: "all documents in low-cost S3 Vectors, only frequently asked recent documents in OpenSearch". But one knowledge base connects to one store, so splitting this way means two knowledge bases, and the application has to choose which to search or merge both results. Merging results, deduplicating and applying the same permission filters in two places all add work, so first calculate whether the cost difference is large enough to justify that complexity.
Decision table: choosing by team size and data volume
This is a starting point. The boundaries are not measurements but where the judgement starts, so confirm them with the test in the last step.
| Situation | First candidate | Why, and conditions |
|---|---|---|
| Small team, thousands to tens of thousands of documents, an internal tool with infrequent queries | S3 Vectors or Managed Knowledge Base | Almost no idle cost and nothing to run. Rule it out if you really need hybrid search |
| Small team, searching Korean proper nouns and clause numbers matters | OpenSearch Serverless (low minimum OCU) | Supports hybrid search. Decide whether to accept cold starts or add a business-hours wake-up |
| A team that already runs Aurora PostgreSQL, medium chunk count | Aurora PostgreSQL (pgvector) | Debugging with SQL, joins with permission tables, familiar backup and audit. Check the Korean keyword side with evals |
| Platform team, knowledge bases for many departments, many queries, complex filters | OpenSearch Serverless | Filters such as in and listContains, hybrid search, auto scaling. Share OCUs through collection groups |
| Very many documents, most rarely read (archive search) | S3 Vectors | Billing driven by storage. Consider keeping only the frequently asked part in a faster store |
| Retrieval must follow relationships between documents (org chart, contract parties, product structure) | Neptune Analytics (GraphRAG) | First confirm with the eval set that relationship questions are actually common |
| Strong closed-network requirement | Whatever is left after removing third-party services and public domains | Check both Bedrock access and VPC access with the table in criterion 1 |
Test after choosing: two candidates, one eval set
Once you are down to two candidates, build one knowledge base on each with the same documents and the same embedding model, and ask both the same questions. For building the eval set, follow RAG evaluation in practice. The script below pulls out only the numbers you need to compare stores.
import json, statistics, time
import boto3
rt = boto3.client("bedrock-agent-runtime")
KBS = {"oss": "KBOSS12345", "s3v": "KBS3V12345"} # same documents, same embedding model
CASES = [json.loads(l) for l in open("eval_set.jsonl", encoding="utf-8")]
# one line, e.g.: {"q": "travel expense claim deadline", "expect": "travel-policy.pdf", "group": "all-staff"}
def run(kb_id, case, k=5, search=None):
cfg = {"numberOfResults": k,
"filter": {"equals": {"key": "access_group", "value": case["group"]}}}
if search:
cfg["overrideSearchType"] = search
t = time.perf_counter()
r = rt.retrieve(knowledgeBaseId=kb_id, retrievalQuery={"text": case["q"]},
retrievalConfiguration={"vectorSearchConfiguration": cfg})
ms = (time.perf_counter() - t) * 1000
uris = [x["location"].get("s3Location", {}).get("uri", "") for x in r["retrievalResults"]]
return ms, len(uris), any(case["expect"] in u for u in uris)
for name, kb in KBS.items():
rows = [run(kb, c) for c in CASES]
lat = sorted(r[0] for r in rows)
print(name,
"p50=%.0fms" % statistics.median(lat),
"p95=%.0fms" % lat[int(len(lat) * 0.95) - 1],
"short=%d" % sum(r[1] < 5 for r in rows), # queries that got fewer than 5 results after the filter
"hit=%.2f" % (sum(r[2] for r in rows) / len(rows)))
What to look for in the results:
- Measure first and steady queries separately. With a minimum of 0 or auto-pause, leave the store idle for a while and record the first query on its own. Mixed into the average, it disappears.
- If
shortis not 0, suspect the filter. If the group really has five or more documents and the query did not fill five, the filter is being applied after the search. On Aurora, check the iterative scan setting. - Request hybrid search. If rerunning with
search="HYBRID"gives identical results, that store configuration may be running semantic search only. - Look at a full week of idle cost. Put the same cost allocation tag on both knowledge bases' store resources and compare daily costs in Cost Explorer for a week that includes a quiet weekend.
- Check closed-network behaviour from inside the VPC. Record both that sync and retrieval work from a job server in a subnet with no NAT or internet gateway, and that direct access to the store from outside the VPC is denied.
Checklist
- Closed-network requirement confirmed, decision on excluding third-party services and public domains
- Embedding model, dimensions and vector type (floating point, binary) compatible with the store
- Whether you need hybrid search, the filter operators you will use, metadata size
- Billing units and minimum capacity per store, idle cost, acceptable cold start
- OpenSearch Serverless: network policies (check for overlapping public policies), collection groups and maximum OCU
- Aurora: engine version, pgvector version, indexes and iterative scan, connections that block pausing
- S3 Vectors: encryption type (cannot change after creation), index limits, endpoint policy
- Both candidates compared on one eval set: first and steady latency, results after filters, hybrid difference
- A week of idle cost compared, and in-VPC tests recorded
- Estimated re-ingestion cost and time if you change stores
Supported stores, the scope of hybrid search and filter support, and minimum capacity settings change often. Before you apply any of this, check the vector store prerequisites and query configuration sections of the Amazon Bedrock User Guide, the OpenSearch Serverless capacity and network policy docs, the Aurora Serverless v2 auto-pause docs, the S3 Vectors docs, and each service's pricing page. If you are studying for an exam, the same topics show up on AWS AIP-C01 and SAA-C03: you can practice related questions on cert-bank.
Comments
Post a Comment