Skip to content
Download for Mac

Document Search

Type @document-search followed by your query to search through documents attached to the conversation. This tool is the front-end to QARK’s RAG pipeline — it takes your query, runs it against indexed document chunks, and returns the most relevant passages with citations.

Document search results with relevance scores

Before you can search, attach documents to the conversation. QARK provides several ways to do this:

  • Type @/ or @. in the composer — opens a native file picker directly from the keyboard. The @/ and @. characters are removed from your input automatically.
  • Attach menu (+) — click the + button in the composer to access:
    • Add Files — opens a file picker for individual documents
    • Add Folder — opens a folder browser, recursively scans for supported files
    • Add Selected in Finder — grabs the current Finder selection (macOS) without opening a dialog
    • Clipboard History — browse and attach from your recent clipboard entries
  • Drag and drop — drag files or folders directly onto the composer. Folder structure is preserved.
  • Paste — paste images directly from your clipboard into the composer.

Supported file types include PDF, DOCX, XLSX, PPTX, Markdown, HTML, plain text, EPUB, and most source code formats. See File Attachments & Auto-Routing for the full routing logic that determines whether files go to vision or RAG.

Type @document-search in any message. The tool activates and displays the current search strategy in the UI so you know exactly how your query will be processed.

QARK supports 3 query strategies that determine how your search terms are matched against document content:

StrategyHow It WorksBest For
SemanticEmbeds your query and finds chunks with the closest vector similarityDirect questions, specific lookups
HyDE (Hypothetical Document Embedding)Generates a hypothetical answer first, then searches for chunks similar to that answerExploratory questions where you’re not sure of the exact terminology
Step-backReformulates your query into a broader, more abstract version before searchingNarrow questions that need broader context to answer well

The default mode is auto, which lets the AI agent select the best strategy based on your query. You can override this in the tool settings.

Each search result includes:

  • Relevance score — a numerical confidence rating showing how closely the chunk matches your query
  • Result count — the total number of matching chunks returned
  • Source citation — which document and section the passage came from
  • Inline citation badges — clickable references that appear in the agent’s response, linking back to the source passage

When the agent uses information from document search results, it inserts citation badges directly in the response text. Each badge references a specific document chunk. Click the badge to jump to the source passage and verify the information.

When you attach new documents, the RAG pipeline processes them through several stages. The UI displays progress indicators for each stage:

  1. Parsing — extracting text from the document format (PDF, DOCX, etc.)
  2. Chunking — splitting content into overlapping segments
  3. Embedding — generating vector representations of each chunk
  4. Indexing — storing embeddings for retrieval

This progress display is visible during the initial indexing and whenever new documents are added mid-conversation.

Document search works alongside other tools in the same conversation. Common patterns:

  • Document search + web search — verify claims in your documents against live web sources
  • Document search + thinking — enable thinking to reason over multiple retrieved passages before synthesizing an answer
  • Document search + web fetch — pull in a URL to supplement your attached documents with additional context