Cognitive Profiles: Tuning AI Memory and Personality
In humans, personality and cognitive style are heavily influenced by how our brains prioritize, retain, and recall memories. A creative thinker might have high associative activation (making sudden, distant connections), while a clinical researcher needs precise, structured retrieval.
With Spector, we introduced the concept of Cognitive Profiles. By adjusting mathematical parameters in the memory scoring and decay equations, developers can shape how an AI agent thinks, learns, and behaves.
The Cognitive Parameters
Spector's memory engine exposes several parameters that govern memory dynamics:
| Parameter | Range | Description |
|---|---|---|
decayRate (\(\lambda\)) |
0.0 - 1.0 |
Controls Ebbinghaus forgetting speed (higher = faster forgetting) |
hebbianThreshold |
0.0 - 1.0 |
Co-activation strength required to form an association link |
valenceBias |
-1.0 - 1.0 |
recall bias toward positive or negative emotional memories |
permastoreFloor |
0.0 - 1.0 |
The minimum memory score below which a memory cannot decay |
arousalSensitivity |
0.0 - 2.0 |
Multiplier for emotional intensity during flashbulb creation |
Out-of-the-Box Cognitive Profiles
Spector ships with four pre-configured profiles designed for common agent behaviors:
1. 🔍 Debugging & Diagnostic Mode
Focus: Root causes, edge cases, error logs
When an agent enters this mode, it assumes a hyper-vigilant cognitive state. It prioritizes negative experiences (valences associated with failures) and keeps recent details highly vivid.
- Valence Bias:
-0.6(strongly negative) - Decay Rate:
0.08(slow decay) - Hebbian Threshold:
0.15(sensitive associations) - Use Case: Post-mortem analysis, code debugging, and exception tracing.
// Initialize Spector with Debugging Profile
SpectorMemory memory = DefaultSpectorMemory.builder()
.cognitiveProfile(CognitiveProfile.DEBUGGER)
.build();
2. 💡 Brainstorming & Creative Mode
Focus: Divergent thinking, cross-domain associations
In this mode, the agent lowers its association thresholds and uses wide spreading activation. This allows the memory search to jump across domains, surfacing connections that are conceptually distant but associatively linked.
- Valence Bias:
0.3(slightly positive) - Decay Rate:
0.25(normal decay) - Hebbian Threshold:
0.4(only strong ties) - Use Case: Idea generation, system design, architectural mapping, and writing.
3. 🏥 Clinical & Patient Care Mode
Focus: Strict fact retention, high empathy, permastore protection
Designed specifically for healthcare and neurodivergence applications, this profile prevents decay of patient preferences, therapist goals, and progress tracking, while prioritizing empathetic responses.
- Valence Bias:
0.1(neutral-positive) - Decay Rate:
0.03(extremely slow decay) - Permastore Floor:
0.5(high retention floor) - Use Case: Speech therapy support, Applied Behavior Analysis (ABA) logging, and clinical note taking.
How to Configure a Custom Profile
If the default profiles don't fit your needs, you can define a custom profile in Java in seconds:
CognitiveProfile customProfile = CognitiveProfile.builder()
.decayRate(0.12f)
.hebbianThreshold(0.25f)
.valenceBias(0.0f) // Completely neutral
.permastoreFloor(0.2f)
.arousalSensitivity(1.5f) // High sensitivity to emotional events
.build();
SpectorMemory memory = DefaultSpectorMemory.builder()
.cognitiveProfile(customProfile)
.build();
By leveraging Cognitive Profiles, you ensure your AI agents aren't just retrieval tools—they are cognitive entities tailored to their specific roles.