awslabs.cdk-mcp-server 0.0.62303__py3-none-any.whl → 0.0.81004__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. awslabs/__init__.py +10 -2
  2. awslabs/cdk_mcp_server/__init__.py +10 -0
  3. awslabs/cdk_mcp_server/core/__init__.py +10 -0
  4. awslabs/cdk_mcp_server/core/resources.py +11 -0
  5. awslabs/cdk_mcp_server/core/search_utils.py +11 -0
  6. awslabs/cdk_mcp_server/core/server.py +12 -1
  7. awslabs/cdk_mcp_server/core/tools.py +154 -0
  8. awslabs/cdk_mcp_server/data/__init__.py +10 -0
  9. awslabs/cdk_mcp_server/data/cdk_nag_parser.py +11 -0
  10. awslabs/cdk_mcp_server/data/construct_descriptions.py +11 -0
  11. awslabs/cdk_mcp_server/data/genai_cdk_loader.py +11 -0
  12. awslabs/cdk_mcp_server/data/lambda_powertools_loader.py +17 -4
  13. awslabs/cdk_mcp_server/data/schema_generator.py +22 -3
  14. awslabs/cdk_mcp_server/data/solutions_constructs_parser.py +11 -0
  15. awslabs/cdk_mcp_server/server.py +11 -0
  16. awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md +108 -66
  17. awslabs/cdk_mcp_server/static/__init__.py +10 -0
  18. awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/actiongroups.md +1 -1
  19. awslabs/cdk_mcp_server/static/lambda_powertools/bedrock.md +1 -1
  20. {awslabs_cdk_mcp_server-0.0.62303.dist-info → awslabs_cdk_mcp_server-0.0.81004.dist-info}/METADATA +71 -2
  21. awslabs_cdk_mcp_server-0.0.81004.dist-info/RECORD +51 -0
  22. awslabs/cdk_mcp_server/static/bedrock/agent/actiongroups.md +0 -137
  23. awslabs/cdk_mcp_server/static/bedrock/agent/alias.md +0 -39
  24. awslabs/cdk_mcp_server/static/bedrock/agent/collaboration.md +0 -91
  25. awslabs/cdk_mcp_server/static/bedrock/agent/creation.md +0 -149
  26. awslabs/cdk_mcp_server/static/bedrock/agent/custom_orchestration.md +0 -74
  27. awslabs/cdk_mcp_server/static/bedrock/agent/overview.md +0 -78
  28. awslabs/cdk_mcp_server/static/bedrock/agent/prompt_override.md +0 -70
  29. awslabs/cdk_mcp_server/static/bedrock/bedrockguardrails.md +0 -188
  30. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/chunking.md +0 -137
  31. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/datasources.md +0 -225
  32. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/kendra.md +0 -81
  33. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/overview.md +0 -116
  34. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/parsing.md +0 -36
  35. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/transformation.md +0 -30
  36. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/aurora.md +0 -185
  37. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/creation.md +0 -80
  38. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/opensearch.md +0 -56
  39. awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/pinecone.md +0 -66
  40. awslabs/cdk_mcp_server/static/bedrock/profiles.md +0 -153
  41. awslabs/cdk_mcp_server/static/opensearch-vectorindex/overview.md +0 -135
  42. awslabs/cdk_mcp_server/static/opensearchserverless/overview.md +0 -17
  43. awslabs_cdk_mcp_server-0.0.62303.dist-info/RECORD +0 -72
  44. {awslabs_cdk_mcp_server-0.0.62303.dist-info → awslabs_cdk_mcp_server-0.0.81004.dist-info}/WHEEL +0 -0
  45. {awslabs_cdk_mcp_server-0.0.62303.dist-info → awslabs_cdk_mcp_server-0.0.81004.dist-info}/entry_points.txt +0 -0
