Amazon Bedrock Knowledge Bases Explained (2026): Managed vs Customer-Managed, Setup Step by Step, Pricing, Retrieve vs RetrieveAndGenerate, Metadata Filtering and the Kendra Replacement

Logeshwaran
—

An Amazon Bedrock knowledge base lets an AI model answer questions from your documents: it reads files from places like S3, SharePoint or Confluence, indexes them, and at question time finds the most relevant passages and hands them to the model, which is the technique called RAG (retrieval-augmented generation). Since June 17, 2026 there are two kinds. A Managed Knowledge Base runs everything for you, including the vector storage, embeddings and syncing, and costs $5 per GB of raw data per month plus $1 per 1,000 searches (parsing, embeddings and re-ranking are included). A customer-managed knowledge base lets you pick the vector store (OpenSearch Serverless, S3 Vectors, Aurora PostgreSQL, Neptune Analytics for GraphRAG, Pinecone, Redis or MongoDB Atlas), the embeddings model and the chunking, and you pay for each of those pieces separately. For most new projects, use the managed type; customer-managed is for teams that need a specific vector store, model or GraphRAG. Below: how it works, the two types side by side, setup step by step, real cost math, Retrieve vs RetrieveAndGenerate with Python, metadata filtering, why answers come back wrong, and what replaces Amazon Kendra, which closed to new customers on July 30, 2026.

Jake's company had a 300-page employee handbook, forty policy PDFs and a Confluence space nobody could search. Every Monday, the same five questions landed in the HR inbox. "Can the AI just read all of it?" Jake asked. Ethan had built exactly that in March, the hard way: an OpenSearch collection, an embeddings model, a chunking strategy and a sync job. In October he built it again with a Managed Knowledge Base, and it took an afternoon. "Same answers," Ethan said. "Fewer moving parts. The interesting question now is which one you actually need."

Update, October 19, 2026: the boto3 details for querying, including Managed Knowledge Bases. If you moved to a Managed Knowledge Base and kept your retrieve_and_generate code, every call fails with a ValidationException: that call cannot be used with managed knowledge bases. Use retrieve() for passages, or agentic_retrieve_stream() for a streamed, multi-step answer. A minimal agentic call:

import boto3
kb = boto3.client("bedrock-agent-runtime", region_name="eu-west-2")
response = kb.agentic_retrieve_stream(
    agenticRetrieveConfiguration={"foundationModelType": "MANAGED"},
    messages=[{"role": "user", "content": {"text": "Compare the US and UK leave policies."}}],
    retrievers=[{"configuration": {"knowledgeBase": {"knowledgeBaseId": "KB12345678"}},
                 "description": "Employee handbooks"}],
    userContext={"userId": "jane@example.com"},
)
for event in response["stream"]:
    if "responseEvent" in event:
        print(event["responseEvent"]["text"], end="", flush=True)

List several retrievers (one per knowledge base, each with a plain-English description) and the planner decides where to look. generateResponse=False returns passages only, maxAgentIteration caps the number of search rounds (and the cost), foundationModelType CUSTOM with your own model ARN replaces the default model, and userContext limits results to documents that person can open at the source.

On customer-managed knowledge bases, three retrieve_and_generate options are worth adding to the example above. Pass the sessionId from the first response into the next call for follow-up questions (Bedrock creates the ID; you cannot set it). Add generationConfiguration with a promptTemplate containing the $search_results$ placeholder to control tone and refusals, and a guardrailConfiguration to attach a guardrail. For a chat window, retrieve_and_generate_stream() takes the same arguments and streams the answer.

Permissions for the app's role: bedrock:Retrieve and bedrock:RetrieveAndGenerate on the knowledge base ARN, plus bedrock:InvokeModel (and bedrock:GetInferenceProfile) on the answering model or inference profile. A ResourceNotFoundException usually means the client was created in a different Region from the knowledge base.

New on October 19, 2026: retrieval instructions, a reusable resource you reference from agentic_retrieve_stream. One instruction holds up to four fields (retrieval guidance, persona, answer format and answer policy, such as "answer only from the retrieved documents"), Bedrock reviews it before it becomes active, and you can pin a numbered version so an update never changes a live application by surprise. It saves repeating the same rules in every request.

⚡ Quick Answer

• What it is: managed RAG; your documents in, grounded answers with citations out. How it works.

• Which type: Managed for most projects; customer-managed for your own vector store, model or GraphRAG. Compare.

