Planck.Agent.SystemPrompt (Planck.Agent v0.1.4)

Copy Markdown View Source

Assembles the runtime system prompt for an agent.

Called before every LLM turn by the agent's private build_system_prompt function. Sections are added only when the relevant tools are present in the agent's tool map, so agents only receive guidance for what they can actually do.

Assembly order

  1. Identity line — "You are a <type>." / "You are <name>, a <type>."
  2. Base system prompt from spec.system_prompt
  3. Per-tool guidance sections (one per inter-agent tool present)
  4. Skills section (from skill_refresh_fn if present)

Summary

Types

Fields extracted from the agent state needed to build the prompt.

Functions

Build the full system prompt for an agent turn.

Types

opts()

@type opts() :: %{
  system_prompt: String.t(),
  name: String.t() | nil,
  type: String.t() | nil,
  tools: %{required(String.t()) => Planck.Agent.Tool.t()},
  skill_names: [String.t()],
  skill_refresh_fn: (-> [Planck.Agent.Skill.t()]) | nil
}

Fields extracted from the agent state needed to build the prompt.

Functions

build(map)

@spec build(opts()) :: String.t()

Build the full system prompt for an agent turn.