- Newest
- Most votes
- Most comments
While there isn't direct information about passing session values from a Bedrock Agent Action Group Lambda to Lex when using a BedrockAgentIntent, we can infer some relevant information based on how session state works in Amazon Bedrock Agents.
In Amazon Bedrock, session state attributes can be used to maintain context during user conversations. These attributes can be set in two ways:
-
When setting up an action group and writing the Lambda function, you can include 'sessionAttributes' or 'promptSessionAttributes' in the response event that is returned to Amazon Bedrock.
-
During runtime, when sending an InvokeAgent request, you can include a 'sessionState' object in the request body to dynamically change the session state attributes mid-conversation.
These session attributes persist across a session between a user and an agent, allowing for the maintenance of context throughout the interaction.
However, it's important to note that this information is specific to Amazon Bedrock Agents and doesn't directly address how these values might be passed to Lex when using a BedrockAgentIntent. The integration between Bedrock Agents and Lex for this specific use case is not explicitly covered in the available information.
If you need to pass session values from a Bedrock Agent to Lex, you might need to explore additional integration options or consult AWS documentation specific to BedrockAgentIntent and its interaction with Lex. It's possible that you may need to implement a custom solution to bridge the gap between the two services if there isn't a built-in mechanism for this data transfer.
For the most accurate and up-to-date information on this specific use case, it would be best to consult the latest AWS documentation or reach out to AWS support for guidance on integrating Bedrock Agent session values with Lex via BedrockAgentIntent.
Sources
Control agent session context - Amazon Bedrock
SessionState - Amazon Bedrock
The responses from the BedrockAgentIntent will be stored into the session and request attributes as shown below:
x-amz-lex:bedrock-agent-search-response – The response from the Amazon Bedrock Agent to the question or utterance.
x-amz-lex:bedrock-knowledge-base-search-response-source – Points to the document, or list of documents, used to generate the response if using the Amazon Bedrock Knowledge Base configuration.
x-amz-lex:bedrock-agent-action-group-invocation-input - Object containing input values collected by the agent action group. For more information on agent action groups, see ActionGroupInvocationInput.
x-amz-lex:bedrock-agent-knowledge-base-lookup-input - Object containing the Knowledge Base lookup related details.
Relevant content
- asked 16 days ago
- asked 5 months ago