Cortex
1.x
Docs/Cortex/Perception
Open

Reading2 min
Updated31 Jul 2026
Sourcev1/human-model/perception.mdx

Perception defines how an agent perceives and filters information. It controls what the agent pays attention to and how much detail it processes.

Structure01

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 filters02

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,
}

Fields03

FieldTypeRangeDescription
AttentionFilters[]AttentionFilterKeyword and pattern-based focus directives
ContextWindowfloat640.0–1.0How much surrounding context to consider
DetailOrientationfloat640.0–1.0High-level overview vs fine-grained analysis

Embedding in a persona04

Perception is a value object embedded directly in the persona:

persona := &persona.Persona{
    Perception: perception.Model{
        ContextWindow:     0.8,
        DetailOrientation: 0.7,
    },
}