Skip to content

Tags: taylorsatula/mira-OSS

Tags

2025.12.30-feat

Toggle 2025.12.30-feat's commit message
refactor: sync with upstream - simplify LLM routing, standardize memo…

…ry IDs

WHY THIS CHANGE:
Consolidating multiple upstream commits into OSS repository. Primary themes:
simplification of LLM provider architecture and standardization of memory
identifier formats across the codebase.

CHANGES:

LLM Provider Simplification:
- Removed execution model switching (caused cross-provider compatibility bugs
  when OpenRouter returned reasoning_details that other providers rejected)
- Single model throughout tool loop eliminates provider field mismatches
- Circuit breaker now allows one retry per tool before failing
- Tool validation errors include schema in response to aid model self-correction

Memory ID Standardization:
- Unified format: mem_XXXXXXXX prefix (was inconsistent 8-char hex vs full UUID)
- Centralized utilities in tag_parser.py: format_memory_id, parse_memory_id,
  match_memory_id - removed 5 duplicate _shorten_id implementations
- Changed memory ref tag from inline to block format for cleaner parsing
- Updated all prompts and regex patterns to use new format

Context Window Structure:
- Renamed notification center to HUD
- Moved delimiter from fake user message to assistant message (was triggering
  prompt injection detection)
- Added ephemeral timestamps to messages for LLM temporal awareness
- Domaindocs now cached (stable reference material)

Reminder Tool:
- Added snooze_reminder operation (1-hour postpone)
- Added batch operation for bulk complete/delete
- Improved schema documentation with explicit per-operation parameters

Session Management:
- Postpone extensions now stack (adds to existing future time)
- Virtual time cleared on real user messages via increment_segment_turn

Error Handling:
- Model tool failures surface user-friendly message instead of blank response

Migration System:
- Added rollback_from_backup for emergency recovery
- Fixed silent PostgreSQL errors (now respects LOUD_MODE)
- Fixed backup function ordering (vault secrets before postgres backup)

Housekeeping:
- Removed internal architecture docs (not appropriate for OSS)
- Updated default log level to WARNING
- Updated tier descriptions in CLI tool

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

2025.12.24

Toggle 2025.12.24's commit message
feat: sync with upstream - generic provider architecture and database…

…-backed config

WHY THIS CHANGE:
Synchronizing mira-OSS with botwithmemory upstream changes from Dec 17-24, 2025.
This release brings parity to the generic LLM provider architecture and includes
numerous bugfixes and performance improvements.

PROBLEM SOLVED:
OSS variant was out of sync with upstream improvements including:
- No streaming support for generic OpenAI-compatible providers
- LLM configuration hardcoded in config.py instead of database
- Missing circuit breaker and parallel execution in generic provider
- Schema fragmented across 13 migration files

ROOT CAUSE:
Normal development velocity on upstream botwithmemory created divergence.
The makeoss.sh script extracted changes but they needed to be committed
as a coherent release with proper documentation.

SOLUTION RATIONALE:
Consolidated all upstream backend changes into single release commit.
Frontend-only commits (8 total) excluded as they don't apply to mira-OSS.
Migration files consolidated into unified mira_service_schema.sql for simpler
deployment - OSS users can deploy fresh rather than run sequential migrations.

CHANGES:
## Generic LLM Provider Architecture
- Add real-time SSE streaming for OpenAI-compatible providers
- Add circuit breaker pattern preventing infinite tool loops
- Add parallel tool execution via ThreadPoolExecutor (4.58s -> 3.36s)
- Add execution model routing for simple tools
- Add unified firehose tap with MIRA_FIREHOSE=1 env var
- Fix reasoning_details preservation for OpenRouter reasoning models

## Database-Backed LLM Configuration
- Migrate internal LLM configs from config.py to internal_llm table
- Add InternalLLMConfig dataclass with startup cache loading
- Refactor FingerprintGenerator, MemoryEvacuator, SummaryGenerator
- Refactor PromptInjectionDefense with graceful degradation
- Update WebTool and GetContextTool with self-contained config

