AWS Builder Center

Choosing the right ingestion path for Amazon Bedrock Knowledge Bases: parsing, S3 Vectors, latency, and cost

Amazon Bedrock Knowledge Bases can manage the repetitive parts of retrieval-augmented generation (RAG): reading source objects, parsing documents, chunking text, generating embeddings, writing vectors, retrieving relevant chunks, and optionally generating an answer with citations. The difficult design decision is not whether those stages exist. It is choosing the right parser, chunking strategy, embedding model, and vector store for each class of document.

Amazon Bedrock Knowledge Bases can manage the repetitive parts of retrieval-augmented generation (RAG): reading source objects, parsing documents, chunking text, generating embeddings, writing vectors, retrieving relevant chunks, and optionally generating an answer with citations. The difficult design decision is not whether those stages exist. It is choosing the right parser, chunking strategy, embedding model, and vector store for each class of document.
A useful production pattern is to route ordinary text-heavy documents through the Amazon Bedrock default parser and route visually rich documents through either a foundation model (FM) parser or Amazon Bedrock Data Automation (BDA). Both routes can feed one knowledge base backed by Amazon S3 Vectors. This preserves a single retrieval endpoint while avoiding multimodal parsing cost where it is unlikely to improve retrieval quality.
This article builds that architecture with the AWS CLI, explains the trade-offs, shows how to observe ingestion correctly, and develops a pricing model that can be updated when prices or workload assumptions change.
Scope and date. Service capabilities, model availability, quotas, and prices change. The capabilities and public list-price examples in this article were checked on August 9, 2026. Verify the linked AWS documentation and pricing pages in your target AWS Region before deploying. The walkthrough uses placeholders and contains no production or customer data.

The architecture

The design uses three storage resources and two parser-specific data sources:
Amazon Bedrock Knowledge Base
(Titan Text Embeddings V2, 1024D)
|
+----------------------+----------------------+
| |
Data source A: corpus/text/ Data source B: corpus/multimodal/
Default parser FM parser or BDA parser
Fixed chunking Fixed chunking
| |
+----------------------+----------------------+
|
S3 Vectors index
|
Retrieve / RetrieveAndGenerate

Source documents: standard S3 bucket
Extracted visual assets: separate standard S3 bucket
Vectors and metadata: S3 vector bucket and index
 corpus/text/  and  corpus/multimodal/  are ordinary S3 key prefixes—virtual folders—not special Bedrock constructs. Bedrock does not inspect every document and automatically choose a parser. You choose a parsing strategy when creating each data source, so document routing is an application or content-governance responsibility.
A document should normally exist under exactly one parser prefix. Duplicating it across both prefixes creates separate chunks and embeddings, can produce duplicate retrieval results, and increases ingestion and storage cost.
This is hybrid parsing, not hybrid search. In this article, hybrid parsing means using multiple parser-specific data sources in one knowledge base. S3 Vectors supports semantic search with Bedrock Knowledge Bases, but not lexical-plus-semantic hybrid search. If keyword matching or hybrid search is a requirement, evaluate OpenSearch instead.

Choose the parser before choosing the model

Parsing determines what information survives ingestion. Embedding determines how the parsed content is represented for retrieval. A sophisticated embedding model cannot recover a chart, table relationship, or image caption that the parser discarded.
Parser
Best fit
Strengths
Trade-offs and cost model
Bedrock default parser
TXT, Markdown, HTML, Office documents, PDFs, and other supported files whose useful content is primarily machine-readable text
Simple; no parser usage charge; good baseline
Outputs text only; figures, charts, images, and visual table structure can be lost
Foundation model parser
Complex PDFs, scans, tables, diagrams, and documents needing a custom parsing prompt
Multimodal interpretation; model choice; optional custom parsing instructions
Input/output token charges; latency and cost vary with model, page complexity, and generated output
Bedrock Data Automation
Multimodal documents where standardized extraction and predictable document pricing are useful; also supports broader media workflows where available
Managed extraction of text and visual meaning; standardized output; per-page pricing for Knowledge Bases document parsing
Availability varies by Region; separate asynchronous BDA IAM permissions; document parsing is currently page-metered
The default parser is not an inferior setting. It is usually the right economic and operational choice for clean text. Use a multimodal parser when a retrieval question depends on visual layout or content—for example, values inside a chart, labels in a diagram, or relationships in a table.

