Skip to main content

Interface: IPromptTemplateStoreConfig

Defined in: internal/prompt-template-store/types.ts:7

Configuration of the PromptTemplateStore. Lands in IAIGatewayConfig.promptTemplateStore.

Properties​

cacheTtlMs?​

optional cacheTtlMs?: number

Defined in: internal/prompt-template-store/types.ts:21

How long the active templates stay cached in memory, in milliseconds.

Every call renders CHAT_MAIN; the repository is read once per TTL, not once per call.

activate on this instance drops the cache at once; another instance renders the new version after its TTL.

Example​

5_000 - an admin screen whose activations must show fast on every instance

Default​

60_000

repository​

repository: IPromptTemplateRepository

Defined in: internal/prompt-template-store/types.ts:9

Persistence of the templates: the host's adapter (in memory for the tests and the first run, a database in production).


seedTemplates?​

optional seedTemplates?: Partial<Record<EPromptTemplateKey, string>>

Defined in: internal/prompt-template-store/types.ts:46

Seed body of a template key, used as version 0 while the repository has no active version for that key.

Lets the host ship its own default wording without a repository write.

Every key is optional; a key not given here keeps the shipped seed of the library. An active version in the repository always wins over any seed. A body may use any subset of the placeholders of its key; a placeholder outside the list throws at render.

Placeholders per key:

  • CHAT_MAIN: {format}, {addendum}, {skills}, {cacheBreakpoint}, {today}, {locale}, {timezone}, {instructions}, {context}, {memory}, {kb} {cacheBreakpoint} ends the part that is the same on every call of a profile; the provider may cache everything before it. Only {format}, {addendum} and {skills} may come before it; a template without it is sent as one block, not cached. A body without {skills} drops the skills of a call that has some, with the WARNING issue skills_slot_missing.
  • MEMORY_WORKING: {maxSummaryChars}, {maxFacts}, {summary}, {facts}
  • MEMORY_USER: {maxFacts}, {facts}
  • KB_QUERY_REWRITE: {summary}, {facts}
  • THREAD_TITLE: no shipped seed; a body here is its only version 0

The shipped bodies are the reference for the wording and the layout of every placeholder: src/internal/prompt-template-store/utils/seedTemplates.ts.

Default​

the shipped seed templates of the library