Seshat AIDocumentation

Documentation / SDK and API

Prompt

How the system prompt is assembled and how to add to it, replace parts of it, or guide individual tools.

The system prompt is built every turn from layers. You customise it with a PromptConfig, without touching the core sections.

How it is assembled

  1. Core sections: identity, runtime contract, working rules, tool use, output discipline.
  2. Runtime context: session, turn number, model, available tools.
  3. Runtime guidance.
  4. Memory context, when memory is enabled.
  5. Stage overlay, when you set a stage other than the default.
  6. Your appended text, always last.

Tool definitions sent to the provider come from the tool registry. Your hints are added to their descriptions.

Configure it

extra := "Always answer in French. Prefer small, reviewable changes."

cfg := sdk.DefaultClientConfig()
cfg.PromptConfig = &sdk.PromptConfig{
    AppendSystemPrompt: &extra,
    ToolHints: map[string]string{
        "bash": "Prefer `rg` over `grep`. Never run commands that need a TTY.",
    },
}
FieldEffect
AppendSystemPromptText added after everything else, every turn. The safest way to add rules
SystemPromptReplaces the whole default prompt. The core sections and stage overlay are then not used
ToolHintsPer-tool guidance added to a tool’s description, keyed by tool name
StageAn overlay for how the model should behave this turn (see below)
StageOverridesReplace the built-in overlay text of a stage

Stages

A stage adds a short instruction for a situation:

StageMeaning
StageDefaultNormal operation, nothing added
StageToolCallThe model is expected to call tools
StageToolResultThe model should work with the tool results it received
StageContinuationResume from where it stopped
StagePlanPlan mode: tools are shown but not executed

For normal use you do not set a stage. StagePlan is the one most apps use, to let the user review a plan first.

On one session

A session can change its prompt after creation:

session.SetAppendSystemPrompt("This conversation is about the billing service.")
session.SetSystemPromptTemplate(template)
session.SetWorkingDirectory("/srv/projects/billing")

Updated on 2026-10-07