Skip to main content

Document Q&A

The Document Q&A template lets users upload a file and ask questions about its content. The LLM reads the document and answers questions based solely on what's in the file — without hallucinating information that isn't there.

How the flow works​


_10
File → Prompt → Language Model → Chat Output
_10
↑
_10
Chat Input

The File component loads the document and passes its text content to the Prompt component. The Prompt merges the document text with the user's chat message and sends it to the Language Model, which generates an answer grounded in the document.

Prerequisites​

  • An API key for a supported LLM provider (e.g., OpenAI)
  • A document to upload (PDF, TXT, DOCX, and other common formats are supported)

Quickstart​

  1. In Orbis Studio, open the Templates library and select Document Q&A.

  2. In the Language Model component, add your LLM API key and select a model.

  3. In the File component, upload the document you want to query.

  4. Open the Playground and ask a question about the document — for example: "What is the main conclusion of this report?"

Key components​

ComponentRole
Chat InputReceives the user's question from the Playground
FileLoads and extracts text from the uploaded document
PromptCombines the document content and user question into an LLM prompt
Language ModelAnswers the question based on the document content
Chat OutputDisplays the answer in the Playground

Configuration tips​

  • Supported file types: PDF, TXT, DOCX, CSV, and most plain-text formats. Very large files may be truncated depending on the model's context window.
  • Prompt tuning: Edit the Prompt template to add instructions like "answer only from the document, say I don't know if the answer is not there."
  • Multiple documents: To query several files at once, add more File components and connect each one to the Prompt.

Next steps​