class RubyLLM::SearchResults

A SearchResults wraps documents a Tool returns so the model can cite them. It serializes to the search-results convention: a tool message whose content is {"search_results": [...]} renders as citable blocks on providers with citation support.

def execute(query:)
  docs = MyVectorStore.search(query)

  RubyLLM::SearchResults.new(
    *docs.map { |doc| { title: doc.name, url: doc.link, text: doc.body } }
  )
end

Cited passages come back on the response as Message#citations.