Skip to main content

Interface: FamilyOptions<TInput>

Defined in: packages/core/src/family.ts:50

Type Parameters

TInput

TInput

Properties

key?

optional key?: (input) => string

Defined in: packages/core/src/family.ts:65

Derive the member key from the build input. Defaults to a stable JSON stringify (object keys sorted, so {a,b} and {b,a} collapse). Provide this when the input carries fields that should NOT discriminate members — e.g. key on input.team and ignore a per-request context.

Parameters

input

TInput

Returns

string


max?

optional max?: number

Defined in: packages/core/src/family.ts:86

Cap the memo at this many members, evicting least-recently-built first. Unbounded by default.

The default is deliberate but sharp-edged, so it is stated rather than buried: unlike the dev registry — which is inert outside dev mode and caps itself at MAX_ENTRIES — a family memo runs in production and holds every member for the life of the process. A family keyed by something high-cardinality and long-lived (a request id, a session token, a ticket id) will grow without bound, retaining each member's tools, model config and any conversation history.

It is not capped by default because eviction has a cost the caller has to weigh: a member's identity survives eviction — ids are derived, not generated, so a rebuilt member keeps its id and its override — but its in-memory state does not. Silently discarding a keepHistory bot's conversation is worse than growing, and only the caller knows which risk applies. Set max when members are disposable; leave it unset when they are few, or when their state matters.


name?

optional name?: string

Defined in: packages/core/src/family.ts:58

Stable family id. This is the key the dev registry lists a bot family under and the key a family-wide override is stored against, so it should be a chosen name ('support'), not something derived or generated. Defaults to the build function's .name, then to a generated id — the generated fallback works but gives up cross-restart override stability.