mom: add working memory system and improve log querying

- Add MEMORY.md files for persistent working memory
  - Global memory: workspace/MEMORY.md (shared across channels)
  - Channel memory: workspace/<channel>/MEMORY.md (channel-specific)
  - Automatically loaded into system prompt on each request

- Enhance JSONL log format with ISO 8601 dates
  - Add 'date' field for easy grepping (e.g., grep '"date":"2025-11-26"')
  - Migrated existing logs to include date field

- Improve log query efficiency
  - Add jq query patterns to prevent context overflow
  - Emphasize limiting NUMBER of messages (10-50), not truncating text
  - Show full message text and attachments in queries
  - Handle null/empty attachments with (.attachments // [])

- Optimize system prompt
  - Add current date/time for date-aware operations
  - Format recent messages as TSV (43% token savings vs raw JSONL)
  - Add efficient query examples with both JSON and TSV output

- Enhanced security documentation
  - Add prompt injection risk warnings
  - Document credential exfiltration scenarios
  - Provide mitigation strategies
This commit is contained in:
Mario Zechner 2025-11-26 13:21:43 +01:00
parent a484330cd1
commit 4e01eca40e
5 changed files with 309 additions and 18 deletions

View file

@ -1,5 +1,36 @@
# Changelog
## [Unreleased]
### Added
- Working memory system with MEMORY.md files
- Global workspace memory (`workspace/MEMORY.md`) shared across all channels
- Channel-specific memory (`workspace/<channel>/MEMORY.md`) for per-channel context
- Automatic memory loading into system prompt on each request
- Mom can update memory files to remember project details, preferences, and context
- ISO 8601 date field in log.jsonl for easy date-based grepping
- Format: `"date":"2025-11-26T10:44:00.123Z"`
- Enables queries like: `grep '"date":"2025-11-26' log.jsonl`
### Changed
- Enhanced system prompt with clearer directory structure and path examples
- Improved memory file path documentation to prevent confusion
- Message history format now includes ISO 8601 date for better searchability
- System prompt now includes log.jsonl format documentation with grep examples
- System prompt now includes current date and time for date-aware operations
- Added efficient log query patterns using jq to prevent context overflow
- System prompt emphasizes limiting NUMBER of messages (10-50), not truncating message text
- Log queries now show full message text and attachments for better context
- Fixed jq patterns to handle null/empty attachments with `(.attachments // [])`
- Recent messages in system prompt now formatted as TSV (43% token savings vs raw JSONL)
- Enhanced security documentation with prompt injection risk warnings and mitigations
### Fixed
- jq query patterns now properly handle messages without attachments (no more errors on empty arrays)
## [0.9.4] - 2025-11-26
### Added