Q: Website Chat Agent
Is it possible to restrict the answers of an embedded ai chat to answers from provided website/uploaded content? If the agent can access all content from the underlying model, it could give answers that are not accurate to the website where it's embedded. If it could only access provided content, answers are much more likely to be relevant to the website and user. If it runs into an unknown question, it would then be helpful to refer the visitor to site contact info. Is this possible?
SeanP_AgenticFlowAI
May 16, 2025A: Hey HRX,
Excellent and very important question about controlling chatbot responses!
Yes, absolutely! This is a core principle of how we design agents in AgenticFlow, especially for website chat and customer support use cases, using Retrieval-Augmented Generation (RAG).
Here's how you achieve this:
1. Provide Specific Knowledge:
Website Content: When you create an agent, you can provide URLs from your website. The agent will crawl and index this content.
Uploaded Files: You can (and should!) upload specific documents (PDFs, DOCX, TXT, etc.) directly to the Agent's Knowledge Base. This could be your FAQs, product manuals, company policies, etc.
Table Data: You can also upload structured data (CSVs/Excel) as a Table Dataset and enable "Knowledge" on it for the agent to query.
2. Instruct the Agent (System Prompt is Key!):
In your Agent's System Prompt (its main set of instructions), you explicitly tell it how to behave. For your use case, you would include instructions like:
"You are a customer support assistant for [Your Website/Company Name]."
"Your primary role is to answer questions ONLY based on the information provided in your knowledge base (the website content and uploaded documents you have been trained on)."
"Do NOT use your general knowledge or information from outside these provided sources."
"If you cannot find an answer to a question within your provided knowledge base, politely state that you don't have that specific information and direct the user to our contact page [link to contact page] or email us at [support email]."
3. How RAG Works:
When a user asks a question, the agent first performs a semantic search across its specific, provided knowledge base (the website content and uploaded files).
It retrieves the most relevant chunks of information from your content.
It then uses the underlying LLM (e.g., Gemini Flash, 4o-mini, or your BYOK model) to synthesize an answer based on that retrieved context.
By strongly instructing the agent in its system prompt to stick to the provided knowledge and defining a clear fallback (like referring to contact info), you can significantly restrict its answers to be relevant and accurate to your website/business, minimizing the chances of it "hallucinating" or providing generic, off-topic answers from its base LLM training.
This combination of a curated knowledge base (RAG) and precise system prompting is how you build a reliable and focused website chat agent.
Hope this helps!
— Sean
Thanks, Sean. I tried to implement this as instructed, but the output didn't seem to find the attached knowledge (I tried adding it via both CSV and PDF), telling me it had no answers when it should be easily accessed from the documents. In some cases it gave me program error messages or responses in Spanish (not part of my prompt in any way). I'm not sure if this is a user error or bugs.
Also, is it possible to delete uploads from the knowledge base? I've done several tests and it appears several documents/CSVs weren't processed properly or at all. Now I'm not see a function to delete them.
Hi HRX, from what you described then the knowledge has been uploaded by not yet "trained". Could you please help to share these info via support@agenticflow.ai. Our support team is happy to review and investigate how to solve this.
Thanks again Sean. About the email you just left I've tried to connect with you directly because with David Fong that has got 2,000 views for you on youtube and we emailed support to connect to you but it's been impossibly hard to get in touch. Any other way?
So, how do we see if it is indexed or not. Is the indexing immediate? Without contacting you how do we know if something has missed indexing?
Hi Christian, after the file uploaded, we shall show a preview and there is button to Train agent. You need to click that so that the agent get trained. We are working on a better way to display the knowledge has been trained. The best way is just to click on the Train button again as we shall identify the gap and retrain.