• Cost: managed is $5 per GB per month plus $1 per 1,000 retrievals; 50 GB and 100,000 searches is about $350 a month. Pricing.

• Query it: Retrieve for passages, RetrieveAndGenerate for a finished answer. Python.

Also: setup steps · metadata filtering · bad answers · Kendra replacement · errors.

New to Bedrock? Start with our plain-English Bedrock guide, and keep the Bedrock pricing guide nearby, because the model that writes answers is billed separately from the knowledge base.

🧭 NEW HERE? READ THESE FIRST

New to Amazon Bedrock, its endpoints or AgentCore? These five pages give you the words this one uses:

📌 Bookmark this; the type comparison and the cost math are the parts you will come back for.

How a Bedrock knowledge base works

A large language model knows what it learned in training, which does not include your handbook. A knowledge base closes that gap in two phases:

  1. Ingestion (once, then on every sync). The knowledge base reads your files, extracts the text (and, with the right parser, tables and images), splits it into chunks of a few hundred words, turns each chunk into an embedding (a list of numbers that captures its meaning), and stores those embeddings in a vector store.
  2. Retrieval (on every question). Your question is turned into an embedding too, and the vector store returns the chunks whose meaning is closest. Hybrid search adds ordinary keyword matching, which helps with names, codes and part numbers. A re-ranker can then reorder the results so the best passage comes first.

What happens next is your choice. You can take the passages and build your own prompt (the Retrieve API), or let Bedrock send them to a model and return a finished answer with citations (RetrieveAndGenerate on customer-managed knowledge bases, or the agentic retrieval API on managed ones). Either way, the model answers from your documents rather than from memory, and you can show the reader which page the answer came from.

"So it is not training the model on our handbook," Jake said. "No," said Ethan. "It is handing the model the right three pages, every time someone asks. Change the handbook, sync, and tomorrow's answers change with it."

Managed vs customer-managed knowledge bases

The Managed Knowledge Base arrived on June 17, 2026. The original kind, now called customer-managed, did not go away. Here is how they differ:

Managed Knowledge BaseCustomer-managed knowledge base
Vector storeBuilt in, run by AWSYou choose: OpenSearch Serverless or managed clusters, S3 Vectors, Aurora PostgreSQL, Neptune Analytics, Pinecone, Redis Enterprise Cloud, MongoDB Atlas
Embeddings modelManaged, included in the priceYou choose (Titan, Cohere and others) and pay per token
Parsing and chunkingAutomatic parser per file type; managed chunking defaults with per-document overridesFull control: default, foundation model or Data Automation parsers; fixed, hierarchical, semantic or no chunking
Data sourcesS3, SharePoint, Confluence, Google Drive, OneDrive, web crawler, Salesforce, Zendesk, with automatic syncS3 and other connectors; you start syncs yourself or on a schedule you build
Search featuresHybrid search, built-in re-ranking, agentic retrieval for multi-step questionsSemantic or hybrid (store-dependent), optional paid re-ranking, GraphRAG with Neptune Analytics
Pricing$5 per GB per month + $1 per 1,000 retrievalsVector store + embedding tokens + model tokens + optional re-ranking
RegionsUS East (N. Virginia), US West (Oregon), Sydney, Tokyo, Dublin, Frankfurt, London, GovCloud (US-West)Most Bedrock Regions

Choose managed when you want a working assistant over company documents quickly, your data lives in the connected sources, and you would rather not run a vector database. Choose customer-managed when you already run OpenSearch or Aurora and want the vectors there, when you need a specific embeddings model or dimension, when you need GraphRAG over connected entities, when you need fine control over chunking for unusual documents, or when your Region does not offer the managed type yet.

The managed type also brings per-user permissions for the enterprise connectors: pass the asking user's identity with each request, and results only include documents that person could open in SharePoint, Confluence or Drive. That one feature is hard to build yourself. Two cautions come with it: the web crawler has no document permissions, and if your code forgets to pass the user, no per-user filtering happens.

Knowledge base, fine-tuning or a long prompt: which do you need?

Before you build anything, check that a knowledge base is the right tool. There are three common ways to make a model "know" your material, and they solve different problems:

ApproachWhat it doesBest whenWeak when
Knowledge base (RAG)Finds relevant passages at question time and hands them to the modelLarge or changing document sets, answers that need citations, per-user permissionsQuestions that need reasoning across the whole library at once
Long promptPastes the whole document into every requestOne or a few documents that fit in the model's context windowHundreds of files, high volume (you pay for every token, every time)
Fine-tuningTrains a custom model on examplesTeaching a style, format or narrow taskFacts that change; it does not give sources and must be retrained to update

