Commit Graph

70 Commits

Author SHA1 Message Date
Mai Development
61db47e8d6 docs(04): create phase plan
Phase 04: Memory & Context Management
- 4 plan(s) in 3 wave(s)
- 2 parallel, 2 sequential
- Ready for execution
2026-01-27 22:04:42 -05:00
Mai Development
9cdb1e7f6c docs(04): create phase plan
Phase 04: Memory & Context Management
- 4 plan(s) in 3 wave(s)
- 2 parallel, 2 sequential
- Ready for execution
2026-01-27 21:53:07 -05:00
Mai Development
c09ea8c8f2 docs(04): research phase 4 memory & context management domain
Phase 04: Memory & Context Management
- Standard stack identified: SQLite + sqlite-vec + sentence-transformers
- Architecture patterns documented: hybrid storage, progressive compression, vector search
- Pitfalls cataloged: embedding drift, memory bloat, personality overfitting
- Code examples provided from official sources
2026-01-27 20:12:40 -05:00
Mai Development
3e88d33bd3 docs(04): capture phase context
Phase 04: memory-context-management
- Implementation decisions documented
- Hybrid storage strategy with SQLite + JSON archives
- Progressive compression and smart retention policies
- Multi-dimensional pattern learning approach
- Phase boundary established
2026-01-27 19:59:52 -05:00
Mai Development
27fa6b654f docs(03): complete resource management phase
Phase 03: resource-management
- Enhanced GPU detection with pynvml support
- Hardware tier detection and management system
- Proactive scaling with hybrid monitoring
- Personality-driven resource communication
- All phase goals verified
2026-01-27 19:17:14 -05:00
Mai Development
9b4ce96ff5 removed discord sync due to errors 2026-01-27 19:11:38 -05:00
Mai Development
5dda3d2f55 fix(02): orchestrator corrections
Some checks are pending
Discord Webhook / git (push) Waiting to run
Add missing Phase 2 Plan 2 SUMMARY and Discord integration artifacts
2026-01-27 19:10:31 -05:00
Mai Development
087974fa88 docs(03-04): complete personality-driven resource communication plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 2/2
- Implemented ResourcePersonality with dere-tsun gremlin persona
- Integrated personality-aware model switching with degradation notifications

SUMMARY: .planning/phases/03-resource-management/03-04-SUMMARY.md
2026-01-27 19:07:41 -05:00
Mai Development
1c9764526f feat(03-04): integrate personality with model management
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added ResourcePersonality import and initialization to ModelManager
- Created personality_aware_model_switch() method for graceful degradation notifications
- Only notifies users about capability downgrades, not upgrades (per requirements)
- Includes optional technical tips for resource optimization
- Updated proactive scaling callbacks to use personality-aware switching
- Enhanced failure handling with personality-driven resource requests
- Added _is_capability_downgrade() helper for capability comparison
2026-01-27 19:04:19 -05:00
Mai Development
dd3a75f0f0 feat(03-04): implement ResourcePersonality with dere-tsun gremlin persona
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Created ResourcePersonality class with Drowsy Dere-Tsun Onee-san Hex-Mentor Gremlin personality
- Includes mood system with sleepy, grumpy, helpful, gremlin, and mentor states
- Personality-specific vocabularies for different emotional responses
- Optional technical tips with hexadecimal/coding references
- generate_resource_message() for contextual resource communications
- Support for resource requests, degradation notices, system status, and scaling recommendations
2026-01-27 18:57:13 -05:00
Mai Development
54f0decb40 docs(03-03): complete proactive scaling plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 2/2
- Implemented ProactiveScaler class with hybrid monitoring
- Integrated proactive scaling into ModelManager

Proactive scaling system with hybrid monitoring, graceful degradation cascades, and intelligent stabilization periods.

