Skip to content

Unable to run query in Prompt flow builder/ Rest API

0

Hi, I am trying to use Prompt flow in our application. For that, I just followed this AWS official video https://youtu.be/_Bmk6peAHao?si=CuksHwTVPoni2AgK , then i have created a prompt flow with a knowledge base. When I try run with a basic question like "What is <XXXXXXX> " , then I am getting following error -> "Knowledge base retrieval query in knowledge base node NXTestNode exceeds the limit of 1000 characters. Shorten the query and retry your request." I need help to resolve this error. Enter image description here

1 Answer
0

Hi, to start understanding what's happening in the RAG involving the knowledge base, you should start by tracing to see what chunks are retrieved in the KB and how the prompt is built with those chunks to see why it exceeds the limit.

The tracing of such activity is detailled here: https://repost.aws/articles/AR-LV1HoR_S0m-qy89wXwHmw/the-leverage-of-llm-system-prompt-by-knowledge-bases-for-bedrock-in-rag-workflows

Best,

Didier

EXPERT
answered a year ago
  • Hi , Thank you for your comment . Yes I understand how RAG works. Here my doubt is, In this Prompt flow, its quit simple and very basic . but there no placeholder to set/modify that 1000 limit. How its says my query exceeds 1000 characters. My question is simple "what is pmi". So i need help where and how to fix this . Do you see any complexity in my Prompt flow. I think its very very basic and simple.

  • Your issue might be that the RAG returns text chunks at retrieve stage that are finally too big for the generates stage in the retrieve_and_generate verb used for this prompting. Tracing as suggested would allow you to see those chunks of text and validate that they are not too big.

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.