Skip to main content
Version: cicd.4.0 print this page

Knowledge Bases

Knowledge Bases store curated content that can be used by projects and agents for retrieval-augmented responses.

Below is the sample resource definition file for Knowledge Base:

{
"rKnowledgeBase": {
"Type": "KnowledgeBase",
"Properties": {
"KnowledgebaseName": "test_knowledge_base_cicd_123",
"Description": "Base knowledge base for CICD QA testing",
"EmbeddingModel": "amazon.titan-embed-text-v2:0",
"GuardRails": [
{
"Id": "o5u51darbv59",
"Version": "DRAFT"
}
],
"KnowledgebaseType": "unstructured",
"Keywords": [
"cicd",
"qa"
]
}
}
}
Note: Deployment dependencies

KnowledgeBase has dependencies on Tag.

Dependent resources should not be deleted before the primary resource; attempting to do so may lead to failures or inconsistencies during the deletion process.

Referencing this Resource

Below are the common keys that can be used in the DependsOn function to retrieve details of this resource.

Supported Keys

KeyDescription
KnowledgebaseNameReturns the KnowledgebaseName value of this resource
KnowledgebaseIdReturns the KnowledgebaseId value of this resource

For additional supported keys, refer to the API definition document for the respective resource type.

Example

The following example shows how to retrieve the knowledge base name from a knowledge base template and use it in an agent template:

{
"rAgent": {
"Type": "Agent",
"Properties": {
"ResourceAccessMetadata": {
"KnowledgebaseAccess": [
{
"Name": {
"!DependsOn": "rKnowledgeBase.KnowledgebaseId"
}
}
]
}
}
}
}