Retrieve documents (chunks of text) from a text store.

retrieve(x, from, ...)

Arguments

x

The query, which by default is embedded and used as a query to a vector store based on cosine similarity.

from

The TextStore as returned by text_store.

...

Parameters for the query. By default, the supported parameters are k (the number of nearest neighbor documents to return) and min_similarity (the minimum allowed cosine similarity of the returned documents to the query).

Value

A data.frame with a column “text” containing the text of each document, along with any metadata columns.

Author

Michael Lawrence

See also

rag_with, which implements the full RAG workflow.

Note

The RAG capabilities of wizrd are currently experimental and quite primitive. They may be removed or moved to a different package in the future.

Examples

if (FALSE) { # \dontrun{
    chunks <- chunk(tools::Rd_db("S7"))
    store <- text_store(nomic(), chunks)
    retrieve("new_property example", store)
} # }