SUMMARY: .planning/phases/03-resource-management/03-03-SUMMARY.md
2026-01-27 18:50:18 -05:00
Mai Development
53b8ef7c1b feat(03-03): integrate proactive scaling into ModelManager
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added ProactiveScaler integration with HardwareTierDetector
- Implemented pre-flight resource checks before model inference
- Enhanced model selection with scaling recommendations
- Added graceful degradation handling for resource constraints
- Integrated performance metrics tracking for scaling decisions
- Added proactive upgrade execution with stabilization periods
- Enhanced status reporting with scaling information
- Maintained silent switching behavior per Phase 1 decisions
2026-01-27 18:47:10 -05:00
Mai Development
4d7749da7b feat(03-03): implement ProactiveScaler class with hybrid monitoring
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Created ProactiveScaler class for proactive resource management
- Implemented continuous background monitoring with configurable intervals
- Added pre-flight resource checks before operations
- Implemented graceful degradation cascades with stabilization periods
- Added trend analysis for predictive scaling decisions
- Included hysteresis to prevent model switching thrashing
- Provided callbacks for integration with ModelManager
- Thread-safe implementation with proper shutdown handling
2026-01-27 18:40:58 -05:00
Mai Development
4c3cab9dd9 docs(03-02): complete hardware tier detection plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 3/3
- Resource module structure with proper exports
- Configurable hardware tier definitions in YAML
- HardwareTierDetector class with classification logic

SUMMARY: .planning/phases/03-resource-management/03-02-SUMMARY.md
2026-01-27 18:35:41 -05:00
Mai Development
8857ced92a feat(03-02): implement HardwareTierDetector class
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Created comprehensive hardware tier detection system
- Loads configurable tier definitions from YAML
- Classifies systems based on RAM, CPU cores, and GPU capabilities
- Provides model recommendations and performance characteristics
- Includes caching for performance and error handling
- Integrates with ResourceMonitor for real-time data
2026-01-27 18:32:07 -05:00
Mai Development
0b4c270632 feat(03-02): create configurable hardware tier definitions
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added comprehensive tier definitions for low_end, mid_range, high_end
- Configurable thresholds for RAM, CPU cores, GPU requirements
- Model size recommendations per tier (1B-70B parameter range)
- Performance characteristics and scaling thresholds
- Global settings for model selection and scaling behavior
2026-01-27 18:30:42 -05:00
Mai Development
5d93e9715f feat(03-02): create resource module structure
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Created src/resource/__init__.py with module docstring
- Exported HardwareTierDetector (to be implemented)
- Established resource management module foundation
2026-01-27 18:29:38 -05:00
Mai Development
a1db08c72c docs(03-01): complete enhanced GPU detection plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 2/2
- Added pynvml>=11.0.0 dependency for NVIDIA GPU monitoring
- Enhanced ResourceMonitor with pynvml GPU detection and graceful fallbacks
- Optimized performance with caching and failure tracking (~50ms per call)

