Document QA
Build a question-and-answer chatbot with a document loaded from local memory.
Prerequisitesā
Document QAā
Create the Document QA projectā
- From the Langflow dashboard, clickĀ New Project.
- SelectĀ Document QA.
- TheĀ Document QAĀ project is created.
This flow is composed of a standard chatbot with theĀ Chat Input,Ā Prompt,Ā OpenAI, andĀ Chat OutputĀ components, but it also incorporates a File component, which loads a file from your local machine. Parse Data is used to convert the data from File into theĀ PromptĀ component asĀ {Document}
. TheĀ PromptĀ component is instructed to answer questions based on the contents ofĀ {Document}
. This gives theĀ OpenAIĀ component context it would not otherwise have access to.
Run the Document QAā
- To select a document to load, in theĀ FileĀ component, click theĀ PathĀ field. Select a local file, and then clickĀ Open. The file name appears in the field.
-
Click theĀ PlaygroundĀ button. Here you can chat with the AI that has access to your document's content.
-
Type in a question about the document content and press Enter. You should see a contextual response.