## Schema and Tier System
- Consolidate 13 migrations into unified mira_service_schema.sql
- Add internal_llm table (execution, analysis, summary, injection_defense)
- Add tier visibility controls (show_locked, locked_message)
- Switch balanced tier from Groq to OpenRouter/Gemini 3 Flash
- Add last_donated_at column for donation banner cooldown
- Remove dead overarching_knowledge column

## Bugfixes
- Fix missing config import in orchestrator.py
- Add root endpoint (GET /) with service status guidance

## Infrastructure
- Remove vault token renewal methods
- Update deploy.sh for new schema structure
- Add comprehensive streaming and provider test suites

IMPACT:
- PERFORMANCE: Parallel tool execution reduces latency by ~27%
- BREAKING: Config fields removed from config.py (moved to database)
- TESTING: New test suites for streaming and LLM provider

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>

1.0.0

Toggle 1.0.0's commit message
feat: add /domaindoc CLI commands and fix schema issues

WHY THIS CHANGE:
OSS release testing revealed missing CLI functionality for domaindocs
and a schema mismatch causing memory extraction failures.

PROBLEM SOLVED:
1. No way to manage domaindocs from CLI
2. Memory extraction failed due to orphan search_text column reference
3. API response used inconsistent 'domains' key instead of 'domaindocs'

ROOT CAUSE:
- CLI lacked domaindoc management commands
- Trigger function referenced search_text column that doesn't exist in schema
- API naming was inconsistent with 'domaindoc' terminology

CHANGES:
- talkto_mira.py: Added /domaindoc list|create|enable|disable commands
- talkto_mira.py: Status bar always shows tier (magenta) + enabled docs (bright_yellow)
- talkto_mira.py: Fixed API response parsing (data.domaindocs not domaindocs)
- cns/api/actions.py: Renamed 'domains' to 'domaindocs' in list response
- deploy/mira_service_schema.sql: Removed orphan search_text from trigger
- lt_memory/migrations/add_text_search.sql: Same trigger fix

IMPACT:
- BREAKING: API consumers must use 'domaindocs' key instead of 'domains'

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

0.99

Toggle 0.99's commit message
feat: animated splashscreen with integrated server startup

WHY THIS CHANGE:
The static MIRA logo splashscreen felt dated and the server startup flow
was disconnected from the visual experience.

PROBLEM SOLVED:
- Server startup showed text messages instead of visual feedback
- Preference API response parsing was broken (missing data wrapper)
- Terminal resize caused display issues
- Model/think commands printed inline instead of refreshing display

ROOT CAUSE:
The API wraps handler results in {success, data} but get_preferences()
accessed model/budget directly on the response instead of the data field.
The original splashscreen was a static logo with fixed timing, not
connected to actual server startup progress.

SOLUTION RATIONALE:
Animated splashscreen serves dual purpose: visual polish and server startup
indicator. Random ASCII character mutation matches web loading animation style.
Animation runs for minimum 2 seconds (visual appeal) or until server ready
(functional feedback). SIGWINCH handler ensures display integrity on resize.

CHANGES:
- Added animated ASCII splashscreen with random character mutation
- Integrated server startup into splashscreen animation flow
- Fixed get_preferences() to extract from data wrapper
- Added SIGWINCH handler for terminal resize
- Model/think commands now refresh full screen
- Added clear_screen_and_scrollback() for proper terminal clearing
- Reorganized BYPASSRLS comment in schema to header section

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

0.97

Toggle 0.97's commit message
Create deploy.sh

0.94

Toggle 0.94's commit message
feat: complexity-based context curation and thinking budget controls

WHY THIS CHANGE:
Second OSS release consolidates context window management around information density rather than arbitrary limits. Adds per-continuum thinking budget controls for Claude's extended thinking feature. Introduces relative time formatting throughout the system to reduce cognitive load on the LLM.

PROBLEM SOLVED:
Previous session cache loading used fixed segment counts (load N most recent), treating all segments equally regardless of information density. Users had no control over Claude's extended thinking feature on a per-conversation basis. Time information required constant mental calculation from absolute timestamps. Reminders displayed flatly without urgency differentiation. Memory extraction auto-created missing continuums instead of failing fast when signup was incomplete.

