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

Silos Dashboard: Open-source web UI for managing OpenClaw agents
Silos Dashboard is an MIT-licensed web UI for managing OpenClaw agents, replacing config files and CLI with a single interface. It offers agent management, live chat with streaming, skill installation, task boards, channel integrations, and analytics.
MathCode: A Mathematical Coding Agent with Lean 4 Formalization
MathCode is a terminal AI coding assistant that converts plain-language math problems into Lean 4 theorems and attempts formal proofs, with a persistent REPL, reusable libraries, and an Obsidian knowledge graph.

Discord Bridge for Autonomous Claude Code Sessions
A bridge.js script (~50 lines, discord.js v14) creates real-time two-way chat between Discord and Claude Code via WebSocket + local file queue, replacing 2-minute polling with microsecond file reads. Tested on 27K lines analyzed overnight.

angular-grab: Tool for Extracting Angular Component Context for AI Agents
angular-grab is a dev-only tool that lets you point at any UI element in an Angular dev server, press Cmd+C, and copy the full component stack trace with file paths and HTML to your clipboard for pasting into AI agents.