A routing policy that scales

Start with rules that are deterministic and auditable:
  1. Route  .txt ,  .md , clean HTML, and text-first Office files to  corpus/text/ .
  1. Route scanned PDFs, image-heavy PDFs, reports with charts, and documents with complex tables to  corpus/multimodal/ .
  1. Send ambiguous files to a review queue or a small representative evaluation rather than parsing the entire corpus twice.
  1. Store the selected parser class as object metadata or in a catalog so routing decisions are reproducible.
  1. Revisit the rules with retrieval-quality evidence, not only ingestion speed.
Page count and file size are weak routing signals by themselves. A long text-only PDF may be easy for the default parser, while a short scanned form may require multimodal parsing.

Foundation model parser or BDA?

Choose an FM parser when model selection and custom parsing instructions are important. The billing unit is model input and output tokens, which can be efficient for some documents but variable for heterogeneous content.
Choose BDA when standardized output and a page-based document cost model are attractive. As of the article date, the Bedrock pricing example for BDA integrated with Knowledge Bases uses Standard Output at $0.01 per page. Confirm that BDA parsing and the required profile are available in your Region.
For either choice, evaluate retrieval quality on representative questions. Parsing quality should be measured by whether the correct evidence is retrievable, not by how visually pleasing the parsed text appears.

Choose chunking deliberately

Chunking affects recall, precision, embedding volume, vector storage, query processing, and the context sent to downstream models. Bedrock supports no chunking, fixed-size, hierarchical, semantic, and custom transformation approaches, subject to the selected data source and vector-store constraints.
This walkthrough uses fixed chunks of 512 tokens with 20 percent overlap because the configuration is easy to explain and reproduce. It is a starting point, not a universal optimum.
  • Smaller chunks can improve precision but create more embeddings, vectors, and retrieval candidates.
  • Larger chunks preserve more context but may combine unrelated facts and increase downstream prompt size.
  • Overlap protects facts near boundaries but duplicates content and cost.
  • Hierarchical chunking can improve parent context, but parent-child metadata consumes vector metadata capacity. S3 Vectors documentation specifically warns that very high token counts with hierarchical chunking can exceed metadata limits.
  • Semantic chunking can preserve topical boundaries but adds processing and should be evaluated against a fixed-size baseline.
Parsing strategy type and chunking strategy cannot be changed after the data source is connected. To change either strategy type, create a new data source and reingest. If chunking configuration is omitted, the current Bedrock documentation says content is split into approximately 300-token chunks while preserving sentence boundaries. Set it explicitly when reproducibility matters.

Choose the embedding configuration and vector store together

The walkthrough uses Amazon Titan Text Embeddings V2:
Model ID: amazon.titan-embed-text-v2:0
Dimensions: 1024
Data type: FLOAT32
Normalize: true for direct query examples
Titan Text Embeddings V2 accepts up to 8,192 tokens or 50,000 characters and returns 1,024 dimensions by default. It also supports smaller output sizes; verify current model parameters before changing dimensions. The embedding dimension and data type configured in the knowledge base must match the S3 vector index.
A 1,024-dimensional  float32  vector uses:
1,024 dimensions × 4 bytes = 4,096 bytes
That is the raw vector data only. Keys and metadata add logical storage. Reducing dimensions reduces vector storage and query-processing bytes, but it can also change retrieval quality. It does not automatically imply that the model's token price falls; model inference and vector storage are separate billing dimensions.

S3 Vectors or OpenSearch?

