Skip to content
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

feat(kendra): add Kendra GenAI Index and new KB interface #938

Merged
merged 16 commits into from
Feb 6, 2025

Conversation

aws-rafams
Copy link
Contributor

@aws-rafams aws-rafams commented Feb 4, 2025

Fixes #885, #838

Kendra GenAI Index

const cmk = new kms.Key(stack, 'cmk', {});

const index = new KendraGenAiIndex(this, 'index', {
  name: 'kendra-index-cdk',
  kmsKey: cmk,
  documentCapacityUnits: 1, // 40K documents
  queryCapacityUnits: 1,    // 0.2 QPS
});

new KendraKnowledgeBase(this, 'kb', {
  name: 'kendra-kb-cdk',
  kendraIndex: index,
});

Deployment:
Screenshot 2025-02-04 at 13 39 54
Screenshot 2025-02-04 at 13 39 22
Screenshot 2025-02-04 at 14 30 05

New KB Interface to keep into consideration Multiple KB Types
diagram (4)

Added Kendra GenAI Index


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

@aws-rafams aws-rafams marked this pull request as ready for review February 4, 2025 15:42
@krokoko
Copy link
Collaborator

krokoko commented Feb 4, 2025

Thanks @aws-rafams ! Just to clarify, this adds Kendra for KB support, and BDA in parsing for KB right ? So the only feature gap with the core CDK at the moment after this is merged would be structured data store support ?

@aws-rafams
Copy link
Contributor Author

aws-rafams commented Feb 4, 2025

Thanks @aws-rafams ! Just to clarify, this adds Kendra for KB support, and BDA in parsing for KB right ? So the only feature gap with the core CDK at the moment after this is merged would be structured data store support ?

BDA is not fully implemented, it would be better to leave the full implementation for a further PR once it goes GA as the structure might change. These changes just adds new enums that will be needed. Structured data store support would be missing.

@krokoko
Copy link
Collaborator

krokoko commented Feb 5, 2025

LGTM ! updated the readme and fixed the build. I will take a custom build of the package to do some tests before putting the final approval. Thank you @aws-rafams !

@krokoko
Copy link
Collaborator

krokoko commented Feb 6, 2025

Existing bedrock sample works as expected after updating the API for kb creation (VectorKnowledgeBase)

@krokoko
Copy link
Collaborator

krokoko commented Feb 6, 2025

Deployed Kendra KB with index, deployed as expected (kendra index creation takes time - Deployment time: 3441.69s)
Testing the knowledge base after adding a sample data source works as expected:
Screenshot 2025-02-06 at 3 35 56 PM

Created an agent and associated the knowledge base to it, then asked a question. The answer generated uses correctly data retrieved from the KB:
Screenshot 2025-02-06 at 3 36 32 PM

Copy link
Contributor

mergify bot commented Feb 6, 2025

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #938 has been dequeued. The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. (detail: You're not authorized to push to this branch. Visit https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches for more information.)

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@krokoko krokoko merged commit bff2525 into awslabs:main Feb 6, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amazon Kendra GenAI index
4 participants