SUMMARY: .planning/phases/03-resource-management/03-01-SUMMARY.md
2026-01-27 18:25:01 -05:00
Mai Development
0ad2b393a5 perf(03-01): optimize ResourceMonitor performance
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added caching for GPU info to avoid repeated pynvml initialization
- Added pynvml failure tracking to skip repeated failed attempts
- Optimized CPU measurement interval from 1.0s to 0.05s
- Reduced monitoring overhead from ~1000ms to ~50ms per call
- Maintained accuracy while significantly improving performance
2026-01-27 18:21:01 -05:00
Mai Development
8cf9e9ab04 feat(03-01): enhance ResourceMonitor with pynvml GPU detection
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added pynvml import with graceful fallback handling
- Enhanced _get_gpu_info() method using pynvml for NVIDIA GPUs
- Added detailed GPU metrics: total/used/free VRAM, utilization, temperature
- Updated get_current_resources() to include comprehensive GPU info
- Maintained backward compatibility with existing gpu_vram_gb field
- Added gpu-tracker fallback for AMD/Intel GPUs
- Proper error handling for pynvml initialization failures
- Ensured pynvmlShutdown() always called in finally-style logic
2026-01-27 18:17:12 -05:00
Mai Development
e2023754eb feat(03-01): add pynvml dependency for GPU monitoring
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Added pynvml>=11.0.0 to main dependencies
- Enables NVIDIA GPU VRAM monitoring capabilities
- Required for enhanced resource detection in Phase 3
2026-01-27 18:14:23 -05:00
Mai Development
1e071398ff docs(03): create phase plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 3: Resource Management
- 4 plan(s) in 2 wave(s)
- 2 parallel, 2 sequential
- Ready for execution
2026-01-27 17:58:09 -05:00
Mai Development
a37b61acce docs(03): research phase domain
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 03: Resource Management
- Standard stack identified: psutil, pynvml, gpu-tracker
- Architecture patterns documented: hybrid monitoring, tier-based management, graceful degradation
- Pitfalls catalogued: GPU detection, aggressive switching, memory leaks, over-technical communication
- Don't-hand-roll items listed for custom implementations
- Code examples provided with official source references
2026-01-27 17:52:47 -05:00
Mai Development
2d24f8f93f docs(03): capture phase context
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 03: resource-management
- Implementation decisions documented
- Resource threshold strategy with dynamic adjustment
- Efficiency-first model selection behavior
- Bottleneck detection with hybrid approach
- Personality-driven user communication
- Drowsy Dere-Tsun Onee-san Hex-Mentor Gremlin persona
2026-01-27 17:46:33 -05:00
Mai Development
f815f4fecf docs(02): complete phase execution
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- 4 plans executed across 3 waves
- Security assessment, sandbox execution, audit logging, integration
- Verification passed - all must-haves verified
- Ready for Phase 3: Resource Management
2026-01-27 16:12:18 -05:00
Mai Development
1413433d89 docs(02-04): Add execution summary
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 16:06:39 -05:00
Mai Development
543fe75150 feat(02-04): Create integration tests for safety system
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 16:05:46 -05:00
Mai Development
26a77e612d feat(02-04): Implement safety API interface
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:56:50 -05:00
Mai Development
73155af6be feat(02-04): Create safety coordinator
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:55:07 -05:00
Mai Development
df5ca04c5a docs(02-03): Create comprehensive execution summary for tamper-proof audit logging implementation
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:48:49 -05:00
Mai Development
387c39d90f feat(02-03): Configure comprehensive audit policies with retention and hash chain settings
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:47:47 -05:00
Mai Development
241b9d2dbb feat(02-03): Implement audit logging interface with comprehensive security event methods
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:44:28 -05:00
Mai Development
7ab8e7a983 feat(02-03): Create tamper-proof audit logger with SHA-256 hash chains
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:42:03 -05:00
Mai Development
8b4e31bd47 feat(02-02): Configure sandbox policies
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:37:22 -05:00
Mai Development
9b79107fb3 feat(02-02): Implement sandbox execution interface
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:36:58 -05:00
Mai Development
c254e1df30 feat(02-02): Create Docker sandbox manager
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:36:47 -05:00
Mai Development
c14ab4319e docs(02-01): add execution summary
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:33:12 -05:00
Mai Development
e407c32c82 feat(02-01): add security dependencies and configuration
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:31:19 -05:00
Mai Development
93c26aaf6b feat(02-01): create security assessment module
Some checks failed
Discord Webhook / git (push) Has been cancelled
2026-01-27 15:29:56 -05:00
Mai Development
f7d263e173 docs(02): create phase plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- 4 plans in 3 waves
- Security assessment, sandbox execution, audit logging, integration
- Wave 1 parallel: assessment (02-01) + sandbox (02-02)
- Wave 2: audit logging (02-03)
- Wave 3: integration (02-04)
- Ready for execution
2026-01-27 14:28:35 -05:00
Mai Development
298d57c037 docs(02): research phase domain
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- Standard stack identified (Docker, Bandit, Semgrep)
- Architecture patterns documented (sandbox isolation, security assessment)
- Pitfalls catalogued (container isolation, resource limits)
- Ready for planner to create execution plans
2026-01-27 14:05:49 -05:00
Mai Development
351a1a76d7 docs(02): capture phase context
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 02: Safety & Sandboxing
- Security assessment levels defined
- Audit logging scope established
- Sandbox technology decisions made
- Resource limits policy set
2026-01-27 13:57:06 -05:00
Mai Development
629abbfb0b docs(01): complete model interface phase
Some checks failed
Discord Webhook / git (push) Has been cancelled
Phase 01: Model Interface & Switching
  - All 3 plans executed and verified
  - LM Studio connectivity, resource monitoring, and intelligent switching implemented
