跳到主要内容

Prompt Assembly

Prompt assembly 是 runtime 工作。它把 product identity、role、memory、skills、references、surface context 和 recent messages 转换成 loop-ready agent.AgentMessage values。

System Prompt Fragments

Stable system fragments 定义 Anyy identity、runtime rules、capability projection、skill index 和 durable profile hints。

尽量保持 stable fragments deterministic,以便 provider cache policy 可以复用。

Role Prompt

默认 profile identity 位于 $ANYY_HOME/SOUL.md。Named role identity 位于 roles/<role_id>/SOUL.md

Role text 影响 persona 和 working style。它不会授予 tools、secrets、provider credentials、channel access 或 memory ownership。

记忆注入

Memory context 来自 profile memory files 和 memory indexes。MEMORY.md 存储 durable assistant memory; USER.md 存储 profile-level 的 person/operator facts。

Memory 是 context。Model-visible memory edits 仍要通过 memory tools 和 runtime policy。

上下文文件

Workspace files、artifacts、URLs、folders、git references 和 result references 由 internal/references 展开,并由 context assembly 渲染。

Expanded references 是 untrusted data。不要把它们放入 product identity 或 stable policy text。

工具指令

Tool descriptors 定义 callable behavior。Prompt assembly 可以总结 visible toolsets 和 active skills, 但 tool authorization 后续由 tool governance 和 runtime hooks 强制执行。

不要把 prompt wording 当作 state-changing operations 的唯一防护。

Provider Prompt Adapter

Provider prompt adaptation 发生在 provider-call copies 上。Native-provider guidance、cache hints、 reasoning replay policy 和 unsupported-field cleanup 不能 mutate persisted messages。