Context
When the Memory service attempts to summarize a massive session (e.g., ones with over 50-100 interactions), it joins all memory documents into a single aggregatedContent payload. For Local LLMs running with a default n_ctx limit of 4096, this payload throws an Out-Of-Memory / context length exceeded error.
Because the loop executing the batch in SessionService.summarizeSessions() lacks granular try/catch protection for individual session iterations, a single context length violation permanently halts the entire digestion daemon. This is why the session collection currently has 0 records after the vector DB engine swap.
Objectives
- Implement a safe truncation envelope (
MAX_PAYLOAD_LENGTH) inside SessionService.summarizeSession(), slicing the middle out of oversized sessions to preserve original prompt context and final outcomes.
- Wrap the LLM
generateContent block inside an internal try/catch within the batch iterator, ensuring that if a session summary fails, it isolates the failure and allows processUndigestedSessions to continue processing the remaining batches.
Context
When the Memory service attempts to summarize a massive session (e.g., ones with over 50-100 interactions), it joins all memory documents into a single
aggregatedContentpayload. For Local LLMs running with a defaultn_ctxlimit of 4096, this payload throws an Out-Of-Memory / context length exceeded error. Because the loop executing the batch inSessionService.summarizeSessions()lacks granulartry/catchprotection for individual session iterations, a single context length violation permanently halts the entire digestion daemon. This is why thesessioncollection currently has0records after the vector DB engine swap.Objectives
MAX_PAYLOAD_LENGTH) insideSessionService.summarizeSession(), slicing the middle out of oversized sessions to preserve original prompt context and final outcomes.generateContentblock inside an internaltry/catchwithin the batch iterator, ensuring that if a session summary fails, it isolates the failure and allowsprocessUndigestedSessionsto continue processing the remaining batches.