Perception
Define how an agent sees — attention filters and contextual focus.
Perception defines how an agent perceives and filters information. It controls what the agent pays attention to and how much detail it processes.
Structure
type Model struct {
AttentionFilters []AttentionFilter
ContextWindow float64 // 0.0 = minimal context, 1.0 = full context
DetailOrientation float64 // 0.0 = high-level, 1.0 = fine-grained
}Attention filters
Attention filters direct the agent's focus to specific aspects of input:
type AttentionFilter struct {
Name string // filter name
Keywords []string // keywords to watch for
Patterns []string // regex patterns to match
Prompt string // prompt fragment when filter activates
}Example: security-focused perception
perception.Model{
AttentionFilters: []perception.AttentionFilter{
{
Name: "security",
Keywords: []string{"password", "token", "auth", "injection", "XSS"},
Prompt: "Pay special attention to security implications in this context.",
},
{
Name: "performance",
Keywords: []string{"latency", "throughput", "memory", "CPU", "bottleneck"},
Prompt: "Note any performance concerns.",
},
},
ContextWindow: 0.8,
DetailOrientation: 0.9,
}Fields
| Field | Type | Range | Description |
|---|---|---|---|
AttentionFilters | []AttentionFilter | — | Keyword and pattern-based focus directives |
ContextWindow | float64 | 0.0–1.0 | How much surrounding context to consider |
DetailOrientation | float64 | 0.0–1.0 | High-level overview vs fine-grained analysis |
Embedding in a persona
Perception is a value object embedded directly in the persona:
persona := &persona.Persona{
Perception: perception.Model{
ContextWindow: 0.8,
DetailOrientation: 0.7,
},
}