Requirement
S3 Vectors
OpenSearch Serverless / OpenSearch Service
Primary workload
Cost-focused semantic retrieval at scale
Search applications combining vector, text, filters, aggregations, and richer search behavior
Search mode with Bedrock KB
Semantic search
Use when lexical or hybrid search is required and supported by the selected integration
Capacity model
No vector compute fleet to size; storage, writes, query calls, and query bytes are metered
Compute measured in OCUs plus storage; current NextGen Serverless collections can scale indexing and search OCUs to zero after inactivity
Latency posture
Bedrock's S3 Vectors integration documents sub-second cold retrieval and warm latency as low as 100 ms; benchmark your workload
Better fit when the workload needs lower or more controllable search latency and richer search features
Operations
Simple vector bucket/index model
More search configuration and tuning surface
Metadata
Filtering supported, within S3 Vectors and Bedrock KB metadata limits
Richer filtering and document-search capabilities
Cost shape
Closely tied to vector bytes, index size, and query volume
Closely tied to OCU consumption, storage, deployment model, and activity pattern
Do not select a store from storage price alone. Include retrieval features, latency objectives, index size, query rate, filtering complexity, operations, and idle behavior. Also distinguish OpenSearch Serverless NextGen from Classic collections when estimating cost: their minimum-capacity and scale-to-zero behavior differs.

Prerequisites

You need:
  • An AWS account and an AWS CLI version that includes the  s3vectors  commands.
  • Permission to create IAM roles, S3 buckets, S3 vector resources, and Bedrock resources.
  • Model access and Region support for the embedding and parser models you select.
  • A non-sensitive test corpus whose copyright and data-handling terms permit this use.
  •  jq  for the shell examples.
Set environment variables. Choose globally unique standard S3 bucket names:
export AWS_PROFILE="<your-profile>"
export AWS_REGION="<your-region>"
export ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"

export CORPUS_BUCKET="example-kb-corpus-${ACCOUNT_ID}-${AWS_REGION}"
export ASSETS_BUCKET="example-kb-assets-${ACCOUNT_ID}-${AWS_REGION}"
export VECTOR_BUCKET="example-kb-vectors-${ACCOUNT_ID}-${AWS_REGION}"
export VECTOR_INDEX="example-kb-index"
export KB_NAME="example-hybrid-parsing-kb"
export ROLE_NAME="example-bedrock-kb-role"
Use an explicit profile and Region in automation, or export them as above. Do not paste credentials into scripts.

Step 1: Create the source and supplemental S3 buckets

aws s3 mb "s3://${CORPUS_BUCKET}" --region "${AWS_REGION}"
aws s3 mb "s3://${ASSETS_BUCKET}" --region "${AWS_REGION}"

aws s3api put-public-access-block \
--bucket "${CORPUS_BUCKET}" \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true

aws s3api put-public-access-block \
--bucket "${ASSETS_BUCKET}" \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
The corpus bucket contains original documents. The supplemental bucket stores multimodal content extracted during parsing and returned with relevant query results. Configure supplemental storage when creating the knowledge base; it cannot be added later. Use a bucket URI such as  s3://<assets-bucket>/  in  supplementalDataStorageConfiguration .
For production, add versioning, an intentional lifecycle policy, access logging where appropriate, and customer-managed AWS KMS keys if your requirements call for them. Be careful with lifecycle rules: deleting supplemental assets while vectors still reference them can break the retrieval experience.

Step 2: Create the S3 vector bucket and index

aws s3vectors create-vector-bucket \
--vector-bucket-name "${VECTOR_BUCKET}" \
--encryption-configuration '{"sseType":"AES256"}'

aws s3vectors create-index \
--vector-bucket-name "${VECTOR_BUCKET}" \
--index-name "${VECTOR_INDEX}" \
--data-type float32 \
--dimension 1024 \
--distance-metric cosine \
--metadata-configuration '{
"nonFilterableMetadataKeys":[
"AMAZON_BEDROCK_TEXT",
"AMAZON_BEDROCK_METADATA"
]
}' \
--encryption-configuration '{"sseType":"AES256"}'

export VECTOR_BUCKET_ARN="$(aws s3vectors get-vector-bucket \
--vector-bucket-name "${VECTOR_BUCKET}" \
--query 'vectorBucket.vectorBucketArn' --output text)"

