Skip to main content

Version 3.2.0 - Jungian Intelligence Layer

Released: March 2026

Overview

Version 3.2.0 introduces the Jungian Intelligence Layer, four psychology-inspired subsystems that transform raw memory data into meaningful, context-aware intelligence. Built on top of the concentric memory rings (v3.1.0) and Collective Best Practices, this release adds temporal pattern detection, archetype-driven pattern delivery, automatic memory consolidation, and per-profile maturity scoring.
The Jungian Intelligence Layer is named after Carl Jung’s analytical psychology. Each subsystem maps to a Jungian concept: Archetypes classify patterns, Synchronicity discovers meaningful coincidences, Dreams consolidate memories, and Individuation measures growth toward self-realization.

Key Features

1. Synchronicity Detection

Discovers temporal co-occurrence patterns across anonymized profiles using pure SQL analysis — no LLM calls required. Three analysis types operate on the temporal_events table:
  • Co-occurrence: Tools that are frequently used together within a 5-minute window
  • Failure Correlation: Tools that tend to fail at specific times (day-of-week and hour-of-day clustering)
  • Emergent Workflows: Three-tool sequential patterns that recur across 3+ profiles
Patterns that pass the k-anonymity threshold (k >= 3 unique profiles) are stored in gut_patterns with pattern_type='synchronicity' and embedded for vector search. Privacy: Only profile_hash (HMAC-SHA256) is stored in temporal events — raw UUIDs never touch the table. Events are retained for 90 days by default.

2. Archetype-Driven Pattern Delivery

Wraps the existing CBP injection engine with Jungian archetype filtering. Each pattern is classified into one of four archetypes:
ArchetypeLabelPattern TypesWhen Dominant
ShadowShadow Warninganti_pattern, security_warning, gotchaError/failure contexts
SageSage Advicebest_practice, error_solution, performance_tip, migration_noteDefault (knowledge sharing)
HeroHero Pathworkflow, tool_sequence, migration_noteWorkflow/tool contexts
TricksterTrickster Insightgotcha, compatibility, error_recovery2+ consecutive failures
Archetype selection is fully deterministic — context fields (outcome, observation type, consecutive failures) are mapped to weights without any LLM call. Patterns are then sorted by archetypeWeight * confidence * similarity and capped at 2 per archetype.

3. Dream Processing (Memory Consolidation)

Discovers clusters of semantically similar memories and consolidates them into single unified memories via LLM, reducing token consumption while preserving all key insights. Three-phase pipeline:
  1. Cluster Discovery (no LLM): Uses vector embeddings and Union-Find to identify connected components of memories with cosine similarity >= 0.75
  2. LLM Consolidation: Each cluster is fed to a compression-tuned LLM that merges redundant content into one coherent memory (max 300 output tokens)
  3. Transactional Storage: New consolidated memory, dream record, and source cluster marking all happen in a single database transaction
Source memories are not deleted — they continue to decay naturally through the existing decay engine. Dream processing is integrated into the decay cron; no separate job is needed.

4. Individuation Scoring

Per-profile maturity scoring with four components (each 0-25, total 0-100), calculated via pure SQL with in-memory caching:
ComponentWhat It MeasuresMax
Memory DepthRing diversity + decay survival + shock recovery25
Learning VelocityWeekly observation rate + classification confidence + reinforcement25
Collective ContributionCBP patterns promoted + pattern diversity + feedback given25
Self-AwarenessMemory search usage + memory engagement + dream consolidation count25
Five maturity levels:
LevelScore RangeDescription
Nascent0-20Just getting started
Developing21-40Building initial patterns
Established41-60Consistent memory usage
Mature61-80Deep, diverse knowledge base
Individuated81-100Full self-realization
Daily snapshots are saved automatically at session start for trend tracking. Weekly trends are calculated as accelerating, stable, or decelerating by comparing recent vs. older snapshot averages.

Ecosystem Updates

New Database Tables

TablePurpose
temporal_eventsAnonymized tool usage events for synchronicity detection
dream_consolidationsRecords of cluster-to-memory consolidations
individuation_snapshotsDaily per-profile individuation score snapshots

New API Endpoints

EndpointMethodDescription
/api/memory/temporal-eventsPOSTBatch write temporal events
/api/memory/temporal-events/cleanupPOSTCleanup events older than retention period
/api/memory/sync/detectPOSTTrigger synchronicity detection
/api/memory/sync/patternsGETRetrieve detected synchronicity patterns
/api/memory/dream/processPOSTTrigger dream processing for current profile
/api/memory/dream/historyGETGet dream consolidation history
/api/memory/archetype/injectPOSTArchetype-enhanced pattern search
/api/memory/individuationGETGet individuation score (with optional ?history=true&days=30)

New SDK Methods

Available in all three official SDKs (JavaScript, Python, Go):
MethodDescription
searchWithContext(query, toolName?, outcome?)Archetype-aware memory search
getIndividuationScore()Get current individuation score and maturity level
getIndividuationHistory(days?)Get score history for trend visualization
getSynchronicityPatterns()Retrieve detected synchronicity patterns
getDreamHistory()Get dream consolidation history

New MCP Tools

ToolDescription
pluggedin_memory_search_with_contextSearch memories with archetype-aware context (tool name, outcome)
pluggedin_memory_individuationGet individuation score with maturity level and improvement tips

Environment Variables

All new settings have sensible defaults and are optional:
# Synchronicity Detector
SYNC_RETENTION_DAYS=90
SYNC_COOCCURRENCE_WINDOW_DAYS=30
SYNC_COOCCURRENCE_GAP_MINUTES=5
SYNC_FAILURE_WINDOW_DAYS=90
SYNC_WORKFLOW_WINDOW_DAYS=30
SYNC_WORKFLOW_GAP_MINUTES=15
SYNC_MIN_EVENTS_THRESHOLD=10
SYNC_CRON_ENABLED=true

# Dream Processing
DREAM_ENABLED=true
DREAM_MIN_CLUSTER_SIZE=3
DREAM_SIMILARITY_THRESHOLD=0.75
DREAM_MAX_CLUSTERS_PER_RUN=10
DREAM_CONSOLIDATION_MAX_INPUT_TOKENS=1500
DREAM_COOLDOWN_DAYS=7

# Archetype Router
ARCHETYPE_ENABLED=true
ARCHETYPE_MAX_PATTERNS_PER_TYPE=2
ARCHETYPE_SHADOW_BOOST=1.2
ARCHETYPE_SAGE_BOOST=1.1

# Individuation Metrics
INDIVIDUATION_ENABLED=true
INDIVIDUATION_CACHE_TTL_MINUTES=60
INDIVIDUATION_HISTORY_DAYS=90

Migration Notes

Upgrade Steps

# Pull latest and install
git pull origin main
pnpm install

# Generate and apply migrations
pnpm db:generate
pnpm db:migrate

# No additional setup required -- all features are enabled by default

Breaking Changes

None. All new features are additive and backward compatible. The existing memory API, MCP tools, and injection engine continue to work unchanged. Archetype routing enriches existing patterns without altering their underlying data.

Security

  • Temporal events store only profile_hash (HMAC-SHA256), never raw UUIDs
  • Synchronicity patterns enforce k-anonymity (k >= 3) before surfacing
  • Advisory locks prevent concurrent synchronicity detection or dream processing runs
  • Dream consolidation prompt includes explicit anti-injection instructions
  • Individuation scores are profile-scoped and cached in-memory (not shared)

What’s Next

  • Jungian Intelligence UI dashboard with archetype visualizations
  • Cross-agent synchronicity detection
  • Dream processing analytics and token savings reports
  • Individuation leaderboards (opt-in, anonymized)

For questions or issues, please visit our GitHub Discussions or contact us at team@plugged.in.