ROOT CAUSE:
Original segment loading assumed all conversation segments have equal value - a 5-message architecture discussion and a 40-message greeting exchange both counted as "1 segment". Extended thinking was system-wide configuration (all-or-nothing). Absolute timestamps ("2024-11-15 14:30:00 UTC") forced the LLM to calculate temporal distance every time it encountered a date, wasting reasoning cycles on arithmetic instead of semantic understanding. Reminder display didn't emphasize overdue items. Auto-creation of missing resources masked signup failures as degraded service.

SOLUTION RATIONALE:
Assign complexity scores (1-3) during summarization based on cognitive load and information density, then accumulate segments until complexity budget exhausted. This allows rich conversations to dominate context window while trivial exchanges compress away. Add per-continuum thinking budget preference (API endpoint + Valkey caching) so users can enable/disable extended thinking for specific conversations.

Shift to relative time formatting ("26 days ago", "in 5 hours") to eliminate temporal arithmetic overhead - the LLM can immediately understand recency without calculating deltas. "26 days" is semantically direct; "2024-10-14" requires subtracting from current date, converting to days, and contextualizing. This reduces cognitive load across reminders, segment timestamps, and any time-sensitive context.

Rewrite reminder display to separate overdue (urgent) from upcoming (informational) with relative time and visual emphasis. Enforce continuum existence from signup to surface infrastructure issues immediately.

RELATIVE TIME PHILOSOPHY:
Absolute timestamps optimize for precision. Relative timestamps optimize for comprehension. When MIRA sees "DUE 3 days ago" it immediately understands urgency and recency without mental arithmetic. When it sees "2024-11-06 09:30:00" it must: (1) retrieve current date from context, (2) calculate delta, (3) convert to human-meaningful units, (4) assess significance. This cognitive overhead compounds across every timestamp in context - segment summaries, reminder due dates, memory access times, event timestamps.

Relative time moves the calculation burden from inference time (expensive, repeated) to formatting time (cheap, once). The LLM receives pre-digested temporal semantics: "just now", "5 minutes ago", "2 weeks ago", "in 3 hours". This frees reasoning capacity for actual conversation understanding rather than date arithmetic.

CHANGES:
- **Relative Time Infrastructure**:
  - utils/timezone_utils.py: New format_relative_time() function with fine-grained granularity
  - Handles past ("5 hours ago") and future ("in 2 days") with proper grammar
  - Six granularity levels: minutes, hours, days, weeks, months, years
  - Special case for immediate: "just now" (< 60 seconds)

- **Complexity-Based Session Loading**:
  - cns/core/segment_cache_loader.py: New _select_summaries_by_complexity() accumulates segments until complexity limit
  - config/prompts/segment_summary_system.txt: Added complexity scoring guidelines (cognitive load vs message count)
  - cns/services/summary_generator.py: Returns 3-tuple (synopsis, title, complexity)
  - utils/tag_parser.py: Extracts <mira:complexity> tag (1-3 integer)
  - cns/services/segment_collapse_handler.py: Stores complexity_score in sentinel metadata
  - config/config.py: session_summary_count → complexity_limit (8), max_count (5), query_window (9)

- **Thinking Budget Preference System**:
  - cns/api/actions.py: New ContinuumDomainHandler with set/get_thinking_budget_preference actions
  - cns/core/continuum.py: Added _thinking_budget_preference property and setter
  - cns/infrastructure/continuum_pool.py: get/set_thinking_budget_preference methods, loads preference on session start
  - cns/infrastructure/valkey_message_cache.py: get/set_thinking_budget methods, invalidated with session
  - cns/services/segment_collapse_handler.py: Resets thinking budget to None after collapse

- **Reminder Display Refactoring**:
  - working_memory/trinkets/reminder_manager.py: Complete rewrite (135 lines changed)
  - Separates overdue (⚠️⚠️⚠️ OVERDUE REMINDERS) from today's upcoming
  - Uses relative time ("DUE 3 days ago" vs "in 5 hours") for immediate comprehension
  - Visual emphasis for urgency (bold, caps, emojis)
  - Hybrid format for today's reminders (relative + absolute time for user context)

