For OpenClaw agents — open source (MIT)
Autoglia

The memory that
runs itself.

Your OpenClaw agent wakes up fresh every session. Autoglia gives it a real SQLite brain — structured memory that records automatically, survives context loss, and knows who you are.

View on GitHub → Install & migrate

Free and open source under the MIT License. No subscription. No cloud. Your data stays local.

$ python3 ~/clawd/skills/memory-db/recover.py

✓ MEMORY RESTORE — Session context recovered
Last session: Marketing campaign planning (Feb 27)
Open tasks: Draft 3 launch posts · Review pricing strategy
Contacts: Alex Rivera (last contacted Feb 26) · Morgan Chen (Acme Corp)
Active projects: Product Launch (high priority) · Q1 Outreach
Knowledge: 142 facts · 38 contacts · 12 checkpoints

→ Context restored. Continuing from where you left off.
The problem

Your agent forgets everything.
Every. Single. Session.

OpenClaw agents are powerful. But without persistent memory, every conversation starts from zero. That's expensive — in time, frustration, and trust.

👤

Contacts you've mentioned a hundred times

You tell it your client's name, email, and project. Next session: "I don't have any information about that person."

📋

Projects explained from scratch, again

Three weeks in, your agent has no idea what you're building. You re-explain the whole thing. Again. For the fourth time.

💥

Context loss kills the thread

Context window fills up. Compaction hits. The agent greets you like a stranger mid-project. Everything you built up — gone.

📝

Decisions made and immediately forgotten

You chose a strategy. Two months later: "I don't have context on why we decided that." The reasoning is lost forever.

Before & After

What actually changes.

The same conversation, with and without Autoglia.

Without Autoglia

You: "What do you remember about Alex Rivera?"

Agent: "I don't have any information about that person. Could you remind me who they are?"

↑ You mentioned them 11 times across 6 sessions.

With Autoglia

You: "What do you remember about Alex Rivera?"

Agent: "Alex Rivera — product lead at Acme Corp, interested in API integrations. Last contacted Feb 26. On your outreach list for Q1."

↑ Pulled from the contacts table. Instant.

Context loss — Without Autoglia

Agent: "Hello! How can I help you today?"

↑ You were in the middle of a product launch. Context window compacted. The thread is gone.

Context loss — With Autoglia

Agent runs recover.py automatically:

Agent: "I see we were working on the Q1 product launch — 3 posts scheduled today and a pricing review pending. Want me to continue?"

↑ Reconstructed from database in 2 seconds.

Architecture

Five layers. Fully automatic.

Autoglia doesn't ask your agent to cooperate. The infrastructure records everything whether the agent helps or not — and a background agent keeps memory clean while you're away.

1

The Database — SQLite memory graph, on your machine

Contacts, projects, tasks, knowledge, decisions, retrieval runs, pathway stats, memory relations, and more — all in a single ~/memory.db file. Includes normalized topics, session analytics, watchword triggers, background jobs, context packs, and proposal staging. No server. No cloud. Queryable with any SQLite tool. Your data never leaves your machine.

2

Infrastructure-level recording — sync-sessions.py

Pulls every message from OpenClaw's own JSONL session files directly into the database. Runs on session start. Works even when the agent didn't save anything during the conversation. No LLM cooperation required.

3

Automatic checkpointing with segmentation — auto-checkpoint.py

An hourly cron job finds sessions with unsummarized messages and splits them into logical conversations by inactivity gap (default: 30 minutes). Monday's planning session and Thursday's debugging session don't get collapsed into one summary. Each segment gets its own topic, linked in the normalized topic index. Runs entirely in Python — zero API calls, no LLM invoked. Manual checkpoints written by the agent take priority with their richer decision and follow-up data.

4

Context recovery — recover.py

Detects when the context window has been compacted. Reads the database — recent checkpoints, open tasks, contacts mentioned, stale loops, pending memory proposals — and reconstructs the thread automatically. With segmented checkpoints, recovery is scoped to the right conversation, not a week-long blur. The thread continues as if nothing happened.

5

Background memory agent — memory-agent.py

A 15-minute cron job that maintains the database while the agent is idle. Runs entity normalization, builds precomputed startup and project context packs, scores memory health, detects conflicts, and stages extraction proposals — all without touching the foreground session. Uses a lockfile to prevent overlap and a job queue for cross-run idempotency. Heuristic extraction now; model-assisted extraction available via AUTOGLIA_MODEL_EXTRACT=1 with any OpenAI-compatible endpoint.

Security & Data Model

Your data never leaves
your machine.

Here's exactly what Autoglia reads, what it writes, and what it never touches — no hand-waving.

📖

What gets read

  • OpenClaw's own JSONL session files at ~/.openclaw/agents/main/sessions/
  • Each message: role, content, and timestamp — nothing else
  • Files are opened read-only, never modified or deleted
  • Only files newer than the last sync run are processed
✏️

What gets written

  • One file only: ~/memory.db (SQLite, on your machine)
  • All writes go through memdb.py — fully parameterized queries, no raw SQL from user input
  • WAL journal mode — concurrent reads never block writes
  • Full rollback manifest created before any schema migration