For "answer questions from our documents," a knowledge base wins almost every time: your documents can change daily, every answer can point to its source page, and you never retrain anything. A long prompt is fine for a single contract or a short manual. Fine-tuning is for how the model answers, not what it knows, and the two combine well: a fine-tuned model can still read from a knowledge base.

Jake's first idea had been to "train the AI on the handbook." Ethan's answer was the table above. "Training teaches it how to talk," he said. "The knowledge base gives it something true to talk about."

Bedrock knowledge base pricing, with real numbers

Managed Knowledge Base. Three meters, and several things that are free:

ItemPrice
Index storage$5.00 per GB of raw data per month
Standard retrieval (Retrieve API)$1.00 per 1,000 calls
Agentic retrieval$4.00 per 1,000 calls, plus $1.00 per 1,000 underlying retrievals
Parsing, managed embeddings, managed re-ranking$0

So a support assistant over 50 GB of documents that runs 100,000 searches a month costs $250 for storage plus $100 for retrieval, $350 a month. A research assistant making 100,000 agentic calls a month, each doing two underlying searches, over the same 50 GB costs $250 + $400 + $200 = $850. Jake's handbook project, about 2 GB of PDFs and maybe 5,000 questions a month, comes to roughly $10 + $5 = $15 a month for the knowledge base. Note that "raw data" means the size of your source files, not the size of the index.

What is not included: the model that writes the answer. If you send retrieved passages to a model to write the answer, those input and output tokens are billed at normal Bedrock rates, and the passages count as input tokens. Five passages of 300 words each add roughly 2,000 input tokens to every question, which often costs more than the retrieval itself at high volume. CloudWatch logs and any AgentCore tool calls are billed separately too.

Customer-managed knowledge base. There is no knowledge base fee as such; you pay for the parts:

  • The vector store, usually the biggest line. OpenSearch Serverless bills a minimum amount of compute that runs even when nobody asks anything; see our OpenSearch price guide. S3 Vectors is built for low cost when queries are infrequent, and Aurora PostgreSQL makes sense if you already run it.
  • Embedding tokens, charged when documents are ingested and again for each question.
  • Generation tokens for RetrieveAndGenerate.
  • Re-ranking, if you turn it on: Cohere Rerank 3.5, for example, is $2.00 per 1,000 queries.
  • Parsing with a foundation model or Bedrock Data Automation, if you choose those parsers for complex PDFs.

For small projects, the managed type is usually cheaper simply because it has no idle vector store. For large, steady workloads with an existing database, customer-managed can win. Run both numbers before you decide.

How to create a knowledge base, step by step

Before you start, put your documents somewhere the knowledge base can read, an S3 bucket being the simplest, and make sure your account can use the models you plan to call. Our Bedrock AccessDeniedException guide covers model access if a test query fails.

A Managed Knowledge Base in the console:

  1. Open the Amazon Bedrock console in a supported Region and go to Knowledge Bases.
  2. Choose to create a managed knowledge base and give it a name.
  3. Add a data source: pick S3 and the bucket or prefix, or a connector such as SharePoint or Confluence and sign in. For those three, you can now sign in as yourself instead of asking an administrator for app credentials.
  4. Set the sync schedule so changed documents are picked up automatically.
  5. Create, then wait for the first sync to finish. Large sources take a while; the console shows progress and any files that failed.
  6. Test in the console's test panel with real questions from your users, and read the sources it cites.

A customer-managed knowledge base adds three decisions:

  1. Vector store. Let the console quick-create one (for example an OpenSearch Serverless collection or an S3 vector index), or point it at one you created.
  2. Embeddings model and dimensions. Titan Text Embeddings V2 supports 1,024, 512 or 256 dimensions; Cohere Embed models use 1,024. The vector index must be created with the same number of dimensions, and you cannot change the model later without re-indexing everything.
  3. Parsing and chunking. The default parser handles plain text well. Choose a foundation model parser or Bedrock Data Automation for scanned PDFs, tables and slides. For chunking, the default splits text into chunks of about 300 tokens; hierarchical chunking helps long structured documents, and semantic chunking keeps related sentences together.

