oscerd opened a new pull request, #23147:
URL: https://github.com/apache/camel/pull/23147
## Summary
Adds the `retrieve` operation to the `camel-aws-bedrock-agent-runtime`
component.
The component previously only exposed `retrieveAndGenerate` (semantic search
+ LLM
generation) and `invokeFlow`. The Bedrock `Retrieve` API — semantic search
against
a knowledge base returning the matched chunks **without** invoking a model —
was
missing despite already being supported by the underlying SDK
(`BedrockAgentRuntimeClient.retrieve(RetrieveRequest)`).
This is a common operation when users want to plug in their own generation
step,
inspect retrieval quality, or paginate through knowledge-base hits.
## Changes
- `BedrockAgentRuntimeOperations`: new `retrieve` value.
- `BedrockAgentRuntimeProducer`:
- dispatches the new operation in `process(...)` and routes to a new
`retrieve(...)` method;
- supports both **header mode** (`String` body = query text, knobs via
headers) and
**POJO mode** (`pojoRequest=true` → body is a `RetrieveRequest`,
forwarded verbatim).
- surfaces results as the out-message body
(`List<KnowledgeBaseRetrievalResult>`) plus
a `RETRIEVED_RESULTS` header for parity with the existing `CITATIONS`
pattern.
- `BedrockAgentRuntimeConstants`: new headers
- `CamelAwsBedrockAgentRuntimeRetrievedResults` — the matched chunks.
- `CamelAwsBedrockAgentRuntimeNumberOfResults` — overrides
`numberOfResults`.
- `CamelAwsBedrockAgentRuntimeSearchType` — overrides `overrideSearchType`
(`HYBRID`/`SEMANTIC`).
- `CamelAwsBedrockAgentRuntimeNextToken` — pagination token (in + out).
- `CamelAwsBedrockAgentRuntimeRetrieveGuardrailAction` — guardrail action
when present.
- Unit tests covering: default request build, header-driven knobs
(numberOfResults,
overrideSearchType, nextToken), failure when `knowledgeBaseId` is missing,
and POJO mode.
- Regenerated catalog JSON and endpoint DSL artifacts.
- Updated `aws-bedrock-agent-runtime-component.adoc`.
JIRA: https://issues.apache.org/jira/browse/CAMEL-23466
## Test plan
- [x] `mvn clean install` from the module directory — module tests green (4
new + existing).
- [x] `mvn clean install -DskipTests` from the repo root — full reactor
build green.
- [ ] Manual smoke against a real Bedrock Knowledge Base (left to reviewer /
follow-up).
---
_Claude Code on behalf of Andrea Cosentino_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]