Agent configuration
loadAgent(root, options) loads one agent folder and returns the configuration consumed by
runHeypi() or createHeypi().
const agent = loadAgent("./agent", {
id: "support",
model: modelFromEnv(),
runtime: host({ workspace: "./workspace" }),
state: { dir: ".heypi" },
admin: false,
tools: {},
todo: true,
memory: true,
});Options
modelFromEnv() reads HEYPI_MODEL in provider/model form. Provider credentials use Pi's normal
environment-variable support.
Files and staging
system.md becomes Pi's SYSTEM.md; instructions.md becomes APPEND_SYSTEM.md. Skills, authored
tools, and extensions remain Pi-native resources. Schedules are trusted heypi modules and are not
exposed as agent resources.
heypi stages a clean copy under the state directory, excluding .git, .heypi, and node_modules.
The model and runtime see managed /agent paths, not source-tree host paths.