Skip to content

Bedrock Knowledge Base No-Chunk Method Failure Unexpectedly

0

Hello

We are trying to build the knowledge base through bedrock Our data is the description of each product. Since there are multiple languages involed, we choose "Embeddings model Model Embed Multilingualv3 Vector dimensions 1024" region : Virginia

At first, we list each item and append its' description/link/image in a row All rows are saved in one .csv file. ( we tried pdf/txt also ) However choosing the 'Default Chunk' method, it breaks the one-row-one-item scheme and when we chat with documents, the knowledge is too separate to describe one product well.

Hence, we try to use the 'No Chunk' method. we make one-file-describe-one-product and save all of them in s3 bucket (every file contains few hundred tokens approximately, maybe some are more than that) However when we chose the bucket location as our knowledge base source. It always failed to 'data source sync' and show the message of "Sync failed for data source - 'knowledge-base-quick-start-data-source"

Do you know how to solve this, or maybe alternatives for this issue?

Really appreciated Have a good day~

2 Answers
0

I understand you're facing challenges with building a knowledge base through Amazon Bedrock for your product descriptions. Let me provide some insights and potential solutions for your issue.

The 'No Chunk' method you're attempting to use can be a good approach for maintaining the integrity of each product description. However, there are a few things to consider when using this method:

  1. Custom Transformation: When using the 'No Chunk' strategy, you typically need to define a custom transformation Lambda function to handle the chunking logic. This function should contain your specific chunking requirements.

  2. S3 Bucket Configuration: You need to specify an Amazon S3 bucket for the knowledge base to write files that will be chunked by your Lambda function. Make sure you have properly configured this bucket and that Bedrock has the necessary permissions to access it.

  3. File Size Limitations: Ensure that your individual files don't exceed the ingestion job file size limit specified in Amazon Bedrock's quotas. If some of your files contain more than a few hundred tokens, they might be exceeding this limit.

  4. Lambda Function Implementation: Your Lambda function should write the chunked files back into the same S3 bucket and return references for the knowledge base for further processing.

  5. KMS Key (Optional): You have the option to provide your own AWS KMS key for encryption of files being stored in your S3 bucket.

To troubleshoot the "Sync failed" error:

  1. Check your IAM permissions: Ensure that the IAM role you're using has the necessary permissions to access the S3 bucket and perform the required operations.

  2. Verify data formats: Confirm that all your files are in supported formats (.txt, .md, .html, .doc, .docx, .csv, .xls, .xlsx, .pdf).

  3. Review sync history: In the Amazon Bedrock console, go to the Knowledge bases section, select your data source, and check the Sync history for more detailed error messages or warnings.

  4. Consider using the API: If the console doesn't provide enough information, you might get more detailed error messages by using the API to start and monitor the ingestion job.

If the 'No Chunk' method continues to fail, you might consider these alternatives:

  1. Use the default chunking method, but adjust your data preparation strategy. Instead of putting each product in a separate file, you could create a single file with clear demarcations between products. This might help maintain product integrity while still allowing for chunking.

  2. Implement a custom chunking strategy using a Lambda function, even with the default chunking method. This would allow you to add product-specific metadata to each chunk, helping to maintain the connection between chunks of the same product.

  3. Explore the hierarchical chunking option, which allows for nested structures of parent and child chunks. This could potentially help in maintaining the overall structure of your product descriptions while still allowing for efficient retrieval.

Remember to monitor your sync history and review any warnings or error messages to further diagnose and resolve the issue.
Sources
How content chunking and parsing works for knowledge bases - Amazon Bedrock
Sync your data with your Amazon Bedrock knowledge base - Amazon Bedrock
Preview – Connect Foundation Models to Your Company Data Sources with Agents for Amazon Bedrock | AWS News Blog

answered 2 years ago

  • since when we chose 'default chunk' method, the sync is fine, so we think s3 permission is fine. It seems that the hierarchical chunking option is better for our case ? Do you know how can we implement it ? maybe we have to arrange the knowledge doucment file with the friendly-format for it to do the hierarchical chunk.

0

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.