Skip to content
Lossless · Local-first · Apache-2.0

# Long-term memory
for your agents.

Your agents forget everything between sessions, and their history is scattered across tools you can't search. Moraine keeps the complete trace of every session — exactly what happened, not a summary — and makes it searchable, so agents can recall everything they've ever done. It all stays on your machine.

$ `uv tool install moraine-cli`
Get started
View on GitHub
Apache-2.0 100% local No account, no cloud
moraine.events recent sessions
codex Refactor ingest dispatch & routing 2.1k turns
claude Wire central MCP socket proxy 880 turns
cursor cursor_sqlite chat backfill 1.4k turns
hermes Replay-floor race investigation 310 turns
kimi Per-project backend routing 640 turns
↑ newest core sample oldest ↓
mo·raine /məˈreɪn/ noun, geology

the ridge of rock and sediment a glacier deposits as it moves and melts away.

Your agents are the glacier. Moraine is the record they leave behind.

Lossless by construction

## Markdown memory forgets.
The traces are the truth.

Every other "agent memory" asks the model to write down what it thinks mattered. That push model is lossy by definition — it editorializes, compresses, and the instant the note is written the real detail is gone. Moraine never summarizes. It records the complete session trace and lets agents pull from it — you read what actually happened, not a story about it.

Push memory · lossy

### The agent writes notes.

memory.md~ the agent's guess
# what I remember
- fixed the socket thing (i think)
- routing changed — ask the user later
- use the old config path
- TODO: write this up properly
- …
- …

↳ only what the agent chose to keep — the rest is gone.

A summary chosen in the moment: editorialized, partial, and stale the instant it's written. What it left out, you can never get back.

vs
Moraine · lossless

### Moraine keeps the trace.

session 7f3a · codex verbatim
14:02 user"the socket routing looks wrong…"
14:02 tool grep -r mcp.sock crates/
14:03 asst patch central proxy → log to stderr
14:05 tool cargo test → 142 passed ✓
14:06 asst"central socket at ~/.moraine/run/…"

↳ every turn, tool call & token — recorded, queryable.

The raw record of what actually happened. Agents pull from ground truth — and you can always re-read the exact session, byte for byte.

What you get

## One unified record of everything your agents did.

Conversation turns, tool calls, token counts and timestamps from every harness, in one consistent schema you can browse, query, and search.

For anyone who runs agents all day — across more than one tool.

### Query the raw record

Turns, tool calls, tokens and timing land in one open schema. Point your own SQL, dashboards or notebooks at `moraine.events` — no lock-in, no black box.

### Realtime ingest + backfill

Watches Codex, Claude Code, Cursor, Kimi, Hermes and Pi session files live, and indexes your entire existing history on first run.

### Monitor UI

Browse sessions, inspect live analytics, and check ingest health at `127.0.0.1:8080` — token, turn and concurrency charts included.

### Recall for your agents

Agents search their own past decisions, fixes and errors on demand — the whole record, exposed as tools they already know how to call.

### Cross-provider search

One keyword search spans every harness at once. Find that decision, fix or error wherever it happened — whichever agent did the work.

### Fully local by default

Runtime state lives under `~/.moraine`. Nothing leaves your machine unless you point Moraine at remote infrastructure.

How it works

## From scattered session files to one searchable history.

~/.codex/sessions/…jsonl +5
Sources Your sessions
Every harness you run — watched live and backfilled on first start.
then
turn · tool · result
Capture The complete trace
Every turn, tool call and result, recorded verbatim — not summarized.
then
moraine.events
Store One local record
A fast local store, keyword-indexed so anything is instantly searchable.
then
search · open · list
Recall Browse & retrieve
See the whole fleet in the monitor; agents pull what they need on demand.
Supported harnesses

## Six harnesses. One trace stack.

Moraine ships ingestion adapters for the agent tools you already use — every source runs live and backfills on first start, enabled by default.

CX
Codex
codex live + backfill
CC
Claude Code
claude-code live + backfill
KI
Kimi CLI
kimi-cli live + backfill
CU
Cursor
cursor · cursor_sqlite
HE
Hermes
hermes live + backfill
PI
Pi Coding Agent
pi-coding-agent live + backfill
zsh — agent memory
$ codex exec "what did we decide about MCP socket routing?"
# agent calls moraine.search_sessions …
→ found 3 sessions across claude-code, codex
· central MCP socket at ~/.moraine/run/mcp.sock
· per-session proxy, default on (PR #375)
· stdio-server logs must go to stderr
✓ answered from your own history — no re-litigating.
Agent MCP search

## Give every agent recall of every session.

Add a few lines to your harness instructions and your agents stop asking you what already happened. They search the record themselves — across providers, in realtime.

- `list_sessions` Enumerate recent and active sessions, any harness.
- `search_sessions` Keyword search over the full trace history.
- `open` Pull a specific session's turns, tools and context.

Read the MCP guide
Monitor

## Watch your whole agent fleet, live.

Generation tokens per model, turns per model, concurrent sessions, and a searchable session list — updating in realtime at `127.0.0.1:8080`.

127.0.0.1:8080
Get started

## Install and run in three commands.

Stand up your local trace stack, then point your agents at their own memory.

1 uv tool install moraine-cli
2 moraine up
3 moraine status

Then add the search guidance to your harness — your agents do the rest.

Quickstart & install
Configuration