Then add the data source and run the first sync (an ingestion job). Customer-managed knowledge bases do not sync on their own: after you add or change files, start a sync from the console, with StartIngestionJob in the API, or on a schedule with EventBridge Scheduler. A sync only processes files that changed since the last one.

Ethan's rule for Jake: "Write down twenty real questions before you build anything. They are your test, your demo and your proof that it works."

Chunking and parsing: the settings that decide answer quality

On a customer-managed knowledge base, two settings you choose at creation shape every answer you will get, and changing them later means re-ingesting everything. On a managed knowledge base, AWS picks sensible defaults, but knowing what they do helps you understand odd results.

Chunking decides how your documents are cut into the pieces that get searched:

  • Default chunking splits text into chunks of about 300 tokens, a few paragraphs each. It is a good start for policies, FAQs and articles.
  • Fixed-size chunking lets you set the size and the overlap between neighboring chunks. Larger chunks keep more context together; overlap stops a sentence that sits on a boundary from being split in half.
  • Hierarchical chunking creates small child chunks for precise matching and larger parent chunks that are returned for context. It suits long, structured documents such as manuals and contracts, where the exact match is a sentence but the answer needs the whole section.
  • Semantic chunking splits where the meaning changes rather than at a fixed length, which helps with documents whose sections vary a lot in size.
  • No chunking treats each file as one chunk. Use it only when you have already split your content into small, self-contained files, such as one FAQ entry per file.

Parsing decides how text is pulled out of each file. The default parser reads the text layer of documents, which is enough for most Word files, HTML and text-based PDFs. Scanned PDFs, slides, complex tables and charts need more: a foundation model parser or Bedrock Data Automation reads the page visually and turns tables into structured text, at an extra cost per page. The managed knowledge base picks a parser for each file type automatically and includes parsing in its price.

A practical way to choose: ingest twenty representative files with the default settings, run your test questions with Retrieve, and read the chunks that come back. If answers are cut off mid-table, try hierarchical chunking or a stronger parser. If the right passage is buried in a chunk full of unrelated text, try smaller chunks. You learn more from reading ten retrieved chunks than from any amount of theory.

Connecting SharePoint, Confluence and other sources

Connectors are where most first projects stall, usually on permissions rather than on Bedrock itself. Before you connect a source, settle these points with whoever owns it:

  • How you sign in. SharePoint, OneDrive and Confluence can now connect with your own account (a user-managed sign-in) instead of an app registration that only an administrator can create. That gets a pilot running quickly; for production, a dedicated service account owned by IT is easier to keep working when people leave.
  • What gets indexed. Point the connector at specific sites, spaces or folders, not the whole tenant. A narrower scope means faster syncs, lower storage cost and fewer surprising answers from forgotten pages.
  • Who may see what. The managed connectors carry document permissions, so pass each user's identity at query time and test with accounts that have different access. Do this before launch, not after someone finds a salary spreadsheet in an answer.
  • How fresh it must be. A nightly sync suits handbooks; a support knowledge base updated hourly may need a tighter schedule. Each sync only processes changes, so frequent syncs of a stable source are cheap.
  • What happens to deleted pages. When a page is removed at the source, the next sync removes it from the index. Archived-but-not-deleted pages stay searchable, which is a common reason for outdated answers.

Salesforce and Zendesk connectors joined the managed type in September 2026, which matters most for support teams: knowledge articles and community posts can feed an agent-assist tool directly, without exporting them to S3 first.

Defining it in code. Customer-managed knowledge bases and their data sources are available as CloudFormation resources (AWS::Bedrock::KnowledgeBase and AWS::Bedrock::DataSource), so CDK and Terraform users can version them like any other infrastructure. Keep the vector index definition, the embeddings model and the chunking settings in the same stack: they must match, and changing one of them later means rebuilding the index anyway.

Retrieve vs RetrieveAndGenerate, with Python

Both calls go to the bedrock-agent-runtime client, not the regular bedrock-runtime one; our Bedrock endpoints guide explains why there are several. Retrieve returns passages and lets you write the prompt yourself:

import boto3
kb = boto3.client("bedrock-agent-runtime", region_name="us-east-1")

resp = kb.retrieve(
    knowledgeBaseId="KB12345678",
    retrievalQuery={"text": "How many vacation days do new employees get?"},
    retrievalConfiguration={"vectorSearchConfiguration": {"numberOfResults": 5}},
)
for r in resp["retrievalResults"]:
    print(round(r["score"], 3), r["location"], r["content"]["text"][:200])

