Knowledge Base Support for the Generic Bedrock Agent Test UI
Here is the latest update to the generic Bedrock Agent test UI that enables citation for knowledge base answers.

Search for a command to run...
Here is the latest update to the generic Bedrock Agent test UI that enables citation for knowledge base answers.

Great Blog. Will it be possible for you to share how to enable return of control using the Streamlit app
Hello, thanks for your message. I don't have plan to add support for return control yet, but I've opened an issue in GitHub to track it.
I will however add support for guardrail in the coming days if you are also interested.
Learn how to deploy a self-hosted AI chat platform on AWS using LibreChat, MongoDB Atlas, Amazon ECS, and Amazon Bedrock, provisioned via Terraform.

Explore AWS Control Tower proactive controls, why they don’t work with Terraform, and a proof of concept that attempts to make them work. Introduction As a Terraform advocate and an AWS consultant who

I recently passed the Terraform Authoring and Operations Professional Exam. Here are my practical tips to help you prepare more effectively.

Learn how to monitor data ingestion jobs for Amazon Bedrock Knowledge Bases and enable notifications using CloudWatch Logs.

Learn how to enable logging for Amazon Bedrock Knowledge Bases, which uses the log delivery feature of Amazon CloudWatch Logs, with Terraform.

In the blog post Developing a Generic Streamlit UI to Test Amazon Bedrock Agents, I shared the design and source code of a basic yet functional UI for testing Bedrock agents. Since then, I've explored Knowledge Bases for Amazon Bedrock and shared my insights in another blog post, Adding an Amazon Bedrock Knowledge Base to the Forex Rate Assistant. If you haven't checked it out yet, I highly recommend doing so.
The Bedrock console offers additional features for testing agents that are integrated with knowledge bases, including citations in the responses and trace information about the retrieved results from knowledge bases:

With a bit of work, I have added similar support to the generic test UI and I am happy to share the updates in the GitHub repository.
With the latest update, citations are now added to the response in a manner similar to how they are displayed in the Bedrock console:

The Agent for Bedrock Runtime API provides, for each citation, the start and end index of the text that references the source as well as the document location in S3. Through string manipulation, citation numbers are incorporated into the response text, and references are appended to the end of the text. Spacing is a bit finicky due to the use of markdown, so some HTML markups are used.
Another feature is the inclusion of citation details in the Trace section of the left pane:

Each citation block provides the raw output from the API response and includes the information mentioned earlier, as well as the raw results retrieved by the knowledge base.
Additionally, the trace blocks from the original test UI can now provide more detailed information for knowledge base invocations. You will find all references retrieved from the knowledge base, which form a superset of the citations in the final response after the model processes them.
With the improvements to the generic test UI outlined in this post, you should now be able to test any Bedrock agents with attached knowledge bases. I hope you find this update helpful and look forward to further enhancements as I continue on my Amazon Bedrock journey.
Be sure to explore other posts on the Avangards Blog to learn more about generative AI in AWS, Terraform, and other technical topics. Have a great day!