feat(aws): add Bedrock Knowledge Base connector#6799
feat(aws): add Bedrock Knowledge Base connector#6799tshepomaredi wants to merge 4 commits intomainfrom
Conversation
Adds a new outbound connector for AWS Bedrock Knowledge Base Retrieve API. Enables semantic search over documents indexed in a Bedrock Knowledge Base. - BedrockAgentRuntimeClient-based implementation - Retrieve operation with query and numberOfResults parameters - Results returned as Camunda Document (JSON) - Error handling: throttling retry, KB errors, serialization errors - Element template with authentication, configuration, and operation groups - Unit tests: executor (2), input validation (3) — all passing
60d996e to
8b228cb
Compare
...c/main/java/io/camunda/connector/aws/bedrock/knowledgebase/BedrockKnowledgeBaseExecutor.java
Fixed
Show fixed
Hide fixed
There was a problem hiding this comment.
@YanaSegal Could you provide an icon for this? 💕
mdii
left a comment
There was a problem hiding this comment.
Looks good 👍
I have a few comments.
...o/camunda/connector/aws/bedrock/knowledgebase/model/request/BedrockKnowledgeBaseRequest.java
Outdated
Show resolved
Hide resolved
...ain/java/io/camunda/connector/aws/bedrock/knowledgebase/model/request/RetrieveOperation.java
Outdated
Show resolved
Hide resolved
| "configuration", | ||
| "knowledgeBaseId", | ||
| "operation", | ||
| "operationDiscriminator" |
There was a problem hiding this comment.
Do we need to declare operationDiscriminator here 🤔 ?
There was a problem hiding this comment.
I believe we do. I followed a similar approach as the actionDiscriminator in the S3 connector.
There was a problem hiding this comment.
I think there is a difference between how it is done in the S3 connector. Here operationDiscriminator is a nested property of operation whereas in the S3 connector actionDiscriminator is at the root level. You can try removing it as see if the connector works as before.
There was a problem hiding this comment.
operationDiscriminator does no exist anyways. There is an operation.operationDiscriminator instead.
There was a problem hiding this comment.
You're correct, I've updated it
...ock-knowledgebase/src/test/java/io/camunda/connector/aws/bedrock/knowledgebase/BaseTest.java
Outdated
Show resolved
Hide resolved
| import io.camunda.connector.api.document.Document; | ||
|
|
||
| public record KnowledgeBaseRetrievalResult( | ||
| Document resultsDocument, int resultCount, String nextToken) {} |
There was a problem hiding this comment.
What is nextToken?
It is not referred to in the tests.
There was a problem hiding this comment.
Its a pagination token, I've renamed in for clarity (its named that way from the AWS side). The tests don't verify the pagination token at all since its just a pass-through value from the aws response. But we could add an assertion for it?
There was a problem hiding this comment.
Yes maybe just an assertion to make sure it is set correctly.
- Remove redundant @PropertyConstraints where @notblank is present - Remove unused REGION constant from BaseTest - Rename nextToken to paginationToken for clarity - Extract error codes into constants - Add retry backoff (3 retries, 5s) for throttling - Use generic createClient() pattern
|
Hi @YanaSegal, good question on the UX feedback. So currently the connector is setup to be used with an agent task, so it retrieves from the KB and returns the raw query outputs in a camunda doc, and the agent task would generate an output. If there's a use case for using the connector on its own, then maybe a Retrieve And Generate option could be added to combine retrieval with LLM generated answers. But if not we can remove the drop-down completely. Te query is a natural language search string. More specific queries yield better results (e.g. "What does the policy cover for stolen vehicles?" vs just "coverage"). I've added a query guidelines section with examples to the documentation PR Output mapping is optional. Without it, the full response (document reference, result count, pagination token) is stored in the result variable |
… paginationToken test - Remove operationDiscriminator from inputVariables (nested inside operation object) - Add test assertion for paginationToken pass-through - Add test for null paginationToken when no more results


Adds a new outbound connector for AWS Bedrock Knowledge Base Retrieve API. Enables semantic search over documents indexed in a Bedrock Knowledge Base.
Description
Related issues
NA
closes #
Checklist
release, as this branch will be rebased onto main before the next release. Example backport labels:
backport stable/8.8: for changes that should be included in the next 8.8.x release.backport release-8.8.7: for changes that should be included in the specific release 8.8.7, and thisrelease has already been created. The release branch will be merged back into stable/8.8 later, so the change
will be included in future 8.8.x releases as well.