本文基于MacBook Air M2搭配本地Ollama离线部署gemma4:e4b模型,搭建Pi终端AI Agent并安装titan-pi-memory记忆技能,解决原生Ollama会话关闭上下文丢失问题。