Archetype System
The Archetype System wraps the existing Collective Best Practices (CBP) injection engine with Jungian archetype filtering. Every pattern injected into your session is classified into one of four archetypes and scored based on your current context, ensuring the most relevant patterns rise to the top.Archetype classification is fully deterministic — no LLM calls are made. Context fields (outcome, observation type, consecutive failures) are mapped directly to archetype weights using a fixed algorithm.
The Four Archetypes
- Shadow
- Sage
- Hero
- Trickster
Label: Shadow WarningThe Shadow represents the hidden or unconscious negative side — things that can go wrong if you are not careful.Pattern Types:
anti_pattern— Common mistakes to avoidsecurity_warning— Security vulnerabilities and risksgotcha— Surprising behaviors that catch developers off-guard
git push --force to main without checking CI status first — caused production data loss for 3 teams.”How Weight Calculation Works
Archetype weights are determined by a fixed algorithm that examines context fields. No machine learning or LLM is involved.Weight Selection Rules
All weights are shown after normalization (each row sums to 1.0):In error/failure contexts, Shadow receives a 1.2x boost and Sage receives a 1.1x boost before normalization. The pre-normalization values are Shadow=0.48, Sage=0.44, Hero=0.10, Trickster=0.10 (sum=1.12), which normalize to the values shown above.
Scoring Formula
Each pattern receives a composite score:- archetypeWeight: From the context-based weight table above (0.0-1.0)
- confidence: The pattern’s CBP confidence score (0.0-1.0)
- similarity: Vector similarity between the query and the pattern (0.0-1.0)
Input Context
The archetype router accepts these optional context fields:API Reference
Archetype-Enhanced Pattern Search
SDK Usage
MCP Tool
Thepluggedin_memory_search_with_context MCP tool provides the same archetype-aware search:
Backward Compatibility
The archetype system is fully backward compatible:- Existing injection API: Unchanged. If
ARCHETYPE_ENABLED=false, the standard injection engine is used and all patterns are labeled assageby default. - Existing patterns: All previously stored patterns continue to work. They are classified into archetypes at query time based on their
patternTypefield. - Existing MCP tools:
pluggedin_cbp_queryandpluggedin_cbp_feedbackare unaffected.
Configuration
Next Steps
Synchronicity Detection
How patterns are discovered from temporal events
Dream Processing
How related memories are consolidated