2026-01-27 12:55:04 -05:00
Mai Development
b1a3b5e970 docs(01-03): complete intelligent model switching integration
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 3/3
- ModelManager with intelligent selection and switching
- Core Mai orchestration class
- CLI interface for testing and monitoring

SUMMARY: .planning/phases/01-model-interface/01-03-SUMMARY.md

Phase 1 complete - model interface foundation ready for Phase 2: Safety & Sandboxing
2026-01-27 12:38:43 -05:00
Mai Development
5297df81fb feat(01-03): create CLI entry point for testing
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Implement __main__.py with argparse command-line interface
- Add interactive chat loop for testing model switching
- Include status commands to show current model and resources
- Support models listing and manual model switching
- Add proper signal handling for graceful shutdown
- Include help text and usage examples
- Fix import issues for relative imports in package
2026-01-27 12:33:50 -05:00
Mai Development
24ae542a25 feat(01-03): create core Mai orchestration class
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Initialize ModelManager, ContextManager, and subsystems
- Provide main conversation interface with process_message
- Support both synchronous and async operations
- Add system status monitoring and conversation history
- Include graceful shutdown with signal handlers
- Background resource monitoring and maintenance tasks
- Model switching commands and information methods
2026-01-27 12:26:02 -05:00
Mai Development
0b7b527d33 feat(01-03): implement ModelManager with intelligent switching
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Load model configuration from config/models.yaml
- Intelligent model selection based on system resources and context
- Dynamic model switching with silent behavior (no user notifications)
- Fallback chains for model failures
- Proper resource cleanup and error handling
- Background preloading capability
- Auto-retry on model failures with graceful degradation
2026-01-27 12:23:52 -05:00
Mai Development
2e04873b1a docs(01-02): complete conversation context management plan
Some checks failed
Discord Webhook / git (push) Has been cancelled
Tasks completed: 2/2
- Created conversation data structures with Pydantic validation
- Implemented intelligent context manager with hybrid compression

SUMMARY: .planning/phases/01-model-interface/01-02-SUMMARY.md
STATE: Updated to reflect Plan 2 completion
ROADMAP: Updated Plan 2 as complete
2026-01-27 12:15:57 -05:00
Mai Development
7bbf5e17f1 fix(01-02): correct ConversationMetadata import and initialization
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Add ConversationMetadata to imports
- Fix metadata initialization in create_conversation()
- Resolve type error for conversation metadata

File: src/models/context_manager.py
2026-01-27 12:12:36 -05:00
Mai Development
ef2eba2a3f feat(01-02): implement context manager with intelligent compression
Some checks failed
Discord Webhook / git (push) Has been cancelled
- Create ContextManager class for conversation history management
- Implement hybrid compression strategy at 70% threshold
- Add message importance scoring for selective retention
- Support system message preservation during compression
- Include conversation statistics and session management
- Provide context retrieval with token limit enforcement

Key methods:
- add_message(): Add messages and trigger compression when needed
- get_context_for_model(): Retrieve context within token limits
- compress_conversation(): Apply hybrid compression preserving important messages
- get_conversation_summary(): Generate conversation summaries

File: src/models/context_manager.py (320 lines)
2026-01-27 12:09:23 -05:00