v0.3 — Free & Local

Memory
that evolves.

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.

Get Started See How It Works
1,050
Chunks Embedded
3072
Embedding Dims
$0
Monthly Cost
0
External Deps
// The Problem

Agents start
every session from zero.

01
🧠

Amnesia Loop

Every new session wipes the slate clean. Hard-won insights, debugging lessons, architectural decisions — all gone. You repeat yourself; they repeat mistakes.

02
📝

Manual Memory

You manually write MEMORY.md files that grow into dumping grounds. No structure, no retrieval, no consolidation. Just a growing pile of text.

03
🔍

Lost Knowledge

Important facts get buried in daily logs. Procedures you figured out yesterday? Gone. Bug fixes? Buried. Decisions? Scattered across 50 files.

// The Pipeline

From conversation
to knowledge graph.

real-time

Capture

Hook intercepts every message. 21 regex patterns + LLM triple extraction. Zero effort required.

session end
📋

Distill

Queue flushes to daily log. Insights tagged. Triples structured. Ready for consolidation.

nightly
🌙

Dream

Three-phase sleep: Light scans recent logs, REM finds patterns, Deep promotes high-signal insights.

weekly
🏗️

Consolidate

Logs → atomic vault notes → MOC links. Procedures extracted. MEMORY.md stays lean.

anytime
🔎

Retrieve

Hybrid search: FTS5 keywords + vector cosine similarity, merged via Reciprocal Rank Fusion.

// Features

Built for local-first
AI agents.

v0.3 NEW

LLM Triple Extraction

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.

v0.3 NEW

Vector Search

1,050 chunks embedded with Gemini Embedding-001 (3072 dims). Hybrid RRF search merges FTS5 keyword results with cosine similarity for semantic recall.

core

21 Saliency Patterns

Regex patterns catch explicit markers ("remember this:", "root cause was") and implicit insights ("gotcha:", "the issue is"). Zero configuration needed.

v0.3 NEW

Procedural Memory

Auto-extracts multi-step procedures from conversations. "How to deploy FastAPI" becomes a reusable checklist with prerequisites, steps, and confidence scores.

core

Dreaming Engine

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.

// Try It

Search your memory.

secondcortex — hybrid search
$ node embed.mjs search "nginx prefix match root cause"

🔍 Searching for: "nginx prefix match root cause"

[hybrid] memory/2026-05-10.md (RRF: 0.0825)
Root Causes Found: WA status always "unknown" — bot never wrote...

[hybrid] vault/Atlas/Notes/nginx.md (RRF: 0.0159)
nginx is a high-performance reverse proxy — ^~ prefix ensures...

$ node extract-procedures.mjs --days=7

[procedural] Scanning last 7 days of logs...
[procedural] Found 3 procedure(s) in 2026-05-10
Created: fix-mba-warung-dashboard-502-bad-gateway.md (4 steps)
Created: migrate-mba-warung-services-from-systemd-to-pm2.md (4 steps)
✅ Done! 8 procedures found, 8 vault notes created
📄
Plain Markdown
🗂️
SQLite
🔍
FTS5
🧠
Gemini Flash
📐
Embedding-001
🔗
Zettelkasten
OpenClaw
🔒
Local-First
// Comparison

How it compares.

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
// Benchmark

Real token savings.

Measured against a real agent workspace: 49 vault notes, 15 daily logs, 1,050 embedded chunks. Same tasks, same knowledge — radically different context sizes.

Without SecondCortex
~160K
tokens per query
Fat MEMORY.md (9.2KB) + all 49 vault notes + all 15 daily logs loaded into context because you can't find the right one.
With SecondCortex
~3K
tokens per query
Trimmed MEMORY.md (4.5KB) + top 3 relevant chunks from hybrid search. Same answer, 98% less tokens.
Token Reduction
98%
Cost Savings (GPT-4o)
98%
Monthly Cost
$0
Test Methodology
Corpus: 49 vault notes (92KB) + 15 daily logs (437KB) + MEMORY.md, embedded as 1,050 chunks (Gemini Embedding-001, 3072 dims).
Without: Agent loads full MEMORY.md (9.2KB with promotion blocks) + scans all vault notes for relevant info → ~529KB context per query.
With: Trimmed MEMORY.md (4.5KB, pointers only) + hybrid RRF search returns top 3 relevant chunks → ~8-12KB context per query.
Scenarios tested: "Fix nginx 502 bad gateway", "Set up Midtrans payment webhook", "Deploy FastAPI service to VPS". All showed 96-98% token reduction.

Stop repeating.
Start remembering.

Free. Local. No database required. Runs on any OpenClaw agent.

View on GitHub Back to CORTEX