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

Core sections, always the sameidentity, runtime contract, working rules,factual discipline, tool use, tool priority,workflow, modes, orchestration, browser use,examples, output disciplineRuntime contextsession, turn number, working directory, model, toolsRuntime guidancehow to use the listed tool surface this turnProject instructionsSESHAT.md, AGENTS.md or .seshat/instructions.md, if trustedMemory contextonly when memory is enabledStage overlay, then your texta stage other than the default, then AppendSystemPromptStable and cachedMarked for the provider cache,so repeated turns are cheaperand faster.Rebuilt every turnChanges with the session,the project files, memoryand the stage.Tools travel separatelyDefinitions come from theregistry, with your ToolHintsadded to their descriptions.cache boundaryBEFORE THE BOUNDARYAFTER THE BOUNDARY
The prompt is rebuilt every turn. Only the part after the boundary can change from one turn to the next.
  1. Core sections: identity, runtime contract, working rules, tool use, output discipline and more. They never change, which is why they can be cached by the provider.
  2. Runtime context: session, turn number, working directory, model, available tools.
  3. Runtime guidance.
  4. Project instructions, when the working directory has them (see below).
  5. Memory context, when memory is enabled.
  6. Stage overlay, when you set a stage other than the default.
  7. Your appended text, always last.

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

Project instructions

If the working directory contains an instructions file, its content is added to the prompt every turn, before the memory context. Seshat looks for these files in order and uses the first one that is not empty:

  1. SESHAT.md
  2. AGENTS.md
  3. .seshat/instructions.md

The content is cut at 32 KB. Use it for rules that belong to a project: how to build and test, conventions, things to avoid.

These files are read only for a project you trust. In the terminal interface, run seshat trust first: one command covers the project’s configuration files and its instruction files, and a file is trusted for its exact content, so a change brings the question back. In Go, set ClientConfig.TrustProjectInstructions, a function that receives the path and the content of each file and returns true to use it. Left empty, no instructions file is read at all.

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 overlay: the model is told to describe a plan instead of running tools

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-13