% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rag.R
\name{retrieve_context}
\alias{retrieve_context}
\title{Retrieve Relevant Context for a Query}
\usage{
retrieve_context(store, query, top_k = 3)
}
\arguments{
\item{store}{A ragnar store object from \code{\link[=build_knowledge_base]{build_knowledge_base()}}.}

\item{query}{Character string. The user's question or query.}

\item{top_k}{Integer. Number of chunks to retrieve (default 5).}
}
\value{
A character vector of relevant text chunks with source attribution,
suitable for injecting into an LLM prompt as additional context.
}
\description{
Searches the PRA knowledge base using combined vector similarity search (VSS)
and BM25 full-text search to find the most relevant chunks for a user query.
}
\examples{
\dontrun{
store <- build_knowledge_base()
chunks <- retrieve_context(store, "What is earned value management?")
cat(chunks, sep = "\n---\n")
}

}