🚫

What never happens

  • No network requests for storage — ever
  • No API calls during auto-checkpoint (pure Python, no LLM)
  • No third-party analytics or telemetry
  • No cloud sync, no vendor lock-in, no subscription server to go dark
How data flows through the system
~/.openclaw/agents/main/sessions/*.jsonl
sync-sessions.py
conversation_transcripts
 (raw messages, read-only source)
↓ cron, hourly — no API call
auto-checkpoint.py
conversation_log
 + conversation_topics, session_stats
↓ on session start
recover.py
agent context
 (reads DB, reconstructs thread)

The phrase "no LLM involvement" specifically means auto-checkpoint makes zero API calls. Here's the distinction between the two checkpoint types:

Auto-checkpoint — runs on cron

Pure Python. No API call. Runs hourly whether the agent cooperates or not. Extracts the first few user messages (up to 70 chars each) and the first assistant response as raw snippets. Topic = first user message. Decisions and follow-ups are not filled in — this is a safety net, not a rich summary.

Manual checkpoint — agent-triggered

Your agent calls checkpoint.py mid-session with a real summary, decisions made, and follow-ups. This is the LLM writing about what it just did. These richer entries take priority over auto-checkpoints when recover.py reconstructs context. The two types complement each other.

What's included

Everything. No extras needed.

One zip. Everything included. A complete memory infrastructure that's live in 5 minutes.

🗄️

Structured SQLite Schema

Contacts, projects, tasks, knowledge, ideas, content, outreach, meetings, reminders, preferences, businesses, retrieval instrumentation, pathways, memory relations, and more.

🔄

Auto-Checkpoint with Segmentation

Hourly cron captures message snippets from every session — zero API calls. Conversations separated by inactivity are split into distinct segments so Monday's chat and Thursday's don't get merged into one confusing summary.

Context Recovery

Detects when OpenClaw's session context has been compacted by checking JSONL transcript gaps, reads the database, and hands your agent a full context restore block. Picks up mid-conversation.

🏷️

Topic Index

Every conversation topic is stored once, deduplicated, and tracked by use count. One checkpoint can now be tagged with multiple topics — query "all sessions that discussed X" instead of guessing with substring search.

🔔

Watchwords

Store keyword triggers with associated actions. When a user message contains a watchword, the agent gets a JSON hit list with match counts. Use for routing, flagging, or topic tagging — built entirely in Python, not fragile SQL triggers.

📈

Session Analytics

Per-session stats written automatically after each checkpoint: message count, user vs. bot split, duration, average gap between messages, and topics discussed. No LLM involved — pure Python behavioral data.

📊

Web Dashboard

Local Flask app at localhost:5000. Browse contacts, knowledge, projects, and conversations live. Live updates every 3 seconds.

🔒

SQL Injection Safe

memdb.py is the only write interface — fully parameterized queries. No raw SQL from user input. Ever.

📦

One-Command Install

Pre-flight check, schema migration, AGENTS.md injection, workspace indexing, cron registration. Full rollback manifest.

🔀

Migration System

Versioned schema upgrades. Install a new version — your existing data is never touched. Safe to update anytime.

📥

Import Existing Notes

Scan your workspace markdown files into the database on first run. Everything you've already written becomes queryable.

💾

Backup & Export

Binary database backup using SQLite's online backup API — lossless, safe while the DB is open. Export to JSON or CSV for portability. Email a backup directly from the command line. Restore on a new machine in one command.

🤖

Background Memory Agent

15-minute cron worker that normalizes entities, detects stale loops, scores memory health, and builds precomputed context packs — all while the agent is idle. Lockfile-protected, idempotent across runs, safe to overlap with foreground activity.

📬

Proposal Staging

Non-deterministic extractions (decisions, entities, open loops) land in a review queue — never written directly to canonical tables. Accept or reject from the CLI or see them surfaced in your session briefing. Safe by default.

Precomputed Context Packs

The background agent prebakes startup and per-project context snapshots so session briefings load instantly. Invalidated and rebuilt automatically when underlying data changes.

❤️

Memory Health Scoring

Five bounded metrics tracked every run: duplicate entity risk, stale tasks, unsummarized session backlog, orphan rows, and checkpoint freshness. Surfaced in stats.py health report.

Comparison

How we stack up.

The cloud tools charge per month. The marketplace skill uses markdown files. Autoglia is the infrastructure layer.

Autoglia OpenClaw Memory Skill ($9) LLMory Pro ($29/mo) ChatGPT Memory
Storage Local SQLite DB Markdown files Cloud server OpenAI servers
Auto recording Infrastructure-level ~ LLM must cooperate ~ Partial ~ LLM decides
Context recovery Automatic
Structured tables Structured relational schema Flat files ~ Limited
Web dashboard
Data stays local Always Cloud Cloud
Price Free (MIT) $9 one-time $29/month ($348/yr) Subscription
Interactive Demo

Try it yourself.

Pick a scenario and watch Autoglia respond in real time. This is exactly what your agent sees.

recover.py — autoglia
What's in the package

Everything included. No extras.

setup.pyOne-command install, uninstall, pre-flight check, rollback manifest
memdb.pySafe parameterized query interface — backup, export, topics, watchwords, and every DB operation in one place
recover.pyCompaction detection and full context restore from the database
sync-sessions.pyInfrastructure-level transcript sync from OpenClaw JSONL files
auto-checkpoint.pyHourly automated checkpointing with conversation segmentation — no LLM required
checkpoint.pyManual atomic checkpoint for critical decisions
dashboard.pyLocal Flask web dashboard — browse your memory at localhost:5000
migrate.pyVersioned schema migrations — upgrades never break your data
import.pyScan workspace markdown files into the DB; full restore from JSON with --overwrite
export.pyBinary backup (SQLite online backup API), JSON/CSV export, email delivery via mutt/sendmail/SMTP
stats.pyMemory health report — row counts, top topics, active watchwords, unsummarized warnings, and 5-metric health score
memory-agent.pyBackground maintenance worker — runs every 15 min via cron, normalizes entities, builds context packs, scores health, stages extraction proposals
extractors.pyTyped extraction interface — heuristic baseline included, optional model-assisted path via any OpenAI-compatible endpoint
init.sqlFull 26-table schema definition for new installs
SKILL.mdComplete instructions your agent reads on every session start — including backup/restore conversational triggers
README.mdSetup guide with examples and troubleshooting
EXAMPLES.mdEvery memdb.py command with real conversation examples
CHANGELOG.mdFull version history — every change documented
docs/FAQ.mdCommon questions, edge cases, and upgrade notes
tests/pytest test suite — 15+ test files, 150+ tests. Covers memdb, recover, checkpoint, auto-checkpoint, sync-sessions, memory intelligence modules, and benchmark scaffold execution. Runs against a temp DB, never touches your real data.
Install

Clone, migrate, run.

Autoglia is open source (MIT). Get the code on GitHub, run migrate.py on your database, and wire sync-sessions.py + recover.py into your agent startup. Questions? Use Discussions.

Open source
MIT License
no charge — fork, modify, ship
Updates ship on GitHub. Pull the latest anytime; run python3 migrate.py to upgrade your schema safely.
  • Full skill source — tests, dashboard, migrations
  • Auto-checkpoint + context recovery
  • Local web dashboard (optional Flask)
  • Community support via Discussions
  • Bugs and ideas via GitHub Issues
  • Email: support@autoglia.com
  • Your data stays on your machine. Always.
Open the repository →

Prefer a walkthrough? See the Installation FAQ.

Requirements

What you need.

OpenClaw (any recent version)
exec tool enabled
Python 3.9+
Linux / macOS / Windows (WSL)
flask (pip install flask — dashboard only, optional)

Python standard library only for core functionality — no pip installs required except for the optional web dashboard.

FAQ

Common questions.

Does this work with the free version of OpenClaw?

Yes. Autoglia works with any recent version of OpenClaw that has the exec tool enabled. It doesn't require a specific tier or hosting setup.

Will my existing data be safe when I upgrade?

Yes. The migration system (migrate.py) applies versioned schema changes without touching existing data. You can upgrade from any prior version safely. The installer also makes a full backup before making any changes.

How do I upgrade to a new version?

Copy the new files into your skill directory, then run one command: python3 migrate.py. That applies any missing schema changes in order and leaves your data untouched. It's safe to run multiple times — versions already applied are skipped automatically.

Do not run setup.py install on an existing installation — that command is for fresh installs only. On a system that already has Autoglia installed it will refuse with an "already installed" error and suggest you uninstall first. You don't need to uninstall. Just copy the files and run migrate.py.

What if my agent doesn't save things during a conversation?

That's exactly what Autoglia is designed for. sync-sessions.py pulls transcripts directly from OpenClaw's own JSONL files — it doesn't rely on the agent doing anything. And auto-checkpoint.py captures message snippets on schedule with zero API calls. Nothing is lost even when the agent is uncooperative.

What if I have a technical issue?

Email support@autoglia.com for private support, or ask in GitHub Discussions so others can benefit.

Does my data ever leave my machine?

Never automatically. The database is a single SQLite file at ~/memory.db. No cloud, no API calls for storage, no third-party servers. Autoglia is entirely local. You control when data moves — if you ask your agent to email you a backup, it does exactly that using your own mail setup, and only when you ask.

How do I back up or move my database to a new machine?

Just ask your agent: "Back up my database" or "Email me my memory backup." It runs export.py --backup using SQLite's built-in backup API — safe while the DB is open — and optionally emails you the file. To restore on a new machine: install Autoglia, run migrate.py to create the schema, then python3 export.py --restore memory-backup-YYYY-MM-DD.db --force. Your entire history is back instantly.

Can I extend the schema with my own tables?

Yes. Use memdb.py create-table to add extension tables. Every custom table is logged in _schema_log with the reason and session that created it — so there's a full audit trail and upgrades never accidentally drop your custom tables.

Having trouble installing? See the Installation FAQ & troubleshooting guide →