export VECTOR_INDEX_ARN="$(aws s3vectors get-index \
--vector-bucket-name "${VECTOR_BUCKET}" \
--index-name "${VECTOR_INDEX}" \
--query 'index.indexArn' --output text)"
Marking  AMAZON_BEDROCK_TEXT  and  AMAZON_BEDROCK_METADATA  non-filterable keeps Bedrock's returned text and internal metadata out of the filterable portion of each vector. This matters because S3 Vectors query processing counts vector data, key bytes, and filterable metadata. Non-filterable metadata is returned with results but is not part of filter evaluation.
If you use AWS KMS instead of SSE-S3, update both resource configuration and IAM/KMS key policies.

Step 3: Create a least-privilege Bedrock service role

The trust policy allows the Bedrock service to assume the role. Before the knowledge base ID exists, the source ARN must use a wildcard; tighten it after creation.
cat > trust-policy.json <<EOF
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"Service": "bedrock.amazonaws.com"},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {"aws:SourceAccount": "${ACCOUNT_ID}"},
"ArnLike": {
"AWS:SourceArn": "arn:aws:bedrock:${AWS_REGION}:${ACCOUNT_ID}:knowledge-base/*"
}
}
}]
}
EOF

aws iam create-role \
--role-name "${ROLE_NAME}" \
--assume-role-policy-document file://trust-policy.json

export KB_ROLE_ARN="arn:aws:iam::${ACCOUNT_ID}:role/${ROLE_NAME}"
Create the permissions policy. The FM parser resource must be replaced with a currently supported model or inference-profile ARN. The BDA statements are needed only if you create a BDA data source.
export PARSER_MODEL_ARN="<supported-parser-model-or-inference-profile-arn>"