- **Memory Batching Refactoring**:
  - lt_memory/batching.py: Renamed run_daily_extraction → retry_failed_extractions (clarifies purpose)
  - Changed all set_current_user_id(None) → clear_user_context() (proper cleanup)
  - Segment extraction now chunks messages using segment_chunk_size (40)
  - No minimum message requirement for segment extraction (only for boot extraction)
  - Better error handling in batch result processing (catches ValueError/Exception separately)
  - Continuum must exist from signup (raises RuntimeError instead of auto-creating)

- **Configuration Updates**:
  - config/config.py: CORS origins explicitly specified (miraos.org, localhost:1993)
  - Log level changed DEBUG → WARNING (reduce noise)
  - segment_chunk_size: 40 (smaller chunks for better extraction quality)
  - min_messages_for_extraction → min_messages_for_boot_extraction (clarify scope)

- **README Transformation**:
  - README.md: 638 lines removed, 31 lines added
  - New focus: "Context Window Curation as Architecture"
  - Explains complexity scoring, memory momentum decay, event coordination
  - Describes information density-based selection vs fixed quantities
  - Links to hosted instance at miraos.org

- **Architecture Cleanup**:
  - Removed cns/api/websocket_chat.py (536 lines) - WebSocket support eliminated
  - Removed tools/implementations/continuumsearch_tool.py (568 lines) - functionality consolidated elsewhere
  - Removed docs/SINGLE_USER_IMPLEMENTATION_GUIDE.md - superseded by deploy.sh

- **Deployment Infrastructure**:
  - Added deploy.sh: Comprehensive cross-platform deployment (macOS/Linux)
  - Platform detection, dependency installation, service verification
  - Automated Vault initialization, PostgreSQL deployment, model downloads
  - deploy/migrations/: add_user_names.sql, add_overarching_knowledge.sql
  - scripts/: create_user_with_magic_link.py, get_magic_link.py, query_user_messages.py, emergency_login.sh

- **User Information System**:
  - working_memory/trinkets/user_info_trinket.py: Displays overarching_knowledge field
  - Two-level caching (session context + database)
  - deploy/mira_service_schema.sql: user name fields in schema
  - deploy/prepopulate_new_user.sql: Updated for new fields

- **Minor Fixes**:
  - CLAUDE.md: Added "The User's name is Taylor."
  - Various imports reorganized
  - Documentation updates

FUNCTIONALITY PRESERVED:
- Core CNS conversation orchestration
- Event-driven architecture
- Memory extraction, consolidation, decay
- Dynamic tool loading
- User isolation and credential management
- All existing tools (except continuumsearch)
- Three-tier caching infrastructure

IMPACT:

PERFORMANCE:
- Session cache loading now complexity-based: rich conversations get more context budget
- Segment extraction uses smaller chunks (40 vs 100) for better quality
- Thinking budget caching avoids repeated configuration lookups
- Relative time formatting eliminates temporal arithmetic during inference

BREAKING:
- WebSocket endpoint removed - HTTP API only
- continuumsearch_tool removed
- Database schema requires migrations for user name fields
- Continuum must exist from signup (fails fast instead of auto-creating)

SECURITY:
- User isolation unchanged
- Credential management unchanged
- Fail-fast on missing infrastructure

TESTING:
- Added tests/utils/test_tag_parser_complexity.py
- Updated test fixtures for user fields

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

0.9

Toggle 0.9's commit message
docs: added LICENSE.md

MIRA is freely available for personal-use forever and the code decays into an Apache 2.0 license for commercial use with a 4 year decay. Commercial users are welcome to contact me directly about licensing the code before then,,, heck,, I'll probably say yes and even provide support and/or commercial users can get API access via miraos.org and not have to worry about infrastructure.

I chose BSL because I believe that the world is built on strong OSS. Mira is built on OSS. I want developers to be comfortable contributing code without worrying that it'll get Redis'd. Enjoy!