- Layer 2 semantic search now queries both curated and raw types,
closing the blind spot for turns past the 50-turn window pre-curation
- Layer 3 skips turns already returned by Layer 2 to avoid duplicate
context and wasted token budget
- get_recent_turns uses Qdrant OrderBy for server-side timestamp sort
with payload index; fallback to client-side sort if unavailable
- Bump version to 2.0.4
- Add portalocker file locking to debug_log() to prevent interleaved entries
- Add exc_info=True to curator _call_llm error logging for stack traces
- Add debug log message on JSON parse fallback in _parse_json_response
- Warn when cloud is enabled but API key env var is not set
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Handle all 4 combinations of caller system message and systemprompt.md
correctly: append when both exist, passthrough when only one exists,
omit when neither exists. Fixes leading \n\n when no caller system msg.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The chained .replace("Z", "+00:00").replace("+00:00", "") calls were
undoing each other, causing Z-suffixed timestamps to lose timezone info.
Now strips "Z" directly and ensures naive datetime for cutoff comparison.
Added regression test for old Z-suffixed timestamps.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix bare except clauses in curator.py and main.py
- Change embedding model to snowflake-arctic-embed2
- Increase semantic_score_threshold to 0.6
- Add memory context explanation to systemprompt.md
- Add pytest dependencies to requirements.txt
- Remove unused context_handler.py and .env.example
- Add project documentation (CLAUDE.md) and test files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added parse_curated_turn() function to correctly parse stored memories
- Fixed build_augmented_messages() to use proper message roles
- Layer 2 (semantic) and Layer 3 (context) now correctly parse
User: X / Assistant: Y format into separate messages
- Resolves context corruption where turns were dumped as single user message
v2.0.2