soul.py: Your AI Remembers Nothing. This Fixes It in 10 Lines.
đ The Book is Here! Everything in this post (and much more) is now in Soul: Building AI Agents That Remember Who They Are â Available on Amazon â
đ v0.2.0 â Modulizer: Large MEMORY.md files burn tokens. The new Modulizer splits them into indexed modules for 40-60% token savings. Zero infrastructure needed. Read the writeup â
Every AI conversation starts the same way: âHi, Iâm Claude/GPT/Llama, how can I help you today?â
Youâve talked to this model a hundred times. Youâve told it your name, your projects, your preferences. It doesnât matter. The moment the session ends, it forgets everything. Tomorrow, you start from zero.
This is the most basic failure mode in AI agents, and somehow weâve normalized it.
The 10-Line Fix
from soul import Agent
agent = Agent()
agent.ask("My name is Prahlad and I'm building an AI research lab.")
# â "That's exciting â what are you working on first?"
# Later. New process. New session. Memory persists.
agent = Agent()
agent.ask("What do you know about me?")
# â "You're Prahlad, building an AI research lab."
Thatâs soul.py. Memory survives across processesâno database, no server, nothing running in the background.
How It Actually Works
soul.py uses two markdown files as the agentâs persistent state:
| File | Purpose |
|---|---|
SOUL.md | Identity â who the agent is, how it behaves |
MEMORY.md | Memory â timestamped log of past exchanges |
Every agent.ask() call:
- Reads
SOUL.md+MEMORY.mdinto the system prompt - Calls the LLM
- Appends the exchange to
MEMORY.mdwith a timestamp
Thatâs the entire architecture. 150 lines of Python.
What MEMORY.md Looks Like
After a few conversations:
# MEMORY.md
## 2026-03-01 08:00
Q: My name is Prahlad and I'm building an AI research lab.
A: That's exciting â what are you working on first?
## 2026-03-01 09:15
Q: What should I focus on today?
A: Based on your AI lab work, you mentioned the memory paper
was the priority...
Human-readable. Version-controllable. Editable by hand. git diff your agentâs memories if you want.
The Setup
pip install soul-agent
soul init
The wizard asks two questions:
- Whatâs your agentâs name?
- Which provider? (anthropic / openai / openai-compatible)
Creates SOUL.md and MEMORY.md in your current directory. Youâre done.
Works With Everything
# Anthropic (default)
agent = Agent(provider="anthropic")
# OpenAI
agent = Agent(provider="openai")
# Local Ollama â no API key needed
agent = Agent(
provider="openai-compatible",
base_url="http://localhost:11434/v1",
model="llama3.2",
api_key="ollama"
)
Why Not LangChain / MemGPT / Clawdbot?
Those are frameworks. soul.py is a primitive.
- LangChain â orchestration layer, requires significant setup
- LlamaIndex â document indexing, needs vector store infrastructure
- MemGPT â impressive but opinionated about the full agent stack
- Clawdbot / OpenClaw â full agent runtime with tools, channels, scheduling, approval gates
The last category is worth expanding on. Tools like Clawdbot give you a complete agent infrastructure: Telegram/Discord/Slack integration, browser automation, cron jobs, exec sandboxing, the works. If youâre building a production agent that needs to do things in the world, thatâs the right choice.
But what if you just want your Python script to remember who itâs talking to?
soul.py is the answer when:
- Youâre building something custom and donât want a framework
- You want memory without buying into an entire agent architecture
- You need to drop persistent identity into an existing codebase
- You want files you can read, edit, and
git diff
Itâs the difference between âI need a carâ and âI need wheels.â Sometimes you just need wheels.
What v0.1 Doesnât Do (Yet)
Once MEMORY.md gets very large (thousands of entries), itâll overflow the context window. Thatâs the v2.0 problem â solved with RAG retrieval.
For most use cases, v0.1 runs indefinitely. A typical daily exchange is ~200 words. Youâd hit the context limit after roughly 6 months of daily use. Plenty of runway.
The versions:
- v0.1: Markdown-native, zero infrastructure
- v2.0: RAG + RLM hybrid with query routing (uses Qdrant + Azure embeddings)
Try v2.0: soulv2.themenonlab.com
The Philosophy
The best infrastructure is no infrastructure.
Vector databases are powerful. Theyâre also another service to run, another thing to break, another dependency to manage. For most agent use casesâpersonal assistants, research companions, project copilotsâyou donât need them. You need a text file that persists.
soul.py starts there. When you outgrow it, the upgrade path exists. But most people wonât need it for months.
Try It Now â No Install Required
Live demo: soul.themenonlab.com
Chat with a soul.py agent and watch MEMORY.md fill up in real time. Ask it something, then try âWhat do you know about me so far?â â youâll see exactly how the memory injection works under the hood.
No API key needed. No signup. Just try it.
(Demo source is also open: soul.py-demo â ~150 lines of FastAPI if you want to self-host)
Get Started Locally
pip install soul-agent
soul init
Star the repo: github.com/menonpg/soul.py
Your AI shouldnât have amnesia. Fix it in 10 lines.
Community Response
Within hours of sharing soul.py on Reddit, it became the #1 post of all time on r/ollama â a community of 100K+ developers running local LLMs.
The numbers (first 9 hours):
- đ 24,000+ views
- đ #1 post on r/ollama
- đ Readers from 50+ countries (37% US, 7% Germany, 5% Canada)
- đŹ Dozens of questions and feature discussions
soul.py â Persistent memory for any LLM in 10 lines (works with Ollama, no database)
by u/the_ai_scientist in r/ollama
The response validated something we suspected: developers want memory without complexity. Not every project needs a vector database. Sometimes you just need a text file that persists.
Thanks to everyone who tried it, asked questions, and pushed us to add v2.0âs RAG support. This is just the beginning.
The Book
Everything in this post â and much more â is now in âSoul: Building AI Agents That Remember Who They Areâ.
The book covers:
- Why agents forget (architectural deep dive)
- Identity vs Memory (SOUL.md vs MEMORY.md philosophy)
- The RLM Pattern (when RAG isnât enough)
- Multi-agent identity coordination
- The Darwinian approach to evolving agent identity
- Complete working code in every chapter
â Get âSoulâ on Amazon | â Gumroad Bundle (PDF + setup wizard + cheatsheets)
Try the live demo: Ask Darwin â an AI companion built with the same architecture the book teaches.