pagepiper/docs/user-guide/chat.md

39 lines
1.8 KiB
Markdown

# Chat
RAG (retrieval-augmented generation) chat lets you ask natural-language questions and get answers grounded in your document library. Requires Ollama — see [Ollama Setup](../getting-started/ollama-setup.md).
## Asking a question
1. Click **Chat** in the navigation bar
2. Optionally select one or more documents to restrict the search scope
3. Type your question and press Enter or click Send
Pagepiper retrieves the most relevant page excerpts using hybrid BM25 + vector search, then passes them to the local LLM with instructions to answer using only the provided text and cite every claim with a page number.
## Citations
Each answer includes a citation panel showing the source pages used. Citations include:
- Document title
- Page number
- A short text excerpt from that page
If the answer says `[p.42]`, you can cross-reference the citation panel to see exactly what text the model read.
## Multi-document chat
Leave the document selector empty to search across your entire library. When you have many books indexed, scoping to a specific document gives more precise results.
## Context window
Pagepiper fetches the top 10 matching pages plus one adjacent page on each side of every hit. This ensures mid-paragraph chunk boundaries don't cut off context that the model needs to understand a passage.
## Limitations
- The model answers using only the retrieved excerpts. If the relevant passage was not retrieved, the model will say it cannot find an answer.
- Chat history is kept in the browser session only. Refreshing the page clears the conversation.
- RAG chat is gated behind a local Ollama instance. Cloud LLM backends are not currently supported on the Free tier.
## Feedback
Use the thumbs up / thumbs down buttons after each answer to flag good and bad responses. Feedback is stored locally in `data/pagepiper.db` for future quality review.