Skip to content

Commit 11968fc

Browse files
docs: add knowledge base set up instruction to Readme file (#49)
* docs: add knowledge base set up instruction to Readme file * docs: add AWS doc link * docs: move AWS doc link
1 parent 2660906 commit 11968fc

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,90 @@ Strands comes with a comprehensive set of built-in tools:
102102

103103
Strands Agent Builder leverages Amazon Bedrock Knowledge Bases to store and retrieve custom tools, agent configurations, and development history.
104104

105+
### Set up your Knowledge Base
106+
107+
#### Prerequisites
108+
- AWS account with IAM user
109+
- Access to Amazon Bedrock console
110+
- Permissions to create IAM roles and S3 buckets
111+
112+
#### Console Setup (Recommended)
113+
114+
1. **Access Amazon Bedrock Console**
115+
- Sign in to [AWS Management Console](https://console.aws.amazon.com/bedrock)
116+
- Navigate to **Knowledge bases** in the left panel
117+
118+
2. **Create Knowledge Base**
119+
- Click **Create****Knowledge base with vector store**
120+
- Enter a name and description for your knowledge base
121+
122+
3. **Configure IAM Role**
123+
- Choose **Create and use a new service role** (recommended)
124+
- Or select an existing role with Bedrock permissions
125+
126+
4. **Set Up Data Source**
127+
- Choose your data source type, select `Custom` for Strands Agent
128+
- Configure connection details
129+
130+
5. **Configure Embeddings**
131+
- Select an embeddings model (e.g., Amazon Titan Text Embeddings V2)
132+
- Choose embedding type: `float32` (precise) or `binary` (cost-effective)
133+
134+
6. **Choose Vector Store**
135+
- **Quick create** (recommended): Let Bedrock create and manage the vector store
136+
- **Custom**: Use existing OpenSearch Serverless, Aurora PostgreSQL, or S3 Vectors
137+
138+
7. **Review and Create**
139+
- Review all configurations
140+
- Click **Create knowledge base**
141+
- Wait for creation to complete (status: "Ready" or "Available")
142+
143+
8. **Sync Data Source**
144+
- Select your knowledge base
145+
- Click **Sync** in the data source section
146+
- Wait for initial sync to complete
147+
148+
#### API Setup (Advanced)
149+
150+
Create via AWS CLI or SDK:
151+
152+
```bash
153+
# Example using AWS CLI
154+
aws bedrock-agent create-knowledge-base \
155+
--name "MyKnowledgeBase" \
156+
--description "Strands Agent Builder KB" \
157+
--role-arn "arn:aws:iam::ACCOUNT:role/AmazonBedrockExecutionRoleForKnowledgeBase" \
158+
--knowledge-base-configuration '{
159+
"type": "VECTOR",
160+
"vectorKnowledgeBaseConfiguration": {
161+
"embeddingModelArn": "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0"
162+
}
163+
}' \
164+
--storage-configuration '{
165+
"type": "OPENSEARCH_SERVERLESS",
166+
"opensearchServerlessConfiguration": {
167+
"collectionArn": "arn:aws:aoss:us-east-1:ACCOUNT:collection/YOUR_COLLECTION",
168+
"vectorIndexName": "bedrock-knowledge-base-index",
169+
"fieldMapping": {
170+
"vectorField": "bedrock-knowledge-base-default-vector",
171+
"textField": "AMAZON_BEDROCK_TEXT_CHUNK",
172+
"metadataField": "AMAZON_BEDROCK_METADATA"
173+
}
174+
}
175+
}'
176+
```
177+
For more set up details, please see [AWS Bedrock Knowledgebase](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-create.html)
178+
179+
#### Get Your Knowledge Base ID
180+
181+
After creation, find your Knowledge Base ID:
182+
- **Console**: Copy from the knowledge base details page
183+
- **CLI**: `aws bedrock-agent list-knowledge-bases`
184+
185+
The ID format: `ABCDEFGHIJ` (10 characters)
186+
187+
### Use your KnowledgeBase
188+
105189
```bash
106190
# Load and extend tools from your knowledge base
107191
strands --kb YOUR_KB_ID "Load my data_visualizer tool and add 3D plotting capabilities"

0 commit comments

Comments
 (0)