Skip to content

Creating Knowledge Base with Images as data source, Bedrock Agent unable to read from it.

0

Hi, I am trying to find the best way to store images as a knowledge base for a foundation model(FM) that can handle image processing. I have noticed that even though the FM is capable of digesting what is in an image, when I create my agent for the FM, and pass images through to it, it won't:

A. Read from the knowledge Base(KB) or B. Accept an image as a valid attachment.

Similarly, when I attempt to give my agent a PDF to examine, the agent response with "The file you have attached is empty" even though it most certainly is not. I can only see some logs from the trace as to what the Agent tried to do in the background but nothing of use that I can see.

So to tie this all in a bow, my question summarised is:

<h4>Can Agents for a FM that is able to handle images actually handle images ? What is the best way to create a vector store or KB for images ? </h4>
2 Answers
0

Yes, Amazon Bedrock Knowledge Bases can handle images, but there are some important considerations and limitations to be aware of when working with multimodal data (including images) in knowledge bases and with agents.

Amazon Bedrock Knowledge Bases supports a variety of document types, including text, images, and multimodal documents that contain tables, charts, diagrams, and other visual elements. However, the support for multimodal data is currently limited to specific data sources.

For creating a knowledge base with images or multimodal data:

  1. Data Source: Currently, Amazon S3 and custom data sources are the only options that support handling multimodal data in Amazon Bedrock Knowledge Bases.

  2. Parser Selection: When connecting your knowledge base to a data source containing multimodal data (including images), you must choose a parser that supports parsing multimodal data.

  3. Embeddings Model: You need to select an embeddings model that can convert the multimodal data into vector embeddings.

  4. Vector Store: Choose a vector store that can handle the vector representations of your multimodal data.

When it comes to agents and foundation models (FMs) that can process images:

  1. Knowledge Base Integration: While some FMs can process images, the integration between agents and knowledge bases for image processing may not be fully developed or optimized yet.

  2. API Operations: The RetrieveAndGenerate API operation can leverage insights from images when generating text responses and provide source attribution for the images. However, this capability might not be fully integrated with all agent functionalities.

  3. Attachment Handling: The issues you're experiencing with agents not accepting image attachments or misreading PDFs suggest there might be limitations or bugs in the current implementation of image handling for agents.

For the best way to create a vector store or knowledge base for images:

  1. Use Amazon S3 or a custom data source that supports multimodal data.
  2. Ensure you're using a parser and embeddings model that can handle image data.
  3. Choose a vector store that's compatible with multimodal embeddings.

Given the challenges you're facing, it's possible that the full capabilities for image handling in agents are still being developed or refined. You may want to check for the latest updates on Amazon Bedrock documentation or reach out to AWS support for the most current information on image handling capabilities and best practices for your specific use case.
Sources
Build a knowledge base by connecting to a data source - Amazon Bedrock
Turning data into a knowledge base - Amazon Bedrock
Retrieving information from data sources using Amazon Bedrock Knowledge Bases - Amazon Bedrock

answered 2 years ago

0

While the answer doesn't directly troubleshoot the problems you're experiencing with your agent not reading from the knowledge base or accepting image attachments, it may provide a framework that could help resolve these issues. Image Handling by Agents for Foundation Models: While the answer doesn't directly address the specific issue you're facing with your agent, it does provide valuable information on how to process and handle images using AWS services. The Serverless Image Handler solution and the use of AWS Batch for image vectorization are particularly relevant approaches that could be integrated into your agent's workflow.

Best Way to Create a Vector Store or KB for Images:
The answer provides several solid options for creating a vector store or knowledge base for images:

a) It suggests using vector databases like Amazon DocumentDB, Amazon OpenSearch, or Amazon Aurora with 'pgvector' for storing and searching vector embeddings.

b) It mentions the use of AWS Batch for processing images at scale and creating vector embeddings.

c) It proposes a combination of Amazon S3 for raw image storage and databases like DynamoDB or DocumentDB for metadata and vector embeddings.

d) The use of Amazon Titan Multimodal Embeddings for creating embeddings from images, which is directly relevant to your question about foundation models capable of handling images.

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.