Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Vertex AI Agent

Hello,

I'm currently testing Google Vertex AI Agent Builder to create a chatbot. I’ve built a chatbot using my data (PDF and DOC files), but when I deploy it on a website, it keeps displaying reference documents in the chat responses and generates download links for these files from the datastore. I want to prevent the chatbot from showing these documents and stop it from creating download links.

Could anyone guide me on how to achieve this?

Thanks.

Solved Solved
0 3 786
1 ACCEPTED SOLUTION

Hi @asimrasool,

Welcome to Google Cloud Community!

The behavior you're seeing of the chatbot displaying reference documents and generating download links indicates that your Agent Builder application is configured to directly expose the underlying data sources. This isn't the intended behavior for a polished user experience. You need to modify how your chatbot interacts with its knowledge base. The solution involves refining the prompt engineering and potentially adjusting the agent's logic. Here's a breakdown of how to address this:

1. Prompt Engineering:

  • Explicit Instructions: The most direct method is to explicitly tell your LLM not to include file names, paths, or download links in its responses. Add clear instructions to your prompt template like: "In your response, do not mention filenames, file paths, or provide any download links. Only summarize the relevant information from the documents." Experiment with different phrasings to find what works best with your chosen LLM model.
  • Output Formatting: Structure your prompt to specify the desired response format. For example, request a concise summary, bulleted points, or a numbered list. Precise output formatting reduces the chance the chatbot will inadvertently include extra details.
  • Contextual Filtering: If your chatbot accesses multiple documents, carefully craft the prompt to guide the LLM to select only the relevant information. Ensuring the prompt makes it clear what information should be excluded.

2. Agent Logic (if using custom code): If you've implemented custom logic (beyond the basic Agent Builder interface), you might need to filter the results before they reach the LLM. You'll likely need to add a field to your document metadata or objects to indicate whether a document is suitable for direct display or should only be used to inform the response.

3. Data Store Configuration: While less likely to solve the problem directly, reviewing the configuration of your data store is prudent. Ensure you're not inadvertently exposing the raw data files or metadata in a way that the agent can directly access. The Agent Builder should be configured to access relevant information and not the files themselves.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

3 REPLIES 3

Hi @asimrasool,

Welcome to Google Cloud Community!

The behavior you're seeing of the chatbot displaying reference documents and generating download links indicates that your Agent Builder application is configured to directly expose the underlying data sources. This isn't the intended behavior for a polished user experience. You need to modify how your chatbot interacts with its knowledge base. The solution involves refining the prompt engineering and potentially adjusting the agent's logic. Here's a breakdown of how to address this:

1. Prompt Engineering:

  • Explicit Instructions: The most direct method is to explicitly tell your LLM not to include file names, paths, or download links in its responses. Add clear instructions to your prompt template like: "In your response, do not mention filenames, file paths, or provide any download links. Only summarize the relevant information from the documents." Experiment with different phrasings to find what works best with your chosen LLM model.
  • Output Formatting: Structure your prompt to specify the desired response format. For example, request a concise summary, bulleted points, or a numbered list. Precise output formatting reduces the chance the chatbot will inadvertently include extra details.
  • Contextual Filtering: If your chatbot accesses multiple documents, carefully craft the prompt to guide the LLM to select only the relevant information. Ensuring the prompt makes it clear what information should be excluded.

2. Agent Logic (if using custom code): If you've implemented custom logic (beyond the basic Agent Builder interface), you might need to filter the results before they reach the LLM. You'll likely need to add a field to your document metadata or objects to indicate whether a document is suitable for direct display or should only be used to inform the response.

3. Data Store Configuration: While less likely to solve the problem directly, reviewing the configuration of your data store is prudent. Ensure you're not inadvertently exposing the raw data files or metadata in a way that the agent can directly access. The Agent Builder should be configured to access relevant information and not the files themselves.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

Hello 

I was able to fix it by making changes to the Data Store Configuration.

Thanks.

How did you do it? I have uploaded a pdf file with the information, but I do not want the file name and path displayed in the resullts. What exactly do I change and how? I have tried adding "do not display.." to the  instructions prompt as suggested above, but it doesn't help.