Repository navigation
MemPalace on local Android smartphone. #3066
p1m37aradox
started this conversation in
General
Replies: 1 comment
|
Implementing a checkpoint system that saves the agent's state before context overflow allows recovery after crashes, which is essential when working within strict memory limits on mobile devices; focusing on incremental state persistence can improve session continuity despite hardware constraints. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
SynapseBridge
First I would like to thank the MemPalace team for creating it! It came to my attention at almost the exact moment for almost the same reason you stated you made it. I noticed the amnesiac behavior and searching for a solution I came across your project. Since I see mobile platforms as the main interaction point for AI interactions, I've been focused on creating a working architecture within the Android environment. The edges are still rough but I've been making progress. I'm reposting the below content from one of my own discussions.
Quick update on the latest build—we just hit a major functional milestone with the MemPalace memory integration.
The Milestone: Recognizing Context Limits & Recovering Across a Crash During live testing on a multi-step directory listing task, the agent actively recognized that it was running out of context window headroom. On its own, it immediately wrote a checkpoint entry to its MemPalace diary before attempting to finish listing the requested directory.
While that multi-step turn still hit an overflow crash right after the write, the recovery loop held up: after restarting the session and simply prompting "continue," the agent autoloaded its palace state, located the exact diary entry it had written right before the crash, read back its prior state, and resumed working toward the correct response. Having an on-device agent recognize context exhaustion, persist its own working state, and pick up cleanly after a crash is a huge step forward for reliable local session continuity.
Model Shift (qwen3.5:0.8b → qwen3.5:2b) & Hardware Trade-Offs Why we stepped up to 2b: qwen3.5:0.8b was too inconsistent in its reasoning and tool routing to reliably chain steps without drifting. Moving to qwen3.5:2b gave us the reasoning stability needed for the agent to actually recognize context limits and execute the diary write properly.
Current Hardware Bottlenecks: Testing on an unrooted Android device (Termux + Debian proot) means we are running right against strict RAM ceilings with zero root access to adjust kernel OOM/LMK killers, swap/zRAM, or low-level scratch space. Because of that, 2b is still vulnerable to Android process kills and context overflow spikes during heavy multi-tool turns. We are aware this can all be alleviated using cloud computing but this is testing local model capabilities.
Next Steps Now that pre-crash diary checkpointing and post-restart recovery are proven, the focus is on tightening memory headroom—dialing in earlier PreCompact thresholds, quantized KV cache (q8_0) + Flash Attention flags, and leaner context caps (num_ctx / num_batch) so 2b stays well clear of OOM kills on unrooted mobile hardware.
Would love any feedback from others running 2b+ models inside unrooted proot environments on how you're balancing context size against Android's background process killer.
All reactions