Skip to content

Added KB examples and tests and updated metadata file #7451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
842948f
Added KB examples and tests and updated metadata file
gausekha May 16, 2025
6b87901
Removed the shebang in knowledge bases file
gausekha May 16, 2025
ff05605
Update bedrock-agent writeme using writeme.py and manually moving par…
DavidSouther May 19, 2025
61433ed
Merge branch 'main' into gausekha-kb-python-examples
beqqrry-aws May 19, 2025
a0ed878
Update READMEs with template.
rlhagerm May 22, 2025
bfab70f
Merge branch 'main' into gausekha-kb-python-examples
beqqrry-aws May 28, 2025
8351553
Merge branch 'main' into gausekha-kb-python-examples
gausekha May 29, 2025
0dec32e
Added IAM role and scenario for running knowledge base APIs
gausekha May 30, 2025
0a42cae
Merge branch 'awsdocs:main' into gausekha-kb-python-examples
gausekha May 30, 2025
9356a35
Updated the collection ARN to be different from embedding model ARN
gausekha Jun 3, 2025
bd02092
Merge branch 'gausekha-kb-python-examples' of github.com:gausekha/aws…
gausekha Jun 3, 2025
7e47606
Merge branch 'awsdocs:main' into gausekha-kb-python-examples
gausekha Jun 3, 2025
4fcf370
Added comment to indicate that customers will have to create an OpenS…
gausekha Jun 10, 2025
0ce8ce3
Merge branch 'gausekha-kb-python-examples' of github.com:gausekha/aws…
gausekha Jun 10, 2025
debc6e1
Merge branch 'main' into gausekha-kb-python-examples
beqqrry-aws Jun 18, 2025
bfad5ca
Merge branch 'main' into gausekha-kb-python-examples
rlhagerm Jul 7, 2025
fcd785f
Updates for brackets and README.
rlhagerm Jul 7, 2025
0cf9b30
Update README.md
rlhagerm Jul 7, 2025
499a00b
Merge branch 'main' into gausekha-kb-python-examples
rlhagerm Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .doc_gen/metadata/bedrock-agent_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -521,3 +521,68 @@ bedrock-agent_GettingStartedWithBedrockPrompts:
services:
bedrock-agent: {CreatePrompt, CreatePromptVersion, DeletePrompt}
bedrock-runtime: {Converse}

bedrock-agent_CreateKnowledgeBase:
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-agent
excerpts:
- description: Create an Amazon Bedrock knowledge base.
snippet_tags:
- python.example_code.bedrock-agent.create_knowledge_base
services:
bedrock-agent: {CreateKnowledgeBase}

bedrock-agent_GetKnowledgeBase:
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-agent
excerpts:
- description: Get an Amazon Bedrock knowledge base.
snippet_tags:
- python.example_code.bedrock-agent.get_knowledge_base
services:
bedrock-agent: {GetKnowledgeBase}

bedrock-agent_UpdateKnowledgeBase:
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-agent
excerpts:
- description: Update an Amazon Bedrock knowledge base.
snippet_tags:
- python.example_code.bedrock-agent.update_knowledge_base
services:
bedrock-agent: {UpdateKnowledgeBase}

bedrock-agent_DeleteKnowledgeBase:
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-agent
excerpts:
- description: Delete an Amazon Bedrock knowledge base.
snippet_tags:
- python.example_code.bedrock-agent.delete_knowledge_base
services:
bedrock-agent: {DeleteKnowledgeBase}

bedrock-agent_ListKnowledgeBases:
languages:
Python:
versions:
- sdk_version: 3
github: python/example_code/bedrock-agent
excerpts:
- description: List Amazon Bedrock knowledge Bases.
snippet_tags:
- python.example_code.bedrock-agent.list_knowledge_bases
services:
bedrock-agent: {ListKnowledgeBases}
10 changes: 10 additions & 0 deletions python/example_code/bedrock-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,34 @@ Code excerpts that show you how to call individual service functions.
- [CreateFlow](flows/flow.py#L18)
- [CreateFlowAlias](flows/flow_alias.py#L15)
- [CreateFlowVersion](flows/flow_version.py#L18)
- [CreateKnowledgeBase](knowledge_bases/knowledge_base.py#L30)
- [CreatePrompt](prompts/prompt.py#L18)
- [CreatePromptVersion](prompts/prompt.py#L84)
- [DeleteAgent](bedrock_agent_wrapper.py#L118)
- [DeleteAgentAlias](bedrock_agent_wrapper.py#L139)
- [DeleteFlow](flows/flow.py#L155)
- [DeleteFlowAlias](flows/flow_alias.py#L98)
- [DeleteFlowVersion](flows/flow_version.py#L91)
- [DeleteKnowledgeBase](knowledge_bases/knowledge_base.py#L169)
- [DeletePrompt](prompts/prompt.py#L159)
- [GetAgent](bedrock_agent_wrapper.py#L161)
- [GetFlow](flows/flow.py#L192)
- [GetFlowVersion](flows/flow_version.py#L54)
- [GetKnowledgeBase](knowledge_bases/knowledge_base.py#L90)
- [GetPrompt](prompts/prompt.py#L124)
- [ListAgentActionGroups](bedrock_agent_wrapper.py#L208)
- [ListAgentKnowledgeBases](bedrock_agent_wrapper.py#L237)
- [ListAgents](bedrock_agent_wrapper.py#L185)
- [ListFlowAliases](flows/flow_alias.py#L132)
- [ListFlowVersions](flows/flow_version.py#L128)
- [ListFlows](flows/flow.py#L229)
- [ListKnowledgeBases](knowledge_bases/knowledge_base.py#L199)
- [ListPrompts](prompts/prompt.py#L191)
- [PrepareAgent](bedrock_agent_wrapper.py#L266)
- [PrepareFlow](flows/flow.py#L58)
- [UpdateFlow](flows/flow.py#L112)
- [UpdateFlowAlias](flows/flow_alias.py#L55)
- [UpdateKnowledgeBase](knowledge_bases/knowledge_base.py#L120)

### Scenarios

Expand Down Expand Up @@ -102,6 +107,11 @@ This example shows you how to do the following:
- Delete all created resources.

<!--custom.scenario_prereqs.bedrock-agent_GettingStartedWithBedrockFlows.start-->

The flow includes a prompt node that generates a playlist for a chosen genre
and number of songs. The example creates the nodes and permissions
for the flow.

<!--custom.scenario_prereqs.bedrock-agent_GettingStartedWithBedrockFlows.end-->

Start the example by running the following at a command prompt:
Expand Down
Loading