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
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
MEMORY.md and USER.md
These are plain markdown files the agent writes to itself usingmemory_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
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
- Full-text search — FTS5
MATCHquery with automatic tokenization - Vector similarity — cosine similarity against stored embeddings (when embeddings are present)
Compaction
When the fact count exceedsauto_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.
memory_search
Search the fact store by text query using FTS5.
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.
Configuration
Memory configuration is derived automatically from the agent workspace path. The optionalauto_compact_threshold controls when old facts are pruned:
