orka.memory.presets module
Memory Presets System - Minsky-Inspired Cognitive Architecture
This module implements a simplified memory configuration system based on Marvin Minsky’s cognitive theories from “The Society of Mind” and related work. It provides 6 preset memory types that cover the spectrum of cognitive memory needs.
Minsky-Inspired Memory Hierarchy
The 6 memory types are inspired by Minsky’s cognitive architecture concepts:
Sensory Memory - Immediate, high-throughput processing
Working Memory - Active processing and temporary storage
Episodic Memory - Experience and interaction history
Semantic Memory - Knowledge and learned facts
Procedural Memory - Skills, patterns, and processes
Meta Memory - System knowledge and self-reflection
Each preset includes: - Optimized decay rules for the memory type - Appropriate importance scoring - Vector search configuration - TTL and cleanup settings - Namespace organization
Usage Examples
Simple YAML Configuration:
id: smart-assistant memory_preset: “episodic” # Just specify the preset! agents: […]
Advanced Configuration with Override:
id: smart-assistant memory_preset: “semantic” memory_config:
# Preset provides base config, override specific values default_long_term_hours: 720 # Override: extend to 30 days
agents: […]
Agent-Specific Memory Types:
id: knowledge_agent type: memory memory_preset: “semantic” # For storing facts config:
operation: write
namespace: knowledge_base
id: interaction_logger type: memory memory_preset: “episodic” # For conversation history config:
operation: write
namespace: conversations
Performance Benefits
Simplified Configuration: 90% reduction in memory config complexity
Cognitive Alignment: Memory types match human cognitive patterns
Optimized Performance: Each preset is tuned for its use case
Backward Compatible: Existing configurations continue to work
- orka.memory.presets.get_memory_preset(preset_name: str, operation: str | None = None) Dict[str, Any] [source]
Get a memory preset configuration by name, with optional operation-specific defaults.
- Parameters:
preset_name – Name of the preset (sensory, working, episodic, semantic, procedural, meta)
operation – Memory operation type (‘read’ or ‘write’) for operation-specific defaults
- Returns:
Dictionary containing the preset configuration, merged with operation-specific defaults
- Raises:
ValueError – If preset_name is not found
- orka.memory.presets.list_memory_presets() Dict[str, str] [source]
List all available memory presets with their descriptions.
- Returns:
Dictionary mapping preset names to descriptions
- orka.memory.presets.merge_preset_with_config(preset_name: str, custom_config: Dict[str, Any] | None = None, operation: str | None = None) Dict[str, Any] [source]
Merge a memory preset with custom configuration overrides, including operation-specific defaults.
- Parameters:
preset_name – Name of the preset to use as base
custom_config – Custom configuration to override preset values
operation – Memory operation type (‘read’ or ‘write’) for operation-specific defaults
- Returns:
Merged configuration dictionary with operation-specific defaults applied
- orka.memory.presets.get_operation_defaults(preset_name: str, operation: str) Dict[str, Any] [source]
Get operation-specific defaults for a memory preset.
- Parameters:
preset_name – Name of the preset
operation – Memory operation type (‘read’ or ‘write’)
- Returns:
Dictionary containing operation-specific defaults
- Raises:
ValueError – If preset_name is not found or operation is invalid