RetrieveAndGenerate, on customer-managed knowledge bases, does the search and the answer in one call and returns citations:

resp = kb.retrieve_and_generate(
    input={"text": "How many vacation days do new employees get?"},
    retrieveAndGenerateConfiguration={
        "type": "KNOWLEDGE_BASE",
        "knowledgeBaseConfiguration": {
            "knowledgeBaseId": "KB12345678",
            "modelArn": "MODEL_OR_INFERENCE_PROFILE_ARN",
        },
    },
)
print(resp["output"]["text"])
for c in resp["citations"]:
    for ref in c["retrievedReferences"]:
        print("source:", ref["location"])

Which one should you use?

  • Retrieve when you want control: your own prompt, your own model call, your own refusal rules ("if the passages do not answer it, say so"), or when you combine knowledge base results with other data.
  • RetrieveAndGenerate for the fastest working assistant with citations. Pass the returned session ID on follow-up questions so it remembers the conversation.
  • Agentic retrieval on managed knowledge bases for questions that need several searches, such as "compare the leave policy in the US and UK handbooks." It plans the searches, checks interim results and re-ranks before answering, and costs more per call.

Managed knowledge bases use the same Retrieve call with their own search settings, plus a userContext that carries the user's identity for permission filtering. Agentic retrieval has its own streaming API, AgenticRetrieveStream.

A simple document chatbot, end to end

Here is the smallest production-shaped design you can build on a knowledge base, the one Ethan used for Jake's HR assistant:

  1. Documents live in SharePoint and an S3 bucket, connected to a managed knowledge base with a nightly sync.
  2. A Lambda function receives the user's question, calls Retrieve (passing the user's identity so permissions apply), builds a prompt from the top passages, and calls a model through the Bedrock runtime.
  3. API Gateway puts an HTTPS endpoint in front of the function, with your company sign-in protecting it.
  4. A small web page or chat integration sends questions and shows answers with their source links.
import boto3, json
kb = boto3.client("bedrock-agent-runtime")
llm = boto3.client("bedrock-runtime")

def handler(event, context):
    q = json.loads(event["body"])["question"]
    hits = kb.retrieve(knowledgeBaseId="KB12345678", retrievalQuery={"text": q},
                       retrievalConfiguration={"vectorSearchConfiguration": {"numberOfResults": 5}})["retrievalResults"]
    passages = "\n\n".join(h["content"]["text"] for h in hits)
    prompt = ("Answer only from the passages below. If they do not contain the answer, say you could not find it.\n\n"
              f"Passages:\n{passages}\n\nQuestion: {q}")
    out = llm.converse(modelId="MODEL_OR_INFERENCE_PROFILE_ID",
                       messages=[{"role": "user", "content": [{"text": prompt}]}])
    answer = out["output"]["message"]["content"][0]["text"]
    return {"statusCode": 200, "body": json.dumps({"answer": answer, "sources": [h["location"] for h in hits]})}

Three details make this work in practice. The instruction to answer only from the passages, and to say so when they do not contain the answer, cuts made-up answers sharply. Returning the sources lets your users check the answer themselves, which is what builds trust. And logging each question with the passages used gives you the material for the weekly review that keeps quality high. The function's role needs permission to call Retrieve on that knowledge base and to invoke the chosen model, nothing more.

If you prefer fewer moving parts, RetrieveAndGenerate replaces the middle of that function with one call, at the price of less control over the prompt. Many teams start with RetrieveAndGenerate, then move to Retrieve plus their own prompt once they know what they want to change.

Structured data: asking questions of a database

Not every answer lives in a document. "How many people joined in March?" lives in a database. Customer-managed knowledge bases can connect to a structured data store such as Amazon Redshift: when a question arrives, Bedrock generates a SQL query from it, runs the query, and returns the result to use in the answer. This is billed per SQL generation request, on top of what the database itself costs.

It works best when your tables have clear names and column descriptions, because the model writes better SQL when it understands the schema. Give the knowledge base a database user with read-only access to just the tables it needs, and test with the questions people really ask: generated SQL can be correct for an obvious question and wrong for a subtle one, so check results against reports you already trust before you let anyone rely on them.

Metadata filtering: answers from the right documents

When a knowledge base holds documents for several teams, countries or years, plain semantic search can return a passage from the wrong one. Metadata filtering fixes that. For S3 data sources, add a small JSON file next to each document, named after it with .metadata.json on the end:

