-
Notifications
You must be signed in to change notification settings - Fork 344
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
Add Amazon Bedrock Knowledge base as a RAG Engine (retriever) #427
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
7ef5741
feat(kb): initial
massi-ang 8c33443
feat(bedrock_kb): initial
massi-ang 9767716
Merge remote-tracking branch 'origin/main' into feat_bedrock_kb
massi-ang e4af35c
Merge remote-tracking branch 'origin/main' into feat_bedrock_kb
massi-ang e92cd0b
feat(bedrock_kb): knowledge base support
massi-ang 17c38de
Merge remote-tracking branch 'origin/main' into feat_bedrock_kb
massi-ang 32142d5
Merge remote-tracking branch 'origin/main' into feat_bedrock_kb
massi-ang 242489b
feat(bedrock_kb): delete workspaces
massi-ang c1aac6e
feat(bedrock_kb): config
massi-ang dc10d8d
Merge remote-tracking branch 'origin/main' into feat_bedrock_kb
massi-ang e95cecf
feat(bedrock_kb): hybrid search
massi-ang b038f22
feat(bedrock_kb): upgrade boto3
massi-ang c8a0fba
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang 065227d
fix(cohere_embeddings): correct set the `input_type`
massi-ang 020b2d4
Merge branch 'fix_cohere_embeddings' into feat_bedrock_kb
massi-ang 2a1645f
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang ec0eb7c
feat(kb): add Bedrock KB to the welcome page
massi-ang a4e10b5
fix(no unused var): correct ignore
massi-ang 78ff010
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang e8640b1
Merge branch 'main' into feat_bedrock_kb
massi-ang f7a0137
fix: correct enum values
massi-ang 0848760
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang 815490e
feat(bedrock_kb): metadata filters
massi-ang 2ba5efb
feat(bedrock_kb): dedup
massi-ang 147142e
feat(llama3): adapter
massi-ang 2ad2191
Merge branch 'main' into feat_bedrock_kb
massi-ang 765236a
Merge branch 'feat_llama3' into feat_bedrock_kb
massi-ang d8aead6
feat(bedrock_kb): merge to latest
massi-ang 7a5cfcd
chore: updating code to use langchain-community
massi-ang d36c5ea
Merge branch 'chore-langchain-upgrade' into feat_bedrock_kb
massi-ang 5ba2164
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang 409dd3f
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang 746d4dd
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang bac229c
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang b143fa3
feat(bedrock): fix error
massi-ang 8a5ef88
Merge branch 'feat_bedrock_kb' of github.com:aws-samples/aws-genai-ll…
massi-ang 6a36795
fix(bedrock_kb): magic cli
massi-ang 8436514
Merge branch 'main' into feat_bedrock_kb
massi-ang 92796c7
fix: correct path to compiled files
massi-ang ff66d30
Merge branch 'fix_config_path' into feat_bedrock_kb
massi-ang 3a31dc7
Merge branch 'feat_bedrock_kb' of github.com:aws-samples/aws-genai-ll…
massi-ang 382e112
chore: removed wrongly tracked file
massi-ang 208b976
fix: fix review feedback
massi-ang d4b62d4
fix: remove feature under development
massi-ang 00f976e
Merge branch 'main' of github.com:aws-samples/aws-genai-llm-chatbot i…
massi-ang 6d6149a
fix: typescript errors
massi-ang 293e5de
fix: ignore code un `dist` to avoid recursive builds
massi-ang 871dcc1
Merge branch 'fix_tsconfig_error' into feat_bedrock_kb
massi-ang d36f8d9
tests: update test snapshot and fix call order
massi-ang 5058bb9
test: fix rag tests
massi-ang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
lib/chatbot-api/functions/api-handler/routes/bedrock_kb.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import genai_core.parameters | ||
import genai_core.bedrock_kb | ||
from pydantic import BaseModel | ||
from aws_lambda_powertools import Logger, Tracer | ||
from aws_lambda_powertools.event_handler.appsync import Router | ||
|
||
tracer = Tracer() | ||
router = Router() | ||
logger = Logger() | ||
|
||
|
||
class KendraDataSynchRequest(BaseModel): | ||
workspaceId: str | ||
massi-ang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
@router.resolver(field_name="listBedrockKnowledgeBases") | ||
@tracer.capture_method | ||
def list_bedrock_kbs(): | ||
indexes = genai_core.bedrock_kb.list_bedrock_kbs() | ||
|
||
return indexes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: suggestion bedrock or bedrockKnowledgeBase. Other properties name the service.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they? I see
aurora
,kendra
, ...