r/PiCodingAgent • u/TacosAlPastor92 • Oct 20 '26
Question Pi Memory for Local Models
I have a pretty nice local Ollama setup that can comfortably run qwen3.8:27b w/ a 262k context window and a good token rate.
I'm attempting to run pi-observational-memory, with two main goals:
- On long term projects: Remembering architectural decisions, lessons learned, problems solved, etc.
- On day-to-day tasks: Remembering my preferences, patterns of operation, and in general details about how I like to do things.
The setup works, however I have long delays everytime the observer and reflector workers kick in (as expected), as the workers cannot run concurrently.
I'm considering running a CPU-only model dedicated to managing these worker threads, but I wanted to check in with the community and see what people are doing in similar scenarios.
Keep in mind I'm not married to pi-observational-memory at all and would consider trying out other solutions.
3
u/Asshole_DESTROYER3 Oct 20 '26
I'm new to pi but have always used claude code pretty heavily. I usually just have a master obsidian vault and put every project inside a subdirectory and had claude build on the vault. That way I have actual human readable md files instead of a bunch of fragmented memory files.I also have an obsidian base which is like a table of every file and/or a map.md just so graph view is actually usable. No idea if the same would apply to pi but I'm sure there's an already an extension for that or you might not even need one.
3
u/Particular-Site2066 Oct 20 '26 edited Oct 20 '26
Moved to Pi from Cline a couple of weeks ago. First thought was - does it have something similar to memory bank concept in Cline? Asked Pi itself and it proposed three things:
I decided to embrace Pi’s minimalism and avoid downloading existing solutions, so gave those 3 options a try.
Two weeks passed and I’m quite happy with how well this simple combination works.
P.S. Using it also with local Qwen3.8-27b (if that matters).
2
u/Snoo-82455 Oct 20 '26
I installed pi-memctx early on and it’s been doing a really good job. I did try observational memory and some karpathy method extension for a bit (though that’s not really a good case for auto-memory) but they seemed more involved. Pi-memctx is mostly good as set and forget but you have control on what you want to keep for memory and also once the memory queue piles up you can have a model help audit the queue. Also there can be some stale entries or old ones conflicting new info so it’s good to have a model help with maintenance on a weekly basis but for the most part, it’s just in the background and it’s been really helpful because of its global scope. I can reference something in a new folder and new session and it will search the memory and understand the reference, so i do not feel the need to find any other memory alternative. I dig it.
2
u/randomgenericbot Oct 20 '26
I tried exactly that: running a cpu worker for pi observational memory, started creating an extension that can run a gemma4 (which, standalone, reaches ~20-35 tps with MTP on an Ryzen 9600x), but as soon as parallel GPU inference was running, the tps for the cpu model tanked down to below-10 tps.
Reason: Every so slight memory read for the GPU inference destroys the inference for CPU which is highly sensitive to bandwith- and CPU cache disruptions. If you do not have a dedicated, secondary model, pi observational memory eats away all the speed you had.
I dropped that, and created another extension, similar to pi-observational-memory and blackhole, intended for single-model-single-gpu inference, but still the hopes to get good quality summaries with lower time-cost than pi-observational memory or other "use a second agent to summarize and observe your work" extensions.
How: The extension simply lets the model summarize its work, and then it forks a session in the background, with the same prompt, reusing the full kv cache, evaluating the summary. It is not faster than the pi-native summary, but it is much, much better quality wise.
I now reached a state where I consider it stable: q3.8 gsq-rco running on 16gb vram, with 131k token via kv streaming with mtp, getting 10-45 token per second (full context, bad MTP acceptance = 10 tps, low context, good acceptance = 45 tps) and had sessions far beyond 40 compactions with - to my experience - no noteable quality drop. Most improvements of the extension itself have been done completely locally.
If speed is more important to you than qualitycontrol, you can skip the background audits mostly by setting /sam depth light or set the according env var permanently.
I just wrote a sum-up with the github link here:
https://www.reddit.com/r/PiCodingAgent/comments/1xb7k4n/i_solved_compaction_for_singlesession_on/
1
u/slypheed Oct 24 '26
I've been using pi observable memory for a while now and it's great, pretty much never wait for compactions now.
Caveat that I got a steal on zai coding plan last year so I just use glm 5.3 flash, granted DeepSeek flash is quite cheap or free if you look around.
0
u/Acceptable_Stress154 Oct 20 '26
I run a full agent based on pi, I can share the tech specs of how it’s built if you like