Skip to main content

Overview

MeepaGateway agents wake up fresh each session — no conversation history carries over automatically. Memory bridges the gap. There are three layers, each serving a different purpose: The agent’s persona lives separately in SOUL.md, managed by the soul tools. All files live in the agent workspace at ~/.meepagateway/agents/{agent_id}/.

Agent Workspace Layout

At the start of every session the agent is instructed (via the auto-generated AGENTS.md) to read SOUL.md, USER.md, and MEMORY.md before doing anything else.

SOUL.md

SOUL.md is the agent’s persistent persona — who it is, how it behaves, and what it knows about itself. It is loaded on every session start and injected as part of the system prompt. The agent can read and edit it at runtime using soul_read and soul_edit.

Example SOUL.md

To edit via CLI:

MEMORY.md and USER.md

These are plain markdown files the agent writes to itself using memory_note. They persist across sessions.
  • MEMORY.md — General long-term notes: project decisions, recurring topics, things to remember
  • USER.md — User-specific profile: preferences, name, timezone, communication style
The agent reads them with memory_read, specifying the target file.

Example MEMORY.md

Example USER.md


Fact Store (SQLite)

The fact store holds structured facts with full-text search (FTS5) and optional vector embeddings for semantic similarity.

Schema

Facts are retrieved by:
  • Full-text search — FTS5 MATCH query with automatic tokenization
  • Vector similarity — cosine similarity against stored embeddings (when embeddings are present)

Compaction

When the fact count exceeds auto_compact_threshold, older facts that haven’t been accessed recently are pruned automatically.

Memory Tools

All memory tools are available to the LLM during the agent loop. They are registered automatically — no configuration required.

memory_store

Store a fact in the SQLite fact store.
Search the fact store by text query using FTS5.
Returns a ranked list of matching facts with their IDs, content, source, and timestamps.

memory_delete

Delete a fact by ID.

memory_note

Append a note to MEMORY.md or USER.md.

memory_read

Read the full contents of MEMORY.md or USER.md.

Soul Tools

soul_read

Read the current SOUL.md content.

soul_edit

Replace the entire SOUL.md content. The agent can use this to update its own persona.
soul_edit replaces the entire file. The agent should call soul_read first, then make targeted edits to the content before writing it back.

Configuration

Memory configuration is derived automatically from the agent workspace path. The optional auto_compact_threshold controls when old facts are pruned:
Advanced (rarely needed):

CLI Management

Facts and notes are managed by the agent itself at runtime using its tools, or via the Captain Dashboard.