Find answers from the community

Updated 2 years ago

going over the example in the documentation for How to Build a Chatbot. If the index canno

At a glance
@kapa.ai going over the example in the documentation for How to Build a Chatbot. If the index cannot find the answer in the database(all the 10K), will it resort to the actual chatgpt api and find the response?
https://gpt-index.readthedocs.io/en/latest/guides/tutorials/building_a_chatbot.html#
k
R
L
11 comments
Please stand by @Rouzbeh as I search the knowledge base. We are experiencing especially high traffic right now and might take longer than usual. :wave:
----------------------
The tutorial on How to Build a Chatbot (https://gpt-index.readthedocs.io/en/latest/guides/tutorials/building_a_chatbot.html) demonstrates how to create a context-augmented chatbot using LlamaIndex for data retrieval and Langchain for the underlying Agent/Chatbot abstractions. However, it doesn't explicitly mention resorting to the actual ChatGPT API if the index cannot find an answer in the database.

To achieve this fallback behavior, you would need to implement additional logic in your chatbot to call the ChatGPT API if LlamaIndex doesn't provide a satisfactory answer. This is not covered in the tutorial, but you can explore the OpenAI API documentation (https://beta.openai.com/docs/) to learn how to use the ChatGPT API directly.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
For example, database has no mention of the president of the united state but when I ask it who is president of the united states, it mentions joe bide
It's not supposed to do this (the prompt says to use only the information provided), but the models don't always follow instructions... especially gpt-3.5 (which imo is not a great model lately)
okay - I'll try it with gpt-4
yea gpt-4 or text-davinci-003 should hopefully be a little better
@Logan M this behavior does repeat itself with gpt-4 as well
Plain Text
> Entering new AgentExecutor chain...

Thought: Do I need to use a tool? No
AI: The current President of the United States is Joe Biden.
Oh you are using langchain. Yea that part of the agent is prett6 annoying to configure/use
I see - Thanks @Logan M
What is your recommendation for a chatbot that uses only my database?
My recommendation is a lot of prompt engineering lol

At the end of the day though, you can never guarantee 100% it will only use your data, it's kind of the nature of LLMs
Okay - makes sense - thanks @Logan M
Add a reply
Sign up and join the conversation on Discord