Skip to content

Ask questions and read citations ​

Type a question in the LocalRAG web page and the answer streams in, followed by citation chips that show where it came from. This page explains what happens behind each answer and how to read it.

Ask a question ​

  1. Type your question in the box that reads Ask a question….

  2. Press Enter or select Send. Use Shift + Enter for a new line.

  3. Read the answer as it appears, then the chips underneath.

What happens behind an answer ​

  1. LocalRAG turns your question into an embedding with the same model it used for your documents.

  2. It finds the five chunks closest to the question. This number, called top-k, can be changed.

  3. It drops every chunk whose similarity score is below the score threshold, 0.30 by default.

  4. If no chunk is left, it answers I don't know based on the indexed documents. straight away, without calling the model.

  5. Otherwise it sends the chunks and your question to the Ollama model, with an instruction to answer only from that text and to give the same "I don't know" reply if the answer is not there.

  6. The answer streams back, followed by the citations.

Read the citations ​

Each chip names a document and a page, such as manual.pdf · p.12. Hover over a chip to see its score.

  • One chip per page. If several chunks came from the same page, the page is listed once, with its best score.
  • Best match first. Chips are sorted by score, highest first.
  • The score is the cosine similarity between your question and the passage. Higher means a closer match; most scores fall between 0 and 1. It measures how alike the meanings are, not whether the answer is correct.

The chips show the pages the model was given, not a proof of each sentence. For anything important, open the document at the cited page and check.

Write questions that work well ​

  • Use the words your documents use. If the manual says "flow rate", ask about "flow rate", not "how fast the water goes".
  • Ask one thing at a time. Two questions in one sentence pull in passages for both and can blur the answer.
  • Be specific. "What is the warranty period for the X200 pump?" finds better passages than "warranty?".
  • Each question stands alone. LocalRAG does not remember earlier questions, so repeat the subject instead of writing "and what about it?".

When the answer is "I don't know" ​

That means no passage was close enough, or the model did not find the answer in the passages it got. Try:

  • Rewording the question with the terms the document uses.
  • Checking that the right document is in the Documents list.
  • Checking that a PDF has real text: try selecting text in it in a PDF viewer.
  • Lowering the score threshold a little, for example to 0.25. See Configuration. A lower threshold lets in weaker matches, so answers may wander more.

If an answer stops with an error ​

If Ollama stops partway, the answer shows an error message and no citations. The words already received stay on screen. If the page shows Connection lost while streaming the answer, the connection to the LocalRAG server dropped. Check that the server and Ollama are running, then ask again.

Next steps ​