DocsCore ConceptsSpiral Memory

Spiral Memory

Deep dive into HelixMind's 6-level spiral memory. how context promotes, decays, compresses, and evolves across sessions.

Spiral Memory

HelixMind's spiral memory is a 6-level hierarchical system that stores, evolves, and retrieves context intelligently. the core innovation that makes HelixMind different from every other AI coding tool.

The 6 Levels

LevelNamePurposeToken BudgetColor
L1FocusCurrent working context (files, bugs, features)30%Cyan
L2ActiveRecent patterns, decisions, web enricher findings25%Green
L3ReferenceStable architecture knowledge (schemas, APIs)20%Blue
L4ArchiveHistorical context (old sessions, resolved issues)15%Violet
L5Deep ArchiveCompressed summaries of old context10%Gray
L6Web KnowledgeAuto-fetched docs and web insightsBonusOrange

How Memory Evolves

ProcessDirectionTrigger
PromotionL4 โ†’ L3 โ†’ L2 โ†’ L1Accessed frequently
DecayL1 โ†’ L2 โ†’ L3 โ†’ L4 โ†’ L5Not accessed over time
CompressionAt L5Code โ†’ summaries, details โ†’ key patterns
RelationsBetween nodesAI detects connections automatically
Web EnrichmentExternal โ†’ L6AI detects tech topics โ†’ auto-fetches web docs

Every node gets a 384-dimensional embedding (all-MiniLM-L6-v2, runs locally):

helixmind spiral search "JWT authentication pattern"
CapabilityHow It Works
Semantic searchKNN across all levels. finds concepts, not just keywords
Relevance scoringEmbedding similarity + recency + access count
Smart retrievalRelated nodes are pulled in together

Context Assembly

When you start a chat, context is assembled from all 6 levels:

  1. Semantic relevance: Embedding similarity to your conversation
  2. Level priority: L1 gets 30% of tokens, L2 gets 25%, etc.
  3. Recency: Recently accessed nodes score higher
  4. Relations: Connected nodes are injected together

Storage

LocationScope
.helixmind/spiral.dbProject-local memory
~/.helixmind/spiral.dbCross-project global memory

Each node stores: content, level, embeddings, timestamps, access counts, and metadata.

CLI Commands

helixmind spiral status    # Nodes per level, storage size
helixmind spiral search    # Semantic search across all levels
helixmind spiral compact   # Trigger evolution (compress, rebalance)
Slash CommandAction
/spiralQuick status view
/compactTrigger evolution
/contextShow assembled context
/tokensToken usage per level

Tips

  1. Let it learn naturally: The spiral builds over time, don't front-load everything
  2. Feed early: helixmind feed README.md right after helixmind init
  3. Check periodically: /spiral shows what the AI remembers
  4. Project-local for specifics: Global memory for cross-project patterns
HelixMind โ€” AI Coding CLI with Spiral Memory