Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSystemPromptFromDB ¶
func BuildSystemPromptFromDB(ctx context.Context, p DBPromptParams) string
BuildSystemPromptFromDB composes the full system prompt by populating a promptData struct and executing the system template.
Layers:
- System prompt — the agent's base system prompt from DB
- Tools — always-available tool descriptions (in the template)
- Agent soul — per-user identity/personality from memory ProfileStore
- User profile — per-user facts/context from memory ProfileStore
- Extension prompt sections — stable prompt content owned by plugins
- Project context — AGENTS.md files from cwd ancestors
func DefaultAgentSoul ¶
func DefaultAgentSoul() string
DefaultAgentSoul returns the first soul tagged "default" from the builtin registry, used as the fallback persona when an agent has no override in memory.
func DefaultSystemPrompt ¶
func DefaultSystemPrompt() string
DefaultSystemPrompt returns the default system prompt text.
Types ¶
type DBPromptParams ¶
type DBPromptParams struct {
SystemPrompt string // agent's base system prompt from DB
AgentSoul string // agent's default soul from DB (fallback for all users)
Memory memory.Provider // active provider for profile loading (may be nil)
KnowledgeStore pkgplugins.KnowledgeStore // optional; injects ## Knowledge section when set
UserID string // auth user ID for profile lookup
AgentID string // agent ID for profile lookup
GroupID string // group ID for group memory lookup (D4); mutually exclusive with UserID
GroupMemory string // pre-loaded group memory content; injected when non-empty
StellaHome string
AgentRoot string
ProjectRoot string // optional project root for local/project-attached runs
UserRoot string // per-user writable root
Sections []pkgplugins.SystemPromptSection
Host sandbox.Host
SnapshotVersion int64 // frozen memory version for this session; 0 means current
SnapshotUpdatedAt time.Time // wall-clock time of the last snapshot advance; used to filter knowledge
// CurrentSpeaker is retained for compatibility with callers/tests that still
// populate it, but it is intentionally not rendered into the system prompt.
// Runtime injects speaker metadata as per-turn message context so reused group
// runners keep a stable system prefix for prompt caching.
CurrentSpeaker memory.CurrentSpeaker
HasCurrentSpeaker bool
}
DBPromptParams holds the parameters for building a system prompt from DB-backed config.
type SectionsBuilder ¶
type SectionsBuilder func(ctx context.Context, build pkgplugins.SystemPromptContext) ([]pkgplugins.SystemPromptSection, error)
Click to show internal directories.
Click to hide internal directories.