We’re excited to introduce our revolutionary AI-powered too that can read, understand and answer your questions in an instant! For this example, we are going to use an NDA and by asking a brief question, we can get the information we need quickly and locate it efficiently in the PDF.
This tool is very useful when dealing with large documents. If you need to find a specific detail or answer a complex question, simply upload the document, click “NEXT,” and a new section will open on our bot. Here, type your question into the text area and hit “ASK AI.” Within seconds, the AI does its magic. And here we have the information we were looking for in our NDA, along with the location of the source within the document.
– Let’s build this bot step by step! –
Step 1: Document upload
First, as we always do, let’s type a catchy name and a concise description for our bot.
The purpose of this first section is to upload the document we need answers from. To do this, we’ve added a “files node.” Make sure to toggle on the “use in AI Output” option, and then create or adjust the AI Settings according to your needs. This ensures the AI can analyze the document and provide accurate answers.
Step 2: AI configuration
Afterwards, in our second section, we have included a “text area” node where our client or college can input a question related to the document content.
Next, we add an “AI output” node to unleash the AI power. For our example, we have chosen the same AI settings we selected earlier in the “files” node. However, you can always use a preexisting setting or create new ones that best fit your needs. This ensures the AI processes the input correctly and delivers precise answers. Do not forget to activate “link to files node” switch and choose the File for the AI to have access to the document uploaded on the frontend.
Now it’s time for something you may be familiar with: prompt creation. First, we enter a “system prompt” providing the necessary context and instructions for the AI. Here, we instruct the AI to answer questions about the uploaded document. Second, we input a “dynamic prompt” where we define the query. In our example, we include the “text area” variable, which contains the user’s question from the frontend. This ensures the AI always knows what type of information to search for in the document.
To finalize this node, we included a dedicated button called “Ask AI” that triggers the AI as soon as it’s pressed on the front end. This button will also re-trigger the AI whenever the question in the text field changes. These settings are ideal for our example, but you can adjust them to better suit your needs, especially if you incorporate this functionality into a more complex bot.
Step 3: Map up
Now, also with the help of the AI, we are going to create the “variable mapper” node. If you need some ideas, check the explanatory text below to get inspired by the prompt we have used in this video. In this example, we are using the Variable Mapper node to obtain different details about the sources that the AI has analysed and used to generate the answer as we requested on the prompt.
Once the AI has generated the Variable Mapper node, you will see a dropdown. In this example, we have selected the AI Output variable, as we want to extract data from the results of that node. This allows us to gather detailed information about the sources, ensuring transparency and accuracy.
Next, we include a “text field” node to display the AI’s answer on the frontend. This answer is generated by the AI output node, so we need to link its variable to the text field node for it to be shown.
Step 4: Source extraction
As we reach the end of this bot, we want to display the information about the sources, but only if the AI provided an answer. To achieve this, we include a logical condition specifying that the next node, an annotation node, will only appear if we have an answer from the AI.
Next, we add the annotation node I just mentioned, and we include the variables generated in the variable mapper node we created earlier. In this example, we will display the page number, page content, and file name from which the AI based its answer.
And this is the end! You have now learned how to create an AI-powered bot to ask questions about any kind of PDF document you wish and get your questions answered in a breeze.
Happy automating with e!