AI agents forget everything between sessions. SecondCortex gives them a structured, self-maintaining memory system — automatic capture, semantic extraction, vector search — all running locally, all free.
Every new session wipes the slate clean. Hard-won insights, debugging lessons, architectural decisions — all gone. You repeat yourself; they repeat mistakes.
You manually write MEMORY.md files that grow into dumping grounds. No structure, no retrieval, no consolidation. Just a growing pile of text.
Important facts get buried in daily logs. Procedures you figured out yesterday? Gone. Bug fixes? Buried. Decisions? Scattered across 50 files.
Hook intercepts every message. 21 regex patterns + LLM triple extraction. Zero effort required.
Queue flushes to daily log. Insights tagged. Triples structured. Ready for consolidation.
Three-phase sleep: Light scans recent logs, REM finds patterns, Deep promotes high-signal insights.
Logs → atomic vault notes → MOC links. Procedures extracted. MEMORY.md stays lean.
Hybrid search: FTS5 keywords + vector cosine similarity, merged via Reciprocal Rank Fusion.
Every conversation is analyzed by Gemini Flash for structured knowledge extraction. Not just keyword matching — real semantic understanding that produces (subject, relation, object) triples with confidence scores and auto-categorization.
1,050 chunks embedded with Gemini Embedding-001 (3072 dims). Hybrid RRF search merges FTS5 keyword results with cosine similarity for semantic recall.
Regex patterns catch explicit markers ("remember this:", "root cause was") and implicit insights ("gotcha:", "the issue is"). Zero configuration needed.
Auto-extracts multi-step procedures from conversations. "How to deploy FastAPI" becomes a reusable checklist with prerequisites, steps, and confidence scores.
Three-phase overnight consolidation: Light scans recent logs, REM identifies cross-topic patterns, Deep promotes high-signal insights to vault notes. Your agent dreams so you don't have to curate.
SecondCortex is the only agent memory system that runs fully local, costs nothing, and requires no database. Here's how it stacks up.
| Feature | SecondCortex | Letta/MemGPT | Mem0 | Plain MEMORY.md |
|---|---|---|---|---|
| Auto-Capture | ✓ Regex + LLM | Agent-managed | ✓ Auto-extract | ✗ Manual |
| Vector Search | ✓ Hybrid RRF | ✓ Archival mem | ✓ + Graph | ✗ FTS5 only |
| Semantic Extraction | ✓ Triple (SPO) | ✗ Agent writes | ✓ Entity graph | ✗ |
| Procedural Memory | ✓ Auto-extract | ✗ | ✗ | ✗ Manual |
| Dreaming | ✓ 3-phase | ✗ | ✗ | ✗ |
| Weekly Consolidation | ✓ Auto | ✗ Manual | ✓ Managed | ✗ Manual |
| Storage Format | Markdown + SQLite | Postgres + Vec DB | Managed cloud DB | Markdown only |
| Monthly Cost | $0 | $0 (self-host) | $0–$449/mo | $0 |
| External Dependencies | 0 | Postgres, Docker | Cloud service | 0 |
| Data Sovereignty | ✓ Full local | ✓ Self-hosted | ✗ Cloud | ✓ Full local |
| Framework | OpenClaw | Standalone | API / SDK | Any |
Measured against a real agent workspace: 49 vault notes, 15 daily logs, 1,050 embedded chunks. Same tasks, same knowledge — radically different context sizes.
Free. Local. No database required. Runs on any OpenClaw agent.