% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/llama.R
\name{llama_memory_clear}
\alias{llama_memory_clear}
\title{Clear the KV cache}
\usage{
llama_memory_clear(ctx)
}
\arguments{
\item{ctx}{Context handle returned by [llama_new_context]}
}
\value{
No return value, called for side effects.
}
\description{
Removes all tokens from the KV cache. Call this before starting
a new generation from scratch.
}
\examples{
\dontrun{
# Clear the KV cache to start a fresh conversation
llama_memory_clear(ctx)
result <- llama_generate(ctx, "New topic: ", max_new_tokens = 50L)
}
}
