[P1] ZARA-009 — Make memory startup fail open and keep transient context out of persisted history #10

Closed
opened 2026-07-18 19:19:35 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-07-18 19:19:35 +00:00 (Migrated from github.com)

Problem

MemoryManager only falls back to in-memory storage when ChromaDB is absent. Failures while creating the persistent client or ONNX embedding function can abort Zara startup, despite the documented graceful fallback.

AgentManager.process_async() appends retrieved memory as a SystemMessage and persists the entire graph result. Every turn can therefore leave another system message in the middle of conversation history, which is invalid or fragile for some providers.

Session “summaries” are currently raw transcript concatenations and can grow without a bound.

Required fix

  • Catch memory backend/model initialization failures and fall back explicitly with a warning and health status.
  • Keep retrieved memory context transient for the current turn; do not persist it as conversational history.
  • Bound stored session summaries and distinguish transcript storage from an actual summary.
  • Keep memory disablement and local fallback deterministic.

Required tests

  • Simulate Chroma client failure, embedding initialization failure, unavailable Ollama embeddings, disabled memory, and successful persistent memory.
  • Multi-turn test proving only one leading system prompt is persisted and memory context is not accumulated.
  • Summary-size tests.
  • Add scripts/test-memory.sh with no network/model downloads.

Acceptance

  • Zara starts when optional memory backends fail.
  • Conversation history remains provider-valid across many turns.
  • Stored summaries respect configured bounds.

Branch

fix/zara-009-memory-fallback

Dependencies

ZARA-002, ZARA-008.

## Problem `MemoryManager` only falls back to in-memory storage when ChromaDB is absent. Failures while creating the persistent client or ONNX embedding function can abort Zara startup, despite the documented graceful fallback. `AgentManager.process_async()` appends retrieved memory as a `SystemMessage` and persists the entire graph result. Every turn can therefore leave another system message in the middle of conversation history, which is invalid or fragile for some providers. Session “summaries” are currently raw transcript concatenations and can grow without a bound. ## Required fix - Catch memory backend/model initialization failures and fall back explicitly with a warning and health status. - Keep retrieved memory context transient for the current turn; do not persist it as conversational history. - Bound stored session summaries and distinguish transcript storage from an actual summary. - Keep memory disablement and local fallback deterministic. ## Required tests - Simulate Chroma client failure, embedding initialization failure, unavailable Ollama embeddings, disabled memory, and successful persistent memory. - Multi-turn test proving only one leading system prompt is persisted and memory context is not accumulated. - Summary-size tests. - Add `scripts/test-memory.sh` with no network/model downloads. ## Acceptance - Zara starts when optional memory backends fail. - Conversation history remains provider-valid across many turns. - Stored summaries respect configured bounds. ## Branch `fix/zara-009-memory-fallback` ## Dependencies ZARA-002, ZARA-008.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/zara#10
No description provided.