feat: add Bedrock Knowledge Base retriever to amazon-bedrock integration - #3582
Conversation
|
Heads-up for maintainers This PR is from a fork and touches integrations whose integration tests require API keys. Affected integrations:
Please run the integration tests locally ( |
53258e3 to
50ac0b9
Compare
Coverage report (amazon_bedrock)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
48b1c26 to
1f5de93
Compare
408586a to
772c95c
Compare
|
Hi @PVidyadhar - thanks for this PR. I noticed that there are no integrations/live tests. In any case, did you actually test this Retriever against a live Amazon Bedrock Knowledge Base? |
- Created BedrockKnowledgeBaseRetriever @component with run(query) - Returns Haystack Documents with content, metadata, and scores - Supports managed and vector search configurations - Agentic retrieval with fallback to standard Retrieve API - Includes to_dict/from_dict serialization for pipeline persistence - Unit tests included - Added BEDROCK_MANAGED_KB.md design doc
e7e86b4 to
b6bf93c
Compare
Hi @davidsbatista — yes, fully tested against a live Managed KB (ZDYIO8E7GK) in us-west-2:
I've also added integration tests (test_knowledge_base_retriever_integration.py) marked with @pytest.mark.integration - they run with KNOWLEDGE_BASE_ID env var set. Push is up. |
davidsbatista
left a comment
There was a problem hiding this comment.
Thanks for your contribution, I've done some adjustments + adding the tests to the workflow
feat: add Bedrock Knowledge Base retriever to amazon-bedrock integration
Related Issues
N/A — new feature adding Knowledge Base retrieval to the existing Amazon Bedrock integration.
Proposed Changes:
Adds
BedrockKnowledgeBaseRetrievercomponent to theamazon-bedrock-haystackintegration, enabling document retrieval from Amazon Bedrock Managed Knowledge Bases.BedrockKnowledgeBaseRetrieveras a Haystack@componentwithrun(query)methodList[Document]with content, metadata (source URI, score)to_dict/from_dictserialization for pipeline persistencebedrock:Retrieve,bedrock:AgenticRetrieveboto3 >= 1.43How did you test it?
pipe.run()returned 3 Documents with scores. Tested against managed KB in us-west-2.to_dict()round-tripNotes for the reviewer
amazon-bedrockintegration (which already has Embedder, Generator, Ranker) with a Retriever componentintegrations/amazon_bedrock/managedSearchConfigurationrequiresboto3 >= 1.43(released April 2026)Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.