Skip to content

Graphorin API reference v0.12.1


Graphorin API reference / @graphorin/memory / / buildSummarizerPrompt

Function: buildSummarizerPrompt()

ts
function buildSummarizerPrompt(input): string;

Defined in: packages/memory/src/context-engine/compaction/templates/summary-9-section.ts:79

Build the prompt the summarizer LLM receives. The prompt contains:

  1. The locale-resolved preamble.
  2. The verbatim section list (1-9, with a note that section 8 is filled by the harness).
  3. A delimited dump of the older messages the harness is about to drop.

The summarizer produces every section except the last two; those (recent turns + metadata) are stitched in by the harness before the result is committed to the in-flight buffer.

Parameters

ParameterTypeDescription
input{ maxDumpChars?: number; olderMessages: readonly Message[]; template: RenderedTemplate; }-
input.maxDumpChars?numberCharacter budget for the message dump (context-engine-07). When the rendered dump exceeds it, the OLDEST lines are elided (newest kept) and a marker notes how many were dropped. undefined ⇒ default DEFAULT_SUMMARIZER_DUMP_CHAR_BUDGET; 0 disables the cap.
input.olderMessagesreadonly Message[]-
input.templateRenderedTemplate-

Returns

string

Stable