Skip to contents

A context layer contains text that helps a commons() agent interpret its data source.

Usage

context_layer(files = character())

Arguments

files

Character vector of paths to text/markdown files to index.

Value

A commons_context_layer object.

Details

Files are chunked and indexed with ragnar when the agent first searches its context. Facts that should be in every prompt belong in the system_prompt passed to commons(), not here.

Examples

path <- tempfile(fileext = ".md")
writeLines("Revenue excludes tax unless stated otherwise.", path)
layer <- context_layer(files = path)