DefineFactOptions
Interface: DefineFactOptions
Defined in: src/lib/injection-engine/factories/defineFact.ts:34
Properties
activeWhen?
readonlyoptionalactiveWhen?: (ctx) =>boolean
Defined in: src/lib/injection-engine/factories/defineFact.ts:53
Trigger control. Defaults to always-on. For conditional facts
(e.g., "only show user profile after iteration 3"), pass a
predicate via activeWhen.
Parameters
ctx
Returns
boolean
cache?
readonlyoptionalcache?:CachePolicy
Defined in: src/lib/injection-engine/factories/defineFact.ts:61
Cache policy for this fact injection. Defaults to 'always' —
facts are typically static data the LLM should always have in mind.
Override with 'never' for facts containing volatile content
(e.g., a Current time: fact); use { until } for time-bounded
facts.
data
readonlydata:string
Defined in: src/lib/injection-engine/factories/defineFact.ts:38
The fact (data string) to inject.
description?
readonlyoptionaldescription?:string
Defined in: src/lib/injection-engine/factories/defineFact.ts:36
id
readonlyid:string
Defined in: src/lib/injection-engine/factories/defineFact.ts:35
role?
readonlyoptionalrole?:ContextRole
Defined in: src/lib/injection-engine/factories/defineFact.ts:47
When slot: 'messages', the role to use. Default 'system'.
slot?
readonlyoptionalslot?:"system-prompt"|"messages"
Defined in: src/lib/injection-engine/factories/defineFact.ts:45
Which slot to land in. Default 'system-prompt' (most common —
facts the model should always have in mind).
'messages' for facts that should appear inline with the
conversation history (use sparingly — increases token cost).
