// SUBSTRATE · v0.1.0

session-loam

Memory continuity for autonomous agents.

A SQLite-backed substrate that remembers what your agent learned across runs. Identity-scoped. Tag + full-text retrieval. Never-delete with reinforce-on-retrieve. No daemon, no broker, no service to operate — just a file per agent and a Python library that knows how to query it.

// THE FAILURE MODE

"I solved this same problem three sessions ago." But the agent has no durable record of the solution, so it solves it again — possibly worse. Chat history compresses away. Vector DBs lose identity. Ad-hoc files lose schema. Learning-as-state has no substrate. Until now.

Three problems, named

Chat-history-as-memory

The conversation is volatile. Compaction strips the context that gave answers their shape. Nothing accumulates between runs.

Vector-DB-as-memory

ChromaDB, Pinecone, mem0. Great for semantic similarity. No identity scoping, no tag filters, no time queries, no attestation pathway.

Notes-folder-as-memory

A pile of markdown files. No schema, no retrieval, no reinforcement signal. The agent can't find what it wrote last week.

Three primitives

PRIMITIVE 1

One file per agent

~/.session-loam/<agent>.db. SQLite, ACID, queryable by any client. Identity is the partition; agents don't accidentally cross-pollinate.

PRIMITIVE 2

FTS5 + tags + time

Full-text search via SQLite's FTS5 virtual table. Tags via a junction table for exact-match filtering. Time-range queries via indexed timestamps. No embedding model in the critical path.

PRIMITIVE 3

Reinforce on retrieve

Every hit bumps last_accessed + access_count. Memories that matter surface to the top of ranked search. Memories that don't fade quietly — until you prune them.

// THE NEVER-DELETE RULE

Memories are not silently expired. They persist until you explicitly prune them. Edits are supersedes — the new entry references the old, the old stays for audit.

Search hides superseded entries by default and uses bm25 + recency + confidence + access-count to rank what surfaces. Tunable per call.

Where it slots in

session-loam is one library you can drop into a Python or shell pipeline. It composes with three substrate-layer projects you might already know, and works fine without any of them.

60-second tour

# Install (once published)
pip install session-loam

# Open the store for the current agent identity
python -c "
from session_loam import Store, Entry
store = Store.open(agent='mabus')

store.write(Entry(
    type='observation',
    content='Dan prefers terse responses with no trailing summaries.',
    tags=['dan', 'preference'],
    confidence=0.95,
))

results = store.search(query='terse responses', tags=['preference'])
for r in results:
    print(r.entry.content)
"

"Identity is stable. Work-state is ephemeral. There's no canonical substrate for the middle thing — what an agent has learned across runs. session-loam is the substrate-layer answer: filesystem-backed, identity-aware, never-delete by default, ready to compose."