Skip to content

Multiple Retrieved Documents

0

My bedrock agent is configured with only one KB which have a bunch of unique documents. But when I am using a invoke agent and see the traces, I am finding that in the KB lookup retrieved references there are multiple of the same document, same chunk, same metadata being retrieved multiple times. What all could be the reason for this behaviour.

asked a year ago305 views

2 Answers
0

When your Amazon Bedrock agent with a single knowledge base retrieves multiple instances of the same document or chunk during invocation, there could be several reasons for this behavior:

  1. Knowledge base configuration: The default settings might be retrieving more document chunks than necessary. You may need to adjust the number of document chunks retrieved from the knowledge base to optimize performance.

  2. Vector search similarity: If your query has strong semantic similarity to a particular document chunk, the vector search might rank the same document highly multiple times, especially if different parts of the document are relevant to the query.

  3. Metadata filtering issues: If you're using metadata filters, they might not be properly narrowing down the results, causing duplicate retrievals.

  4. Agent optimization settings: Check if your agent meets the optimization conditions for single knowledge base usage. Your agent should have only one knowledge base, no action groups (or all disabled), not request additional information from users, and use the default orchestration prompt template.

  5. Orchestration complexity: The prompt structure and complexity can affect how the agent processes and retrieves information from the knowledge base.

To address this issue, you could:

  • Review and adjust your knowledge base configuration settings
  • Optimize your metadata and filtering approach
  • Check that your agent is properly configured for single knowledge base optimization
  • Consider reviewing the orchestration prompt template if you've customized it

This behavior might also impact performance, as retrieving and processing duplicate documents can increase latency in your agent's responses.
Sources
Troubleshoot latency and optimize Amazon Bedrock Agent performance | AWS re:Post
Optimize performance for Amazon Bedrock agents using a single knowledge base - Amazon Bedrock
Limit on number of filters passed into invoke agent | AWS re:Post

answered a year ago

AWS
SUPPORT ENGINEER

reviewed a year ago

0

Hey,

Hope you're keeping well.

This usually happens when the vector search in your Bedrock knowledge base returns multiple chunks from the same document that all score highly for relevance. Even if the content is identical, each chunk is stored and ranked independently. You can reduce duplicates by lowering the retrievalConfig.numberOfResults in your KB settings, refining chunking parameters when ingesting documents, or adding more specific metadata filters to narrow matches. It’s also worth reviewing the ingestion process to ensure chunks aren’t inadvertently duplicated in the index.

Thanks and regards,
Taz

answered a year 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.