@@ -1,80 +0,0 @@
1
- # Vector Knowledge Base Properties
2
-
3
- | Name | Type | Required | Description |
4
- |---|---|---|---|
5
- | embeddingsModel | BedrockFoundationModel | Yes | The embeddings model for the knowledge base |
6
- | name | string | No | The name of the knowledge base |
7
- | vectorType | VectorType | No | The vector type to store vector embeddings |
8
- | description | string | No | The description of the knowledge base |
9
- | instruction | string | No | Instructions for agents based on the design and type of information of the Knowledge Base that will impact how Agents interact with the Knowledge Base |
10
- | existingRole | iam.IRole | No | Existing IAM role with a policy statement granting permission to invoke the specific embeddings model |
11
- | indexName | string | No | The name of the vector index (only applicable if vectorStore is of type VectorCollection) |
12
- | vectorField | string | No | The name of the field in the vector index (only applicable if vectorStore is of type VectorCollection) |
13
- | vectorStore | VectorCollection \| PineconeVectorStore \| AmazonAuroraVectorStore \| ExistingAmazonAuroraVectorStore | No | The vector store for the knowledge base |
14
- | vectorIndex | VectorIndex | No | The vector index for the OpenSearch Serverless backed knowledge base |
15
- | knowledgeBaseState | string | No | Specifies whether to use the knowledge base or not when sending an InvokeAgent request |
16
- | tags | Record<string, string> | No | Tag (KEY-VALUE) bedrock agent resource |
17
-
18
-
19
- ### Vector Knowledge Base - Vector Type
20
-
21
- The data type for the vectors when using a model to convert text into vector embeddings. Embeddings type may impact the availability of some embeddings models and vector stores. The following vector types are available:
22
-
23
- - Floating point: More precise vector representation of the text, but more costly in storage.
24
- - Binary: Not as precise vector representation of the text, but not as costly in storage as a standard floating-point (float32). Not all embedding models and vector stores support binary embeddings
25
-
26
- See [Supported embeddings models](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-supported.html) for information on the available models and their vector data types.
27
-
28
- #### Example
29
-
30
- ##### Typescript
31
-
32
- ```ts
33
- const app = new cdk.App();
34
- const stack = new cdk.Stack(app, 'aws-cdk-bedrock-data-sources-integ-test');
35
-
36
- const kb = new VectorKnowledgeBase(stack, 'MyKnowledgeBase', {
37
- name: 'MyKnowledgeBase',
38
- vectorType: bedrock.VectorType.BINARY,
39
- embeddingsModel: BedrockFoundationModel.COHERE_EMBED_MULTILINGUAL_V3,
40
- });
41
- ```
42
-
43
- ##### Python
44
-
45
- ```python
46
-
47
- from aws_cdk import (
48
- aws_s3 as s3,
49
- )
50
- from cdklabs.generative_ai_cdk_constructs import (
51
- bedrock
52
- )
53
-
54
- kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
55
- name= 'MyKnowledgeBase',
56
- vector_type= bedrock.VectorType.BINARY,
57
- embeddings_model= bedrock.BedrockFoundationModel.COHERE_EMBED_MULTILINGUAL_V3,
58
- )
59
- ```
60
-
61
- ### Vector Knowledge Base - Data Sources
62
-
63
- Data sources are the various repositories or systems from which information is extracted and ingested into the
64
- knowledge base. These sources provide the raw content that will be processed, indexed, and made available for
65
- querying within the knowledge base system. Data sources can include various types of systems such as document
66
- management systems, databases, file storage systems, and content management platforms. Suuported Data Sources
67
- include Amazon S3 buckets, Web Crawlers, SharePoint sites, Salesforce instances, and Confluence spaces.
68
-
69
- - **Amazon S3**. You can either create a new data source using the `bedrock.S3DataSource(..)` class, or using the
70
- `kb.addS3DataSource(..)`.
71
- - **Web Crawler**. You can either create a new data source using the `bedrock.WebCrawlerDataSource(..)` class, or using the
72
- `kb.addWebCrawlerDataSource(..)`.
73
- - **Confluence**. You can either create a new data source using the `bedrock.ConfluenceDataSource(..)` class, or using the
74
- `kb.addConfluenceDataSource(..)`.
75
- - **SharePoint**. You can either create a new data source using the `bedrock.SharePointDataSource(..)` class, or using the
76
- `kb.addSharePointDataSource(..)`.
77
- - **Salesforce**. You can either create a new data source using the `bedrock.SalesforceDataSource(..)` class, or using the
78
- `kb.addSalesforceDataSource(..)`.
79
- - **Custom**. You can either create a new data source using the `bedrock.CustomDataSource(..)` class, or using the
80
- `kb.addCustomDataSource(..)`. This allows you to add your own custom data source to the knowledge base.
@@ -1,56 +0,0 @@
1
-
2
- # OpenSearch Serverless Vector Store
3
-
4
- ## Example
5
-
6
- ### TypeScript
7
-
8
- ```ts
9
- import * as s3 from 'aws-cdk-lib/aws-s3';
10
- import { bedrock } from '@cdklabs/generative-ai-cdk-constructs';
11
-
12
- const kb = new bedrock.VectorKnowledgeBase(this, 'KnowledgeBase', {
13
- embeddingsModel: bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
14
- instruction: 'Use this knowledge base to answer questions about books. ' + 'It contains the full text of novels.',
15
- });
16
-
17
- const docBucket = new s3.Bucket(this, 'DocBucket');
18
-
19
- new bedrock.S3DataSource(this, 'DataSource', {
20
- bucket: docBucket,
21
- knowledgeBase: kb,
22
- dataSourceName: 'books',
23
- chunkingStrategy: bedrock.ChunkingStrategy.fixedSize({
24
- maxTokens: 500,
25
- overlapPercentage: 20,
26
- }),
27
- });
28
- ```
29
-
30
- ### Python
31
-
32
- ```python
33
-
34
- from aws_cdk import (
35
- aws_s3 as s3,
36
- )
37
- from cdklabs.generative_ai_cdk_constructs import (
38
- bedrock
39
- )
40
-
41
- kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
42
- embeddings_model= bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
43
- instruction= 'Use this knowledge base to answer questions about books. ' +
44
- 'It contains the full text of novels.'
45
- )
46
-
47
- docBucket = s3.Bucket(self, 'DockBucket')
48
-
49
- bedrock.S3DataSource(self, 'DataSource',
50
- bucket= docBucket,
51
- knowledge_base=kb,
52
- data_source_name='books',
53
- chunking_strategy= bedrock.ChunkingStrategy.FIXED_SIZE,
54
- )
55
-
56
- ```
@@ -1,66 +0,0 @@
1
- #### Example of `Pinecone` (manual, you must have Pinecone vector store created):
2
-
3
- ##### TypeScript
4
-
5
- ```ts
6
- import * as s3 from 'aws-cdk-lib/aws-s3';
7
- import { pinecone, bedrock } from '@cdklabs/generative-ai-cdk-constructs';
8
-
9
- const pineconeds = new pinecone.PineconeVectorStore({
10
- connectionString: 'https://your-index-1234567.svc.gcp-starter.pinecone.io',
11
- credentialsSecretArn: 'arn:aws:secretsmanager:your-region:123456789876:secret:your-key-name',
12
- textField: 'question',
13
- metadataField: 'metadata',
14
- });
15
-
16
- const kb = new bedrock.VectorKnowledgeBase(this, 'KnowledgeBase', {
17
- vectorStore: pineconeds,
18
- embeddingsModel: bedrock.BedrockFoundationModel.TITAN_EMBED_TEXT_V1,
19
- instruction: 'Use this knowledge base to answer questions about books. ' + 'It contains the full text of novels.',
20
- });
21
-
22
- const docBucket = new s3.Bucket(this, 'DocBucket');
23
-
24
- new bedrock.S3DataSource(this, 'DataSource', {
25
- bucket: docBucket,
26
- knowledgeBase: kb,
27
- dataSourceName: 'books',
28
- chunkingStrategy: bedrock.ChunkingStrategy.FIXED_SIZE,
29
- });
30
- ```
31
-
32
- ##### Python
33
-
34
- ```python
35
-
36
- from aws_cdk import (
37
- aws_s3 as s3,
38
- )
39
- from cdklabs.generative_ai_cdk_constructs import (
40
- bedrock,
41
- pinecone,
42
- )
43
-
44
- pineconevs = pinecone.PineconeVectorStore(
45
- connection_string='https://your-index-1234567.svc.gcp-starter.pinecone.io',
46
- credentials_secret_arn='arn:aws:secretsmanager:your-region:123456789876:secret:your-key-name',
47
- text_field='question',
48
- metadata_field='metadata'
49
- )
50
-
51
- kb = bedrock.VectorKnowledgeBase(self, 'KnowledgeBase',
52
- vector_store= pineconevs,
53
- embeddings_model= bedrock.BedrockFoundationModel.COHERE_EMBED_ENGLISH_V3,
54
- instruction= 'Use this knowledge base to answer questions about books. ' +
55
- 'It contains the full text of novels.'
56
- )
57
-
58
- docBucket = s3.Bucket(self, 'DockBucket')
59
-
60
- bedrock.S3DataSource(self, 'DataSource',
61
- bucket= docBucket,
62
- knowledge_base=kb,
63
- data_source_name='books',
64
- chunking_strategy= bedrock.ChunkingStrategy.FIXED_SIZE,
65
- )
66
- ```
@@ -1,153 +0,0 @@
1
- # Bedrock Inference Profiles
2
-
3
- ## System Defined Inference Profiles
4
-
5
- You can build a CrossRegionInferenceProfile using a system defined inference profile. The inference profile will route requests to the Regions defined in the cross region (system-defined) inference profile that you choose. You can find the system defined inference profiles by navigating to your console (Amazon Bedrock -> Cross-region inference) or programmatically, for instance using [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock/client/list_inference_profiles.html).
6
-
7
- Before using creating a CrossRegionInferenceProfile, ensure that you have access to the models and regions defined in the inference profiles. For instance, if you see the system defined inference profile "us.anthropic.claude-3-5-sonnet-20241022-v2:0" defined in your region, the table mentions that inference requests will be routed to US East (Virginia) us-east-1, US East (Ohio) us-east-2 and US West (Oregon) us-west-2. Thus, you need to have model access enabled in those regions for the model `anthropic.claude-3-5-sonnet-20241022-v2:0`. You can then create the CrossRegionInferenceProfile as follows:
8
-
9
- ### Examples
10
-
11
- #### TypeScript
12
-
13
- ```ts
14
- const cris = bedrock.CrossRegionInferenceProfile.fromConfig({
15
- geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
16
- model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0,
17
- });
18
- ```
19
-
20
- #### Python
21
-
22
- ```python
23
- cris = bedrock.CrossRegionInferenceProfile.from_config(
24
- geo_region= bedrock.CrossRegionInferenceProfileRegion.US,
25
- model= bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0
26
- )
27
- ```
28
-
29
- [View full documentation](https://github.com/awslabs/generative-ai-cdk-constructs/tree/main/src/cdk-lib/bedrock#system-defined-inference-profiles)
30
-
31
- ## Application Inference Profile
32
-
33
- You can create an application inference profile with one or more Regions to track usage and costs when invoking a model.
34
-
35
- To create an application inference profile for one Region, specify a foundation model. Usage and costs for requests made to that Region with that model will be tracked.
36
-
37
- To create an application inference profile for multiple Regions, specify a cross region (system-defined) inference profile. The inference profile will route requests to the Regions defined in the cross region (system-defined) inference profile that you choose. Usage and costs for requests made to the Regions in the inference profile will be tracked. You can find the system defined inference profiles by navigating to your console (Amazon Bedrock -> Cross-region inference) or programmatically, for instance using [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock/client/list_inference_profiles.html):
38
-
39
- ```
40
- bedrock = session.client("bedrock", region_name="us-east-1")
41
- bedrock.list_inference_profiles(typeEquals='SYSTEM_DEFINED')
42
- ```
43
-
44
- Before using application inference profiles, ensure that:
45
-
46
- - You have appropriate IAM permissions
47
- - You have access to the models and regions defined in the inference profiles
48
- - Ensure proper configuration of the required API permissions for inference profile-related actions
49
-
50
- Specifically the role you are assuming needs to have permissions for following actions in the IAM policy
51
-
52
- ```
53
- "Action": [
54
- "bedrock:GetInferenceProfile",
55
- "bedrock:ListInferenceProfiles",
56
- "bedrock:DeleteInferenceProfile"
57
- "bedrock:TagResource",
58
- "bedrock:UntagResource",
59
- "bedrock:ListTagsForResource"
60
- ]
61
- ```
62
-
63
- You can restrict to specific resources by applying "Resources" tag in the IAM policy.
64
-
65
- ```
66
- "Resource": ["arn:aws:bedrock:*:*:application-inference-profile/*"]
67
- ```
68
-
69
- ### Examples
70
-
71
- #### TypeScript
72
-
73
- ```ts
74
- // Create an application inference profile for one Region
75
- // You can use the 'bedrock.BedrockFoundationModel' or pass the arn as a string
76
- const appInfProfile1 = new ApplicationInferenceProfile(this, 'myapplicationprofile', {
77
- inferenceProfileName: 'claude 3 sonnet v1',
78
- modelSource: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0,
79
- tags: [{ key: 'test', value: 'test' }],
80
- });
81
-
82
- // To create an application inference profile across regions, specify the cross region inference profile
83
- const cris = bedrock.CrossRegionInferenceProfile.fromConfig({
84
- geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
85
- model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0,
86
- });
87
-
88
- const appInfProfile2 = new ApplicationInferenceProfile(this, 'myapplicationprofile2', {
89
- inferenceProfileName: 'claude 3 sonnet v1',
90
- modelSource: cris,
91
- });
92
-
93
- // Import a Cfn L1 construct created application inference profile
94
- const cfnapp = new CfnApplicationInferenceProfile(this, 'mytestaip3', {
95
- inferenceProfileName: 'mytest',
96
- modelSource: {
97
- copyFrom: 'arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0',
98
- },
99
- });
100
-
101
- const appInfProfile3 = bedrock.ApplicationInferenceProfile.fromCfnApplicationInferenceProfile(cfnapp);
102
-
103
- // Import an inference profile through attributes
104
- const appInfProfile4 = bedrock.ApplicationInferenceProfile.fromApplicationInferenceProfileAttributes(this, 'TestAIP', {
105
- inferenceProfileArn: 'arn:aws:bedrock:us-east-1:XXXXX:application-inference-profile/ID',
106
- inferenceProfileIdentifier: 'arn:aws:bedrock:us-east-1:XXXXXXX:application-inference-profile/ID',
107
- });
108
- ```
109
-
110
- #### Python
111
-
112
- ```python
113
-
114
- # Create an application inference profile for one Region
115
- # You can use the 'bedrock.BedrockFoundationModel' or pass the arn as a string
116
- appInfProfile1 = bedrock.ApplicationInferenceProfile(self, 'myapplicationprofile',
117
- inference_profile_name='claude 3 sonnet v1',
118
- model_source=bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0,
119
- tags=[CfnTag(
120
- key="key",
121
- value="value"
122
- )]
123
- )
124
-
125
- # To create an application inference profile across regions, specify the cross region inference profile
126
- cris = bedrock.CrossRegionInferenceProfile.from_config(
127
- geo_region= bedrock.CrossRegionInferenceProfileRegion.US,
128
- model= bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0
129
- )
130
-
131
- appInfProfile2 = bedrock.ApplicationInferenceProfile(self, 'myapplicationprofile2',
132
- inference_profile_name='claude 35 sonnet v2',
133
- model_source=cris
134
- )
135
-
136
- # Import an inference profile through attributes
137
- appInfProfile3 = bedrock.ApplicationInferenceProfile.from_application_inference_profile_attributes(self, 'TestAIP',
138
- inference_profile_arn='arn:aws:bedrock:us-east-1:XXXXX:application-inference-profile/ID',
139
- inference_profile_identifier='arn:aws:bedrock:us-east-1:XXXXXXX:application-inference-profile/ID',
140
- )
141
-
142
- # Import a Cfn L1 construct created application inference profile
143
- cfnaip = CfnApplicationInferenceProfile(this, 'mytestaip4',
144
- inference_profile_name='mytest',
145
- model_source= CfnApplicationInferenceProfile.InferenceProfileModelSourceProperty(
146
- copy_from='arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0'
147
- ),
148
- )
149
-
150
- appInfProfile4 = bedrock.ApplicationInferenceProfile.from_cfn_application_inference_profile(cfnaip);
151
- ```
152
-
153
- [View full documentation](https://github.com/awslabs/generative-ai-cdk-constructs/tree/main/src/cdk-lib/bedrock#application-inference-profile)
@@ -1,135 +0,0 @@
1
- # Amazon OpenSearch Vector Index Construct Library
2
-
3
- ## Table of contents
4
-
5
- - [Amazon OpenSearch Vector Index Construct Library](#amazon-opensearch-vector-index-construct-library)
6
- - [Table of contents](#table-of-contents)
7
- - [API](#api)
8
- - [Vector Index](#vector-index)
9
- - [Example](#example)
10
- - [TypeScript](#typescript)
11
- - [Python](#python)
12
- - [Default values](#default-values)
13
-
14
- ## API
15
-
16
- See the [API documentation](../../../apidocs/namespaces/opensearch_vectorindex/README.md).
17
-
18
- ## Vector Index
19
-
20
- The `VectorIndex` resource connects to OpenSearch and creates an index suitable for use with Amazon Bedrock Knowledge Bases.
21
-
22
- ## Example
23
-
24
- ### TypeScript
25
-
26
- ```ts
27
- import {
28
- opensearchserverless,
29
- opensearch_vectorindex,
30
- } from '@cdklabs/generative-ai-cdk-constructs';
31
-
32
- const vectorStore = new opensearchserverless.VectorCollection(
33
- this,
34
- 'VectorCollection'
35
- );
36
-
37
- new opensearch_vectorindex.VectorIndex(this, 'VectorIndex', {
38
- collection: vectorStore,
39
- indexName: 'bedrock-knowledge-base-default-index',
40
- vectorField: 'bedrock-knowledge-base-default-vector',
41
- vectorDimensions: 1536,
42
- precision: 'float',
43
- distanceType: 'l2',
44
- mappings: [
45
- {
46
- mappingField: 'AMAZON_BEDROCK_TEXT_CHUNK',
47
- dataType: 'text',
48
- filterable: true,
49
- },
50
- {
51
- mappingField: 'AMAZON_BEDROCK_METADATA',
52
- dataType: 'text',
53
- filterable: false,
54
- },
55
- ],
56
- analyzer: {
57
- characterFilters: [opensearchserverless.CharacterFilterType.ICU_NORMALIZER],
58
- tokenizer: opensearchserverless.TokenizerType.KUROMOJI_TOKENIZER,
59
- tokenFilters: [
60
- opensearchserverless.TokenFilterType.KUROMOJI_BASEFORM,
61
- opensearchserverless.TokenFilterType.JA_STOP,
62
- ],
63
- },
64
- });
65
- ```
66
-
67
- ### Python
68
-
69
- ```python
70
- from cdklabs.generative_ai_cdk_constructs import (
71
- opensearchserverless,
72
- opensearch_vectorindex,
73
- )
74
-
75
- vectorCollection = opensearchserverless.VectorCollection(self, "VectorCollection")
76
-
77
- vectorIndex = opensearch_vectorindex.VectorIndex(self, "VectorIndex",
78
- vector_dimensions= 1536,
79
- collection=vectorCollection,
80
- index_name='bedrock-knowledge-base-default-index',
81
- vector_field='bedrock-knowledge-base-default-vector',
82
- precision='float',
83
- distance_type='l2',
84
- mappings= [
85
- opensearch_vectorindex.MetadataManagementFieldProps(
86
- mapping_field='AMAZON_BEDROCK_TEXT_CHUNK',
87
- data_type='text',
88
- filterable=True
89
- ),
90
- opensearch_vectorindex.MetadataManagementFieldProps(
91
- mapping_field='AMAZON_BEDROCK_METADATA',
92
- data_type='text',
93
- filterable=False
94
- )
95
- ],
96
- analyzer=opensearchserverless.AnalyzerProps(
97
- character_filters=[opensearchserverless.CharacterFilterType.ICU_NORMALIZER],
98
- tokenizer=opensearchserverless.TokenizerType.KUROMOJI_TOKENIZER,
99
- token_filters=[
100
- opensearchserverless.TokenFilterType.KUROMOJI_BASEFORM,
101
- opensearchserverless.TokenFilterType.JA_STOP,
102
- ],
103
- )
104
- )
105
- ```
106
-
107
- ## Default values
108
-
109
- Behind the scenes, the custom resource creates a k-NN vector in the OpenSearch index, allowing to perform different kinds of k-NN search. The knn_vector field is highly configurable and can serve many different k-NN workloads. It is created as follows:
110
-
111
- Python
112
-
113
- ```py
114
- "properties": {
115
- vector_field: {
116
- "type": "knn_vector",
117
- "dimension": dimensions,
118
- "data_type": precision,
119
- "method": {
120
- "engine": "faiss",
121
- "space_type": distance_type,
122
- "name": "hnsw",
123
- "parameters": {},
124
- },
125
- },
126
- "id": {
127
- "type": "text",
128
- "fields": {"keyword": {"type": "keyword", "ignore_above": 256}},
129
- },
130
- },
131
- ```
132
-
133
- Users can currently configure the ```vector_field```, ```dimension```, ```data_type```, and ```distance_type``` fields through the construct interface.
134
-
135
- For details on the different settings, you can refer to the [Knn plugin documentation](https://opensearch.org/docs/latest/search-plugins/knn/knn-index/).
@@ -1,17 +0,0 @@
1
- # Amazon OpenSearch Serverless Construct Library
2
-
3
- ## Table of contents
4
-
5
- - [API](#api)
6
- - [Vector Collection](#vector-collection)
7
-
8
- ## API
9
- See the [API documentation](../../../apidocs/namespaces/opensearchserverless/README.md).
10
-
11
- ## Vector Collection
12
-
13
- This resource creates an Amazon OpenSearch Serverless collection configured for `VECTORSEARCH`. It creates default encryption, network, and data policies for use with Amazon Bedrock Knowledge Bases. For encryption, it uses the default AWS owned KMS key. It allows network connections from the public internet, but access is restricted to specific IAM principals.
14
-
15
- ### Granting Data Access
16
-
17
- The `grantDataAccess` method grants the specified role access to read and write the data in the collection.
@@ -1,72 +0,0 @@
1
- awslabs/__init__.py,sha256=4zfFn3N0BkvQmMTAIvV_QAbKp6GWzrwaUN17YeRoChM,115
2
- awslabs/cdk_mcp_server/__init__.py,sha256=pssyHoTGWcnlIXiZ9U5LiasJMgCp-g8zwo2aY9jASYU,190
3
- awslabs/cdk_mcp_server/server.py,sha256=KKNPh9zTvUy6uCAzeR2djtJqFCzDkkihUb-9dP_jVpw,134
4
- awslabs/cdk_mcp_server/core/__init__.py,sha256=wMYtq0d53XTzMmilxj-crP-I445ijE_8A7MH6wL1Fm8,47
5
- awslabs/cdk_mcp_server/core/resources.py,sha256=nduzytgmiAb3C-RuqcexWgEl_APUYymTQDmZhkAl-NQ,9593
6
- awslabs/cdk_mcp_server/core/search_utils.py,sha256=Nz8ftv4w9O_1fvCwIJL36GoBMOtHP9XZnTnVhUxVUko,5585
7
- awslabs/cdk_mcp_server/core/server.py,sha256=1Zc_n4whZJq9q2_eVrmvqnmNaTKL4ftwbiVHmPJ3JAs,2594
8
- awslabs/cdk_mcp_server/core/tools.py,sha256=dw_RJ-IvfWsaicj6bp_UvyGjtd2hLicXL4RC5doaVk4,11644
9
- awslabs/cdk_mcp_server/data/__init__.py,sha256=ksA1se4fyvTIb4K7lND-C66ouriFtjyZU96Q88nl6w4,47
10
- awslabs/cdk_mcp_server/data/cdk_nag_parser.py,sha256=k3OzuVyoYUivowt_mEO0cp1YwTOgzTmVyg_0mcanDt8,10900
11
- awslabs/cdk_mcp_server/data/construct_descriptions.py,sha256=br5gOa5M8Nhv3HrHqrHGXCwQRTu4ZeMAo85bEhzCuMM,2605
12
- awslabs/cdk_mcp_server/data/genai_cdk_loader.py,sha256=Q_-tnYu9VNe9lbAxN6qfvBQWYJJjYXht63ko9x-IH-Y,15507
13
- awslabs/cdk_mcp_server/data/lambda_powertools_loader.py,sha256=sQfZrmA2hZdd1NSK0hCb5l4kl7jlQ3xhxs28KgEB4Dw,1630
14
- awslabs/cdk_mcp_server/data/schema_generator.py,sha256=vQaZiasOyVam0NNmtzo6D6hy7ynsndRR2I56OBwQlag,27879
15
- awslabs/cdk_mcp_server/data/solutions_constructs_parser.py,sha256=SL3ZjvCSALmiQlHEMsoDbnbtKxFAPl-mTurciCgj3G8,27656
16
- awslabs/cdk_mcp_server/static/CDK_GENERAL_GUIDANCE.md,sha256=E-oIFBGkvHg95u909rJDrGJdo4t7aCeTLZsXQ47Fyhc,9925
17
- awslabs/cdk_mcp_server/static/CDK_NAG_GUIDANCE.md,sha256=zJtHJp9ruaaJ-xa68k9kDrPmEaXpiWCZZf7JIy8NK0w,5839
18
- awslabs/cdk_mcp_server/static/__init__.py,sha256=JJ9ptA-cG8muKCoJgjPKUoCc2q2ks8gBJNbjJTHZS3o,194
19
- awslabs/cdk_mcp_server/static/bedrock/bedrockguardrails.md,sha256=CX00B7XgDpLbVxvf6B-a13O4NERAJMiaPPeTuKK-8Sw,7386
20
- awslabs/cdk_mcp_server/static/bedrock/profiles.md,sha256=xxPnEkZ0tJAFKomMuAPLm3EtlQFku6MR2nPu4VoyppE,7195
21
- awslabs/cdk_mcp_server/static/bedrock/agent/actiongroups.md,sha256=qm6UCCfKurtvNO52g1a6H1N9iBZx-KTCf4SbCK2QQXw,4865
22
- awslabs/cdk_mcp_server/static/bedrock/agent/alias.md,sha256=eyTmjmHyQbuR5CbFpp2qrEcEqw2l9pMupWERRVksVNw,1293
23
- awslabs/cdk_mcp_server/static/bedrock/agent/collaboration.md,sha256=nNu30F5ydUbb7HtboUWNhp0hOnQMw8q8shCUjMDwT_A,3616
24
- awslabs/cdk_mcp_server/static/bedrock/agent/creation.md,sha256=BzpVJkRs_q1ZkW8LnIEh7--57OnNmHHdPCygfGJAks0,6216
25
- awslabs/cdk_mcp_server/static/bedrock/agent/custom_orchestration.md,sha256=ylMTq3PT3vHnrul_boLuQIGQFuk_Y0evdImp_pLY7rY,2983
26
- awslabs/cdk_mcp_server/static/bedrock/agent/overview.md,sha256=4FLhC3CC01W9Gpw4S0Z6yWPnM86p2nJ_dxQ1yU4Xsxw,2921
27
- awslabs/cdk_mcp_server/static/bedrock/agent/prompt_override.md,sha256=ypmKxlO5WIYqUh2gYDzo1Mwzso_HwSkzrMHeDU473C8,2520
28
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/chunking.md,sha256=xlO23xjesPFGgv_FZm2AkRzQVH3nSFD2GpbddXJX2gM,3201
29
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/datasources.md,sha256=iHQ086zHzkqHoKLi7pmyMxf0oH02UVHf_GAid6EMdeE,7147
30
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/kendra.md,sha256=sYbhIAaGjuJ2lifP0xvDXacDEVFC24Gl9giAI6RF9bo,2786
31
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/overview.md,sha256=AGLS6146UufRTC80EAyAviBhAtb7hFcbMz3tWFviPOc,5167
32
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/parsing.md,sha256=AQ6TTO5HxKqhtVdv1bM6GjHyDgOICaNi5NtDT9Dxp10,1155
33
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/transformation.md,sha256=I5Lkn0giUr5n0lTxqjtUsoHNkom6AJtxEnvlarH_54Y,813
34
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/aurora.md,sha256=CjiJDoaui2H4-nu99Sem4rK_8pQGB_ciI5So5pKWMSQ,5766
35
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/creation.md,sha256=jXxrwnor7_YUJc9sYCHjrQnCnHQrVItPI7YttcX-mX8,4491
36
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/opensearch.md,sha256=mM8nILHaFaLfHUaIl7c8Eh0NFx8Z5H4yu5LbC-DmnSU,1368
37
- awslabs/cdk_mcp_server/static/bedrock/knowledgebases/vector/pinecone.md,sha256=OnKjSXB6CHBxnXJFGbsIRqpLyA6_S2AiHOJslxQVaOw,2053
38
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/bedrockguardrails.md,sha256=CX00B7XgDpLbVxvf6B-a13O4NERAJMiaPPeTuKK-8Sw,7386
39
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/profiles.md,sha256=xxPnEkZ0tJAFKomMuAPLm3EtlQFku6MR2nPu4VoyppE,7195
40
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/actiongroups.md,sha256=qm6UCCfKurtvNO52g1a6H1N9iBZx-KTCf4SbCK2QQXw,4865
41
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/alias.md,sha256=eyTmjmHyQbuR5CbFpp2qrEcEqw2l9pMupWERRVksVNw,1293
42
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/collaboration.md,sha256=nNu30F5ydUbb7HtboUWNhp0hOnQMw8q8shCUjMDwT_A,3616
43
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/creation.md,sha256=BzpVJkRs_q1ZkW8LnIEh7--57OnNmHHdPCygfGJAks0,6216
44
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/custom_orchestration.md,sha256=ylMTq3PT3vHnrul_boLuQIGQFuk_Y0evdImp_pLY7rY,2983
45
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/overview.md,sha256=4FLhC3CC01W9Gpw4S0Z6yWPnM86p2nJ_dxQ1yU4Xsxw,2921
46
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/agent/prompt_override.md,sha256=ypmKxlO5WIYqUh2gYDzo1Mwzso_HwSkzrMHeDU473C8,2520
47
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/chunking.md,sha256=TpLXPJso6c4MhWUepX0WsX3FE6FOIsFBPcE28B-3iKM,3203
48
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/datasources.md,sha256=iHQ086zHzkqHoKLi7pmyMxf0oH02UVHf_GAid6EMdeE,7147
49
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/kendra.md,sha256=sYbhIAaGjuJ2lifP0xvDXacDEVFC24Gl9giAI6RF9bo,2786
50
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/overview.md,sha256=AGLS6146UufRTC80EAyAviBhAtb7hFcbMz3tWFviPOc,5167
51
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/parsing.md,sha256=AQ6TTO5HxKqhtVdv1bM6GjHyDgOICaNi5NtDT9Dxp10,1155
52
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/transformation.md,sha256=I5Lkn0giUr5n0lTxqjtUsoHNkom6AJtxEnvlarH_54Y,813
53
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/aurora.md,sha256=CjiJDoaui2H4-nu99Sem4rK_8pQGB_ciI5So5pKWMSQ,5766
54
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/creation.md,sha256=jXxrwnor7_YUJc9sYCHjrQnCnHQrVItPI7YttcX-mX8,4491
55
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/opensearch.md,sha256=mM8nILHaFaLfHUaIl7c8Eh0NFx8Z5H4yu5LbC-DmnSU,1368
56
- awslabs/cdk_mcp_server/static/genai_cdk/bedrock/knowledgebases/vector/pinecone.md,sha256=OnKjSXB6CHBxnXJFGbsIRqpLyA6_S2AiHOJslxQVaOw,2053
57
- awslabs/cdk_mcp_server/static/genai_cdk/opensearch-vectorindex/overview.md,sha256=0aSuBwX4ubI5WqwEfrnX1MH2UJlJOzdXZQ003fRIrGM,4121
58
- awslabs/cdk_mcp_server/static/genai_cdk/opensearchserverless/overview.md,sha256=aUO1BRana_xqUPENP3GQyOSCAvV9mI-ZWls7x0g8ruA,746
59
- awslabs/cdk_mcp_server/static/lambda_powertools/bedrock.md,sha256=Fu54j6sKHdNCUl8FnrIN02kXoTZzdS1g91lURG0ORA4,4292
60
- awslabs/cdk_mcp_server/static/lambda_powertools/cdk.md,sha256=XBj-31YcphHb1BjCYz4nRpAfPuVJVRmDYI2K7e6Ti8E,3826
61
- awslabs/cdk_mcp_server/static/lambda_powertools/dependencies.md,sha256=nZ2Fv54rG1rUmD_YHkM9h5VNvB81-Hk8Qx3ZNQSFZLY,1520
62
- awslabs/cdk_mcp_server/static/lambda_powertools/index.md,sha256=yivjInZAZ3tENKGrrAv7geICzUvKUTskWuaNj9nuPbI,1819
63
- awslabs/cdk_mcp_server/static/lambda_powertools/insights.md,sha256=t-lgyx2AstqXuY7LeWyhQxknrPN27-nAcwW-GTjI058,3445
64
- awslabs/cdk_mcp_server/static/lambda_powertools/logging.md,sha256=6CSgD8QB3Bs4s_x4RnbKwZoWvG6aG4etCnmDH6HU9XY,1797
65
- awslabs/cdk_mcp_server/static/lambda_powertools/metrics.md,sha256=XpQHtNSQRKN3GUqQWkk1lTfQSRC0LmW6VoX1dlwEvnQ,3182
66
- awslabs/cdk_mcp_server/static/lambda_powertools/tracing.md,sha256=Q3dSCvgktb9sUsuuQ5ONU2Qdb1OTwbNOYpK--MDzBNw,2539
67
- awslabs/cdk_mcp_server/static/opensearch-vectorindex/overview.md,sha256=0aSuBwX4ubI5WqwEfrnX1MH2UJlJOzdXZQ003fRIrGM,4121
68
- awslabs/cdk_mcp_server/static/opensearchserverless/overview.md,sha256=aUO1BRana_xqUPENP3GQyOSCAvV9mI-ZWls7x0g8ruA,746
69
- awslabs_cdk_mcp_server-0.0.62303.dist-info/METADATA,sha256=FFFL7SlFEWlvq9ThUjvrIJ9aZAs0lM5NUcJImlz1AkU,3638
70
- awslabs_cdk_mcp_server-0.0.62303.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
71
- awslabs_cdk_mcp_server-0.0.62303.dist-info/entry_points.txt,sha256=LertzmID_mUU1YYZPySAF1IY1zE7ySTvzFxiGyo3VjY,78
72
- awslabs_cdk_mcp_server-0.0.62303.dist-info/RECORD,,