cat > kb-role-policy.json <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadCorpusBucket",
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": "arn:aws:s3:::${CORPUS_BUCKET}"
},
{
"Sid": "ReadCorpusObjects",
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": "arn:aws:s3:::${CORPUS_BUCKET}/*"
},
{
"Sid": "UseSupplementalStorage",
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": "arn:aws:s3:::${ASSETS_BUCKET}"
},
{
"Sid": "UseSupplementalObjects",
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"],
"Resource": "arn:aws:s3:::${ASSETS_BUCKET}/*"
},
{
"Sid": "InvokeEmbeddingModel",
"Effect": "Allow",
"Action": ["bedrock:InvokeModel"],
"Resource": "arn:aws:bedrock:${AWS_REGION}::foundation-model/amazon.titan-embed-text-v2:0"
},
{
"Sid": "InvokeFoundationModelParser",
"Effect": "Allow",
"Action": ["bedrock:InvokeModel", "bedrock:GetInferenceProfile"],
"Resource": ["${PARSER_MODEL_ARN}"]
},
{
"Sid": "UseS3VectorIndex",
"Effect": "Allow",
"Action": [
"s3vectors:PutVectors",
"s3vectors:GetVectors",
"s3vectors:DeleteVectors",
"s3vectors:QueryVectors",
"s3vectors:GetIndex"
],
"Resource": "${VECTOR_INDEX_ARN}"
},
{
"Sid": "InvokeBDA",
"Effect": "Allow",
"Action": ["bedrock:InvokeDataAutomationAsync"],
"Resource": [
"arn:aws:bedrock:${AWS_REGION}:aws:data-automation-project/public-rag-default",
"arn:aws:bedrock:${AWS_REGION}::data-automation-profile/*"
]
},
{
"Sid": "ReadBDAStatus",
"Effect": "Allow",
"Action": ["bedrock:GetDataAutomationStatus"],
"Resource": "arn:aws:bedrock:${AWS_REGION}::data-automation-invocation/*"
}
]
}
EOF

aws iam put-role-policy \
--role-name "${ROLE_NAME}" \
--policy-name example-bedrock-kb-access \
--policy-document file://kb-role-policy.json
The official service-role documentation is the source of truth for the complete permission set. Add KMS permissions when using customer-managed keys. If your parser uses cross-Region inference, include the inference-profile and destination model resources required by the current documentation. Remove the FM or BDA statements for parser types you do not deploy.
A common failure mode is granting  bedrock:InvokeModel  but omitting BDA's asynchronous permissions. BDA uses  bedrock:InvokeDataAutomationAsync  and  bedrock:GetDataAutomationStatus ; it is not authorized by an FM parser policy.
Wait for IAM propagation before creating or ingesting resources in an automated test.

Step 4: Create the knowledge base

Create  knowledge-base-configuration.json :
{
"type": "VECTOR",
"vectorKnowledgeBaseConfiguration": {
"embeddingModelArn": "arn:aws:bedrock:<region>::foundation-model/amazon.titan-embed-text-v2:0",
"embeddingModelConfiguration": {
"bedrockEmbeddingModelConfiguration": {
"dimensions": 1024,
"embeddingDataType": "FLOAT32"
}
},
"supplementalDataStorageConfiguration": {
"storageLocations": [{
"type": "S3",
"s3Location": {"uri": "s3://<assets-bucket>/"}
}]
}
}
}
Create  storage-configuration.json :
{
"type": "S3_VECTORS",
"s3VectorsConfiguration": {
"vectorBucketArn": "<vector-bucket-arn>",
"indexArn": "<vector-index-arn>"
}
}
Replace the placeholders, then create the knowledge base:
export KB_ID="$(aws bedrock-agent create-knowledge-base \
--name "${KB_NAME}" \
--description "Hybrid parsing with S3 Vectors" \
--role-arn "${KB_ROLE_ARN}" \
--knowledge-base-configuration file://knowledge-base-configuration.json \
--storage-configuration file://storage-configuration.json \
--query 'knowledgeBase.knowledgeBaseId' --output text)"
After creation, update the role trust policy to replace  knowledge-base/*  with  knowledge-base/${KB_ID}  where practical.

Step 5: Create parser-specific data sources

Both data sources point at the same standard S3 bucket but have mutually exclusive inclusion prefixes.
Create  data-source-text.json :
{
"type": "S3",
"s3Configuration": {
"bucketArn": "arn:aws:s3:::<corpus-bucket>",
"inclusionPrefixes": ["corpus/text/"],
"bucketOwnerAccountId": "<account-id>"
}
}
Create  ingestion-default.json . Omitting  parsingConfiguration  selects the default parser:
{
"chunkingConfiguration": {
"chunkingStrategy": "FIXED_SIZE",
"fixedSizeChunkingConfiguration": {
"maxTokens": 512,
"overlapPercentage": 20
}
}
}
Create the default-parser data source:
export TEXT_DS_ID="$(aws bedrock-agent create-data-source \
--knowledge-base-id "${KB_ID}" \
--name example-text-default-parser \
--description "Text-first documents using the default parser" \
--data-source-configuration file://data-source-text.json \
--data-deletion-policy DELETE \
--vector-ingestion-configuration file://ingestion-default.json \
--query 'dataSource.dataSourceId' --output text)"
Create  data-source-multimodal.json  with the same bucket and a different prefix:
{
"type": "S3",
"s3Configuration": {
"bucketArn": "arn:aws:s3:::<corpus-bucket>",
"inclusionPrefixes": ["corpus/multimodal/"],
"bucketOwnerAccountId": "<account-id>"
}
}
For an FM parser, create  ingestion-fm.json :
{
"chunkingConfiguration": {
"chunkingStrategy": "FIXED_SIZE",
"fixedSizeChunkingConfiguration": {
"maxTokens": 512,
"overlapPercentage": 20
}
},
"parsingConfiguration": {
"parsingStrategy": "BEDROCK_FOUNDATION_MODEL",
"bedrockFoundationModelConfiguration": {
"modelArn": "<supported-parser-model-or-inference-profile-arn>",
"parsingModality": "MULTIMODAL"
}
}
}
Then create the data source:
export MULTIMODAL_DS_ID="$(aws bedrock-agent create-data-source \
--knowledge-base-id "${KB_ID}" \
--name example-multimodal-fm-parser \
--description "Visually rich documents using an FM parser" \
--data-source-configuration file://data-source-multimodal.json \
--data-deletion-policy DELETE \
--vector-ingestion-configuration file://ingestion-fm.json \
--query 'dataSource.dataSourceId' --output text)"
To use BDA instead, create a separate data source with this parsing configuration:
{
"chunkingConfiguration": {
"chunkingStrategy": "FIXED_SIZE",
"fixedSizeChunkingConfiguration": {
"maxTokens": 512,
"overlapPercentage": 20
}
},
"parsingConfiguration": {
"parsingStrategy": "BEDROCK_DATA_AUTOMATION",
"bedrockDataAutomationConfiguration": {
"parsingModality": "MULTIMODAL"
}
}
}
Do not update the FM data source into a BDA data source. Parser strategy type is immutable; create a new data source when testing another strategy. Ensure the selected model, inference profile, or BDA integration is currently supported in the target Region.

Step 6: Upload documents and start ingestion

Use public, synthetic, or otherwise approved test documents:
aws s3 cp ./text-first-document.pdf \
"s3://${CORPUS_BUCKET}/corpus/text/text-first-document.pdf"

aws s3 cp ./visual-document.pdf \
"s3://${CORPUS_BUCKET}/corpus/multimodal/visual-document.pdf"
Start one ingestion job per data source:
export TEXT_JOB_ID="$(aws bedrock-agent start-ingestion-job \
--knowledge-base-id "${KB_ID}" \
--data-source-id "${TEXT_DS_ID}" \
--description "Sync text prefix" \
--query 'ingestionJob.ingestionJobId' --output text)"

export MULTIMODAL_JOB_ID="$(aws bedrock-agent start-ingestion-job \
--knowledge-base-id "${KB_ID}" \
--data-source-id "${MULTIMODAL_DS_ID}" \
--description "Sync multimodal prefix" \
--query 'ingestionJob.ingestionJobId' --output text)"
Poll each job with  get-ingestion-job . Treat  COMPLETE  as a terminal workflow status, not as proof that every document indexed:
aws bedrock-agent get-ingestion-job \
--knowledge-base-id "${KB_ID}" \
--data-source-id "${MULTIMODAL_DS_ID}" \
--ingestion-job-id "${MULTIMODAL_JOB_ID}" \
--query 'ingestionJob.{status:status,startedAt:startedAt,updatedAt:updatedAt,statistics:statistics,failureReasons:failureReasons}'
Always check:
  •  numberOfDocumentsScanned 
  •  numberOfNewDocumentsIndexed 
  •  numberOfModifiedDocumentsIndexed 
  •  numberOfDocumentsDeleted 
  •  numberOfDocumentsFailed 
  •  failureReasons 
A job can be  COMPLETE  while one or more documents failed. A production success condition should require an allowed terminal status and acceptable document statistics, for example  numberOfDocumentsFailed == 0 .

Step 7: Retrieve through the knowledge base

 Retrieve  creates a query embedding and queries the configured vector store:
aws bedrock-agent-runtime retrieve \
--knowledge-base-id "${KB_ID}" \
--retrieval-query '{"text":"What controls are required before deployment?"}' \
--retrieval-configuration '{
"vectorSearchConfiguration": {
"numberOfResults": 5
}
}'
Bedrock returns a relevance score where higher is better, source locations, metadata, and retrieved content. Do not assume score thresholds transfer across embedding models, corpora, or vector stores. Calibrate with labeled questions and expected evidence.
Use  RetrieveAndGenerate  when you also want Bedrock to send retrieved context to a generation model and return an answer with citations. Account separately for generation-model input and output tokens.

Optional: query S3 Vectors directly

Direct querying is useful for diagnostics. First create a query embedding using the same model and dimensions:
cat > query.json <<'EOF'
{
"inputText": "What controls are required before deployment?",
"dimensions": 1024,
"normalize": true
}
EOF

aws bedrock-runtime invoke-model \
--model-id amazon.titan-embed-text-v2:0 \
--content-type application/json \
--accept application/json \
--body fileb://query.json \
embedding.json
Build the S3 Vectors request without copying the 1,024 values by hand:
jq -n \
--arg bucket "${VECTOR_BUCKET}" \
--arg index "${VECTOR_INDEX}" \
--slurpfile embedding embedding.json \
'{
vectorBucketName: $bucket,
indexName: $index,
topK: 5,
queryVector: {float32: $embedding[0].embedding},
returnMetadata: true,
returnDistance: true
}' > direct-query.json

aws s3vectors query-vectors --cli-input-json file://direct-query.json
For cosine distance returned by direct  QueryVectors , lower is better. This differs from the Bedrock  Retrieve  relevance score, where higher is better. Do not compare the raw values as if they used the same scale.

Measure ingestion latency without misleading yourself

Ingestion is asynchronous and multi-stage. A single stopwatch around  StartIngestionJob  measures only the API request, not ingestion. Capture at least five timings:
  1. Upload duration: start and completion of  PutObject  or  aws s3 cp .
  1. Start request duration: client time for  StartIngestionJob .
  1. Service-reported job duration:  updatedAt - startedAt  from the terminal ingestion job.
  1. Client-observed terminal duration: from the successful start response until your poller sees a terminal state.
  1. End-to-end duration: from the beginning of upload until the validated terminal result.
The difference between service-reported and client-observed duration includes polling cadence, network delay, and client processing. Record the poll interval.
Also capture workload and configuration variables that explain the timing:
  • Parser type and exact model or inference profile
  • Region
  • File format and a safe, non-sensitive complexity classification
  • Page count for a public or synthetic corpus
  • Chunking configuration
  • Embedding model and dimensions
  • Number of documents scanned, indexed, modified, deleted, and failed
  • Number of vectors, if obtained through an approved aggregate mechanism
  • Concurrency and quota/throttling events
  • Cold versus repeated runs
Do not compare parsers using different documents. Conversely, do not put duplicate benchmark copies into a production knowledge base, because duplicates distort retrieval. Use an isolated benchmark knowledge base and a public or synthetic corpus.
Run enough repetitions to report a distribution—median, p90, and range—not a single observation. Separate ingestion latency from retrieval latency. AWS documents sub-second cold and as-low-as-100-ms warm retrieval for the Bedrock/S3 Vectors integration, but those are service-level capability statements, not a guarantee for an end-to-end application. Measure your network path, filters, reranking, generation, and response rendering too.

Observability boundaries

The ingestion job gives useful aggregate state but not a trace for every internal parsing, embedding, and vector-write stage. Build an operation record containing:
{
"knowledgeBaseId": "<knowledge-base-id>",
"dataSourceId": "<data-source-id>",
"ingestionJobId": "<ingestion-job-id>",
"parserClass": "default|fm|bda",
"startRequestAt": "<timestamp>",
"terminalObservedAt": "<timestamp>",
"status": "<status>",
"statistics": {},
"failureReasons": []
}
Store identifiers in an access-controlled operational system, not in public reports. Use CloudTrail for API audit where supported, CloudWatch and Bedrock model invocation logging where appropriate, cost allocation tags, and alarms on your ingestion controller. Do not assume internal parser stages will appear as application-visible spans.
Classify failures before retrying:
  • Authorization: missing parser, BDA, S3, KMS, or S3 Vectors permission.
  • Configuration: unsupported model/Region pair, mismatched dimensions, missing supplemental storage, or immutable data-source settings.
  • Document-specific: unsupported/corrupt file, parser limits, or metadata limits.
  • Capacity/transient: throttling, service errors, or network faults.
Blindly retrying an authorization or deterministic document error only adds delay and cost.

Build a transparent cost model

A useful estimate separates one-time or change-driven ingestion from recurring retrieval. Do not hide everything behind a cost-per-document average; it prevents you from seeing which design choice changed the bill.
ingestion_cost =
source_s3_storage_and_requests
+ parser_cost
+ embedding_input_tokens × embedding_input_rate
+ vector_put_logical_GB × vector_put_rate
+ supplemental_asset_storage_and_requests

monthly_retrieval_cost =
query_count × (
query_embedding_cost
+ vector_query_request_cost
+ vector_query_processing_cost
+ optional_reranking_cost
+ optional_generation_model_cost
)
+ vector_storage_GB_month × vector_storage_rate
+ source_and_supplemental_s3_storage
+ logging_and_monitoring

Parser pricing comparison

Parser
Billing basis
Estimation formula
Default
No parser usage charge
 $0 parser charge ; S3, embeddings, vectors, and other services still apply
FM parser
Model input and output tokens
 (input_tokens / price_unit × input_rate) + (output_tokens / price_unit × output_rate) 
BDA parser with Knowledge Bases
Standard Output pages
 pages × regional BDA KB page rate ; the public example checked for this article uses  $0.01/page 
FM output token count depends on content and parsing instructions, so estimate it from a representative approved sample.



For 1,024-dimensional  float32  vectors:
raw_vector_bytes_per_vector = 1,024 × 4 = 4,096 bytes

logical_storage_bytes =
vector_count × (
4,096
+ average_key_bytes
+ average_filterable_metadata_bytes
+ average_nonfilterable_metadata_bytes
)

query_processing_bytes_per_query =
vector_count_in_each_price_tier × (
4,096
+ average_key_bytes
+ average_filterable_metadata_bytes
)
Notice the difference: non-filterable metadata contributes to storage but is not included in the query-processing size described by the pricing page. Measure metadata rather than assuming it is negligible.
S3 Vectors cost grows with both index size and query volume. A low per-GB storage rate does not mean query processing is independent of corpus size. Chunk size, overlap, dimensions, metadata, and duplicate documents all affect the result.

OpenSearch comparison

OpenSearch Serverless separates compute and storage. The current pricing page describes NextGen collections as having no minimum OCU requirement and scaling indexing and search OCUs to zero after 10 minutes of inactivity. Classic collections have different minimums, and vector collections have sharing rules. Public US East examples use $0.24 per OCU-hour, but use the current regional rate and collection type in your estimate.
opensearch_serverless_monthly_cost =
indexing_OCU_hours × regional_OCU_rate
+ search_OCU_hours × regional_OCU_rate
+ managed_storage_GB_month × storage_rate
+ optional_ingestion_or_related_service_costs
S3 Vectors often has the clearer cost model for semantic-only retrieval and large, relatively cold indexes. OpenSearch can justify its compute cost when keyword search, hybrid ranking, richer filters, aggregations, or search tuning are requirements. Run both estimates at expected and peak traffic, including idle periods.

Costs commonly omitted

Include these before approving a design:
  • Standard S3 object storage and PUT/GET/LIST requests
  • Reingestion after parser, chunking, or embedding changes
  • Query embeddings
  • Supplemental multimodal asset storage and requests
  • Reranking queries
  • Generation model input/output tokens for  RetrieveAndGenerate 
  • CloudWatch, CloudTrail data events if enabled, and log retention
  • KMS requests when customer-managed keys are used
  • Data transfer where applicable
  • Development, staging, and benchmark environments
Tag resources and separate parser-specific data sources so cost and quality experiments remain attributable.

Evaluate quality, latency, and cost together

Create a labeled evaluation set covering plain text, tables, charts, diagrams, exact identifiers, unanswerable questions, and metadata filters. For each configuration, record retrieval recall at  k , ranking quality, answer faithfulness when generation is tested, ingestion and retrieval latency distributions, and estimated or observed cost.

Production hardening and cleanup

Before production, restrict the trust policy to the account and final knowledge base ARN; scope S3, S3 Vectors, model, BDA, and KMS permissions; block public bucket access; encrypt data appropriately; and choose  DELETE  or  RETAIN  intentionally. Keep one parser route per document, validate ingestion statistics after every sync, alarm on failed or stalled jobs, retry only transient failures, and avoid logging sensitive source or retrieved content. Store configuration as code and test deletion, reingestion, and embedding-model migration.
For cleanup, delete data sources before the knowledge base, then delete the S3 vector index before its vector bucket. Empty and remove the source and supplemental S3 buckets, then remove the inline IAM policy and role. Wait for asynchronous deletion where required, and preserve retained data when policy requires it.

References

About the author

Hitesh Subnani is a FSI Solutions Architect at AWS India, where he works with customers to design and build architectures that deliver business value. He specializes in comprehensive observability and analytics systems, enabling organizations to gain deep insights from operational data. With expertise in search and analytics technologies.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article