# s3://hr-docs/uk/leave-policy.pdf.metadata.json
{
  "metadataAttributes": {
    "country": "uk",
    "department": "hr",
    "year": 2026
  }
}

Sync, then filter at query time:

retrievalConfiguration={"vectorSearchConfiguration": {
    "numberOfResults": 5,
    "filter": {"andAll": [
        {"equals": {"key": "country", "value": "uk"}},
        {"greaterThanOrEquals": {"key": "year", "value": 2025}}
    ]}
}}

Operators include equals, notEquals, in, greaterThan, lessThan, startsWith and the combiners andAll and orAll. A few store-specific limits matter: S3 Vectors allows up to 1 KB of custom metadata and 35 keys per vector; on OpenSearch managed clusters, custom filter fields must be mapped as keyword fields, or filters fail with a "Rewrite first" error; and MongoDB Atlas needs the filter fields declared in its vector index before filtering works.

Jake's company had separate US and UK handbooks that disagreed about vacation days. Before filtering, the assistant gave UK staff the US answer about a third of the time. After adding a country attribute and filtering on the asker's office, it stopped.

Why the answers are wrong, and how to fix them

Most bad answers come from retrieval, not from the model. Test with Retrieve first: if the right passage is not in the top five results, no model can answer correctly.

What you seeLikely causeFix
"I could not find an answer" for something that is clearly in the filesSync not run or failed, or file skipped by the parserCheck the last sync's failed files; use a stronger parser for scans and tables
Answer is from an old version of a policyOld and new files both indexedDelete superseded files at the source and sync; filter on a year attribute
Answer mixes two documentsSimilar passages from different teams or countriesMetadata filtering
Misses product codes or namesPure semantic searchHybrid search, and re-ranking
Answer cut off mid-table or mid-listChunks too small for the structureHierarchical or larger chunks; a parser that keeps tables
Confident answer not supported by the sourcesModel filling gapsPrompt it to answer only from the passages; show citations; add a guardrail

Bedrock also offers evaluation for knowledge bases, which scores retrieval and answers against a set of questions; it is billed at normal usage rates. The twenty real questions from the setup step make a good first evaluation set.

Kendra is closed to new customers: what to use instead

Amazon Kendra, the older AWS enterprise search service, entered maintenance mode on June 30, 2026 and closed to new customers on July 30, 2026. Existing customers keep bug fixes and security updates, but no new features are coming, and Bedrock Knowledge Bases is the suggested path for similar work. Our 2026 retired services list covers what "closed to new customers" means in practice.

If you are moving from Kendra, the Managed Knowledge Base is the closest match: connectors to the same kinds of sources, automatic sync, hybrid search, and per-user document permissions for the enterprise connectors. Three things to check before you plan the move:

  • Connectors: confirm every source you index in Kendra has a connector in the managed type, or plan to land that data in S3.
  • Permissions: test that per-user filtering returns what each kind of user should see, with the user identity passed on every call.
  • Search page vs assistant: Kendra often powered a search results page. A knowledge base can do the same with Retrieve alone, without generating an answer, which also keeps costs down.

Common knowledge base errors

  • AccessDeniedException on sync: the knowledge base's service role cannot read the S3 bucket, decrypt its KMS key, or reach the vector store. Add the missing permission to the role, not to your own user.
  • AccessDeniedException on RetrieveAndGenerate: no access to the generation model, or the model ARN is for a different Region. See our AccessDenied guide and the model IDs list.
  • Dimension mismatch when creating a customer-managed knowledge base: the vector index was created with a different number of dimensions than the embeddings model produces. Recreate the index with matching dimensions.
  • Files fail during ingestion: the file is too large, password-protected, an unsupported type, or its metadata file is malformed JSON. The sync details list each failed file and the reason.
  • ThrottlingException: too many requests for your quota; add retries with backoff and see our throttling guide.
  • New documents not found: on customer-managed knowledge bases, no sync ran after the upload.
  • OpenSearch managed cluster cannot be selected: knowledge bases need the domain to have public access; domains inside a VPC are not supported as the vector store.

Knowledge bases with agents and AgentCore

A knowledge base is often one tool among several in an AI agent: the agent decides when to search the handbook, when to call an HR system and when to just answer. Managed knowledge bases connect natively to Amazon Bedrock AgentCore, the platform for running agents in production, with permissions generated automatically and built-in observability. If you are new to it, our plain-English AgentCore guide explains the pieces.

Whether you use an agent or a simple app, the same habits keep a knowledge base useful: keep the source documents current, delete what is superseded, log which passages were used for each answer, and review the questions that got poor answers every week. The knowledge base is only as good as the library behind it.

Where your data goes, and keeping costs predictable

The first question your security team will ask is where the documents go. With a knowledge base, your content is processed and stored in the AWS Region you choose, in your account, and encrypted; you can use your own KMS keys for the data sources and, on customer-managed knowledge bases, for the vector store. Bedrock does not use your prompts or your documents to train the base models. If you need traffic to stay off the internet entirely, call Bedrock through VPC interface endpoints from your private subnets.

The second question is cost, and the honest answer is that the knowledge base is rarely the expensive part once usage grows. Your bill usually ranks like this:

  1. The generation model, because every question sends several passages as input tokens. Choose the smallest model that answers well, keep the number of passages modest (five is often enough), and cache answers to repeated questions.
  2. The vector store on customer-managed knowledge bases, especially one that bills a minimum when idle.
  3. Retrievals and storage on managed knowledge bases, which grow predictably with questions and gigabytes.

Set an AWS Budgets alert on Bedrock spend from day one, tag each knowledge base with its project, and look at the cost per question every month. If your cost per question climbs, the cause is almost always longer prompts or a larger model, not the knowledge base. Jake's HR assistant costs less per month than one hour of the HR team's time, which is the comparison that got it approved.

For IT admins: running knowledge bases safely

  • Least-privilege service roles: read-only on the exact buckets and prefixes, decrypt only on the keys used.
  • Pass user identity on every managed retrieval that should respect document permissions, and test with low-privilege accounts.
  • Keep sensitive documents out unless permissions are enforced; the web crawler and plain S3 sources carry no per-user permissions.
  • Guardrails on generated answers block topics or sensitive information; on agentic retrieval, guardrails support blocking but not masking.
  • Cost alarms on Bedrock spend, with tags per knowledge base, so a runaway agent loop shows up in a day, not a month.
  • CloudWatch metrics need permission: grant cloudwatch:PutMetricData where required, or metrics silently go missing.

A knowledge base that answers from the right documents, for the right person, at a known cost, is worth more than a clever demo that nobody trusts by week three.

Bedrock knowledge bases: frequently asked questions

What is an Amazon Bedrock knowledge base?

A managed RAG feature: it indexes your documents and, at question time, retrieves the most relevant passages so a model can answer from them with citations.

Is a Bedrock knowledge base RAG?

Yes. It handles the retrieval part of retrieval-augmented generation, and can also generate the answer for you.

What is the Bedrock Managed Knowledge Base?

A fully managed type launched June 17, 2026 that runs the vector storage, embeddings, parsing, re-ranking and connector syncing for you.

How much does a Bedrock knowledge base cost?

Managed: $5 per GB of raw data per month plus $1 per 1,000 retrievals; agentic retrieval is $4 per 1,000 calls plus the underlying retrievals. Customer-managed: you pay for the vector store, embedding and model tokens, and optional re-ranking.

Is a Bedrock knowledge base a vector database?

No. It uses one. The managed type includes its own; the customer-managed type stores vectors in a store you choose.

Which vector stores does a Bedrock knowledge base support?

For customer-managed: OpenSearch Serverless, OpenSearch managed clusters, S3 Vectors, Aurora PostgreSQL, Neptune Analytics, Pinecone, Redis Enterprise Cloud and MongoDB Atlas.

What is the difference between Retrieve and RetrieveAndGenerate?

Retrieve returns the matching passages. RetrieveAndGenerate also sends them to a model and returns a finished answer with citations.

How do I sync a Bedrock knowledge base?

Managed knowledge bases sync on the schedule you set. Customer-managed ones sync when you start an ingestion job from the console, the StartIngestionJob API or a scheduled job.

Can a Bedrock knowledge base read SharePoint or Confluence?

Yes. The managed type has native connectors for SharePoint, Confluence, Google Drive, OneDrive, Salesforce, Zendesk, S3 and a web crawler.

How do I add metadata for filtering?

For S3, add a file named after the document with .metadata.json on the end, containing a metadataAttributes object, then sync and filter at query time.

Bedrock knowledge base vs Kendra: which should I use?

Kendra closed to new customers on July 30, 2026 and is in maintenance mode, so new projects should use Bedrock Knowledge Bases.

Bedrock knowledge base vs OpenSearch: what is the difference?

OpenSearch is a search engine and vector store. A knowledge base is the managed pipeline around a vector store; a customer-managed knowledge base can use OpenSearch as its store.

Which embeddings model should I use?

On managed knowledge bases the model is managed for you. On customer-managed ones, Titan Text Embeddings V2 and Cohere Embed are common choices; the vector index dimensions must match the model.

Does a Bedrock knowledge base support GraphRAG?

Yes, with a customer-managed knowledge base using Neptune Analytics as the store.

Why does my knowledge base give wrong answers?

Usually retrieval: an unsynced or failed file, outdated documents still indexed, missing metadata filters, or chunks that split tables. Test with Retrieve first.

Can I use a Bedrock knowledge base from Python?

Yes, with boto3's bedrock-agent-runtime client and its retrieve and retrieve_and_generate methods.

Does the knowledge base respect document permissions?

The managed type filters results by the user's permissions for enterprise connectors when you pass the user context. The web crawler and plain S3 sources have no per-user permissions.

Should I use a knowledge base or fine-tuning?

A knowledge base for answering from documents that change, with citations. Fine-tuning for teaching a style or a narrow task. They can be combined.

What chunking strategy should I use?

Start with default chunking of about 300 tokens. Use hierarchical chunking for long structured documents, semantic chunking for uneven sections, and test with real questions.

How do I test a Bedrock knowledge base?

Use the console test panel or the Retrieve API with twenty real questions, read the passages returned, and check the cited sources before judging the generated answers.

Does Bedrock use my documents to train models?

No. Your documents and prompts are not used to train the base models, and your data stays in the Region and account you choose.

Can a knowledge base answer questions from a database?

Yes. Customer-managed knowledge bases can connect to structured stores such as Amazon Redshift and generate SQL to answer questions, billed per SQL generation request.

Which Regions offer the Managed Knowledge Base?

US East (N. Virginia), US West (Oregon), Sydney, Tokyo, Dublin, Frankfurt, London and GovCloud (US-West).

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: AI Practitioner (AIF-C01) • AI Business Strategist (AIB-C01) • Machine Learning Engineer – Associate (MLA-C02).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. A company wants a chatbot that answers from its internal documents without retraining a model. Which technique and service fit?

Retrieval-augmented generation (RAG) with Amazon Bedrock Knowledge Bases.

2. What is the main advantage of RAG over fine-tuning for frequently changing documents?

New or changed documents become available after a sync, with no retraining, and answers can cite their sources.

3. What does an embeddings model do in a knowledge base?

It converts text chunks and questions into vectors so semantically similar passages can be found.

4. Users in the UK keep getting answers from the US handbook. What is the fix?

Add metadata (for example a country attribute) to the documents and apply a metadata filter at query time.

5. Which API returns a generated answer with citations from a customer-managed knowledge base in one call?

RetrieveAndGenerate.

6. Search results miss exact product codes. Which retrieval option helps?

Hybrid search, which combines keyword matching with semantic search, optionally followed by re-ranking.

7. A team needs answers that follow relationships between entities across documents. Which option fits?

GraphRAG with a customer-managed knowledge base on Amazon Neptune Analytics.

8. Amazon Kendra closed to new customers in July 2026. Which service should new enterprise retrieval projects use instead?

Amazon Bedrock Knowledge Bases.

Exam codes and dates change often. Our AWS certification changes page and our guide to the AI Business Strategist exam keep track of what is current.

The HR inbox still gets questions on Mondays, Jake reports, just not the same five. Those now go to the assistant, which answers with the handbook page attached. The questions that reach a person are the ones that should.

📌 If you keep one line from this page

A Bedrock knowledge base is managed RAG over your documents. Start with the Managed type at $5 per GB per month plus $1 per 1,000 searches, move to customer-managed only when you need your own vector store, model or GraphRAG, and test retrieval before you blame the model.

Managed since June 17, 2026 · Kendra closed to new customers July 30, 2026 · metadata filters for multi-team libraries · pass user context for permissions.

Revision note. Written October 18, 2026, covering the Managed Knowledge Base (generally available June 17, 2026), its Salesforce and Zendesk connectors (September 23, 2026) and the Kendra closure. "A library is not a luxury but one of the necessities of life," Henry Ward Beecher wrote; a knowledge base is a library that finally answers back.

Related