Skip to main content

Document QA

Build a question-and-answer chatbot with a document loaded from local memory.

Prerequisites


Document QA


Create the Document QA project

  1. From the Langflow dashboard, click New Project.
  2. Select Document QA.
  3. The Document QA project is created.

This flow is composed of a standard chatbot with the Chat InputPromptOpenAI, 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

  1. 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.

  1. Click the Playground button. Here you can chat with the AI that has access to your document's content.

  2. Type in a question about the document content and press Enter. You should see a contextual response.

Hallo, wie kann ich Ihnen helfen?