Skip to Content

Function briefing

  • Render what the service says about a domain, for a model to be told.

    The substance of this comes from listDomains and from opening the session — what the domain holds, when to draw on it, what belongs in it, and the tag vocabulary it uses. What this adds is the connective prose around them, and the sentence naming the two operations a bound session has already answered. Supply it up front rather than leaving a model to ask: guidance behind a tool only steers the models that reach for it.

    Parameters

    • domain: DomainEntry

      The domain the session was opened in, from listDomains.

    • instructions: Instructions

      What the service said when the session was opened, as carried by the scope's instructions.

    Returns string

    The guidance as text, ready to be a system prompt or part of one.

    const { domains } = await client.memory.listDomains()
    const entry = domains.find(one => one.slug === 'coding')!
    await using session = await client.memory.withSession('coding')
    console.log(briefing(entry, session.instructions))