airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Support Managed Knowledge Bases in BedrockCreateKnowledgeBaseOperator

Open yamakazushi opened this issue 2 months ago • 4 comments

Description

Amazon Bedrock Managed Knowledge Bases reached general availability on 2026-06-17. It is a fully managed RAG offering: Bedrock owns the vector store, the ingestion pipeline and the retrieval infrastructure, so there is no self-managed vector store to configure.

It is created through the same bedrock-agent CreateKnowledgeBase operation as the existing self-managed base. The only differences are the shape of KnowledgeBaseConfiguration and the absence of storageConfiguration:

bedrock_agent.create_knowledge_base(
    name='my-managed-kb',
    roleArn=role_arn,
    knowledgeBaseConfiguration={
        'type': 'MANAGED',
        'managedKnowledgeBaseConfiguration': {'embeddingModeType': 'MANAGED'},
    }
}

BedrockCreateKnowledgeBaseOperato currently cannot produce this call:

  1. knowledgeBaseConfiguration is hardcorded in execute():
    knowledge_base_configuration={
        'type': 'VECTOR',
        'vectorKnowledgeBaseConfiguration': {'embeddingModelArn': self.embedding_model_arn},
    }
    
  2. storageConfiguration=self.storage_config is always passed to the API call.
  3. embedding_model_arn and storage_config are required __init__ arguments, and neither applies to a managed knowledge base. Overrading via create_knowledge_nase_kwards does not work either. Both knoeledgeBaseConfiguration and storageConfiguration are already supplied as explicit keyword arguments, so sypplying them again through the kwargs dict raises TypeError: got multiple values for keyword argument.

Separaetly, the wait_for_indexing / "no such index" retry loop exists purely to work around vector index propagation in a self-managed vector store. It has no meaning for a managed knowledge base, since there is no index for the user to create.

Net effect: there is currently no way to create a managed knowledge base from the amazon provider.

References:

  • https://aws.amazon.com/about-aws/whats-new/2026/06/amazon-bedrock-managed-knowledge-base/
  • https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateKnowledgeBase.html
  • https://aws.amazon.com/blogs/machine-learning/build-enterprise-search-for-agents-with-amazon-bedrock-managed-knowledge-base/

Use case/motivation

Refreshing a RAF corpus is a scheduled data pipeline concern: the source documents are usually produced or updated by upstream Airflow tasks, so provisioning the knowledge base and driving ingestion belongs in the same DAG. The provider already covers the self-managed path end to end(BedrockCreateKnowledgeBaseOperator -> BedrockCreateDataSourceOperator -> BedrockIngestDataOperator -> BedrockKnowledgeBaseActiveSensor). Managed knowledge bases are the missing half of an otherwise complete story, and they are the lower-friction option for teams that do not want to own vector srore.

Related issues

Not found.

Are you willing to submit a PR?

  • [x] Yes I am willing to submit a PR!

Code of Conduct

yamakazushi avatar Sep 06 '26 12:09 yamakazushi

I'd like to work on this issue. Please assign it to me.

Dewanshh avatar Sep 06 '26 14:09 Dewanshh

Hi @Dewanshh If you wish to work on this, please go ahead and submit a RP. This project is "no assignment" policy for issue. Please see the contribution docs for more information.

This is not to discourage people from contributing. They only want to ensure they do not have a backlog of "assigned" issues that are not actually being addressed.

yamakazushi avatar Sep 15 '26 13:09 yamakazushi

I will work on this and open a PR (no-assignment policy noted).

Plan: extend BedrockCreateKnowledgeBaseOperator so managed knowledge bases are a first-class option alongside the existing vector-store path — wire the managed KB fields through the boto3 create call, document the new params next to the current examples, and add provider tests for the request payload shape.

I have production RAG experience (hybrid retrieval / knowledge bases); happy to keep the diff limited to the Amazon Bedrock provider.

HarshXAI avatar Sep 29 '26 17:09 HarshXAI

Hi! I’d like to work on this issue.

I’m currently working on an academic project and this issue is closely related to what I’m building. I’d also like to take this opportunity to make a small contribution to the Apache Airflow project while learning more about the codebase.

I’m not looking to make a big contribution, just hoping to help improve this feature a little and gain some experience contributing to an open-source project.

Thank you!

KhaiLe-newbie avatar Nov 24 '26 18:11 KhaiLe-newbie