feat: implement L1-L7 context tree for multi-layered memory management #16
Reference in New Issue
Block a user
Delete Branch "feature/issue-15-context-tree"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements Pillar 2 (Multi-layered Context Management) with a 7-tier hierarchical memory system from real-time market data to generational trading wisdom.
Summary
This PR adds a complete context tree implementation with 7 layers (L1-L7), automatic bottom-up aggregation, and retention policies for sustainable long-term memory.
New Modules
src/context/layer.py: ContextLayer enum and metadata configsrc/context/store.py: ContextStore for CRUD operations (98% coverage)src/context/aggregator.py: Bottom-up aggregation logic (100% coverage)Database Changes
contextstable for hierarchical data storagecontext_metadatatable for layer configurationContext Layers
Tests
tests/test_context.pyDocumentation
docs/context-tree.mdCLAUDE.mdarchitecture sectionTest Plan
Closes #15