llama-index retrievers bedrock integration
Project description
LlamaIndex Retrievers Integration: Bedrock
Knowledge Bases
Knowledge bases for Amazon Bedrock is an Amazon Web Services (AWS) offering which lets you quickly build RAG applications by using your private data to customize FM response.
Implementing
RAG
requires organizations to perform several cumbersome steps to convert data into embeddings (vectors), store the embeddings in a specialized vector database, and build custom integrations into the database to search and retrieve text relevant to the user’s query. This can be time-consuming and inefficient.
With
Knowledge Bases for Amazon Bedrock
, simply point to the location of your data inAmazon S3
, andKnowledge Bases for Amazon Bedrock
takes care of the entire ingestion workflow into your vector database. If you do not have an existing vector database, Amazon Bedrock creates an Amazon OpenSearch Serverless vector store for you.
Knowledge base can be configured through AWS Console or by using AWS SDKs.
Installation
pip install llama-index-retrievers-bedrock
Usage
from llama_index.retrievers.bedrock import AmazonKnowledgeBasesRetriever
retriever = AmazonKnowledgeBasesRetriever(
knowledge_base_id="<knowledge-base-id>",
retrieval_config={
"vectorSearchConfiguration": {
"numberOfResults": 4,
"overrideSearchType": "HYBRID",
"filter": {"equals": {"key": "tag", "value": "space"}},
}
},
)
query = "How big is Milky Way as compared to the entire universe?"
retrieved_results = retriever.retrieve(query)
# Prints the first retrieved result
print(retrieved_results[0].get_content())
Notebook
Explore the retriever using Notebook present at: https://docs.llamaindex.ai/en/latest/examples/retrievers/bedrock_retriever/
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file llama_index_retrievers_bedrock-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_retrievers_bedrock-0.3.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec91be211d64a7f60ba5fc328721d42b6eb23f6f6657f96988be943e1946a4e4 |
|
MD5 | 81076e150cc338d282f911f4f509c030 |
|
BLAKE2b-256 | 317fa64f75db12c0a79976736042cfa39299e3c824900c288d754b193a21caaf |
File details
Details for the file llama_index_retrievers_bedrock-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_retrievers_bedrock-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ae91c21ae52189bb263853893325fc06d5bb5a182d82b5cad94446fa4e63e42 |
|
MD5 | 490c341ebbae5fb9f7b47616948319ff |
|
BLAKE2b-256 | 5dfd438f1f5fce86c2e4e4ec367f3ab65c9a5d50debd21a499ef6676a910ef72 |