soul.py adds persistent memory to local LLMs with simple file-based approach

soul.py is a Python library that provides persistent memory for local LLM sessions by storing conversation history in human-readable markdown files, eliminating the need for databases or running servers.
How it works
The library creates two markdown files: SOUL.md for identity information and MEMORY.md for conversation logs. Every time you call agent.ask(), the system reads both files into the system prompt, processes the query, then appends the exchange to MEMORY.md. This allows memory to survive across processes and sessions.
Basic usage
Installation and setup:
pip install soul-agent
soul initExample implementation with Ollama:
from soul import Agent
agent = Agent(
provider="openai-compatible",
base_url="http://localhost:11434/v1",
model="llama3.2",
api_key="ollama"
)
agent.ask("My name is Prahlad, I'm working on an AI research lab.")
Later, in a new session:
agent.ask("What do you know about me?")
Returns: "You're Prahlad, working on an AI research lab."
Key features
- Works with Ollama, OpenAI, and Anthropic models
- No database or server required
- Human-readable markdown files
- Git-versionable and editable by hand
- Memory persists across processes and sessions
- Built specifically for adding persistent memory to local models
The tool was created to solve the problem of local LLMs forgetting information between sessions, providing a lightweight alternative to database-backed solutions.
📖 Read the full source: r/LocalLLaMA
👀 See Also

OMAR: Open-Source TUI for Managing Hundreds of AI Coding Agents Hierarchically
OMAR is a terminal-based dashboard that lets you manage swarms of coding agents (Claude Code, Codex, Cursor, Opencode) in hierarchical orgs. Built on tmux. Features agent-managing-agent hierarchies, heterogeneous backends, and Slack integration.

latexnav: Python Tool for LLM and Human Navigation of LaTeX Files
latexnav is a free open source Python tool that parses LaTeX files to extract structural elements like theorems, definitions, sections, labels, cross-references, and dependencies, providing summaries with authoritative line numbers to help LLMs and humans navigate large manuscripts efficiently.

sourcecode: Open-Source CLI to Compress Large Java/Spring Monorepos for Claude
sourcecode CLI reduces a ~4k-file Java/Spring monorepo from ~3M tokens to 1.7k tokens (compact mode). Currently focuses on context compression, git hotspot detection, and symbol lookup.

RescueBot: Telegram-based backup and restore for OpenClaw bots
RescueBot is a lightweight skill that automatically snapshots OpenClaw bot configurations and enables one-tap restore via Telegram commands, eliminating the need for SSH access during failures.