Skip to content
Palimem Docsspec v1.7.0

Export & import

Palimem provides operator tools for exporting memory (for review or compliance) and importing from Markdown files (for seeding or migration).


The memory_review tool (MCP) and ai-memory review export operator CLI generate a human-readable review report of current memory state:

Terminal window
node app/scripts/ai-memory.js review export \
--data-dir .ai-memory/data \
--output .ai-memory/review.md

This writes a Markdown file with all current facts, beliefs, and preferences grouped by scope and namespace.

# Memory review — my-project (repository scope)
Generated: 2026-06-25T12:00:00Z
## auth
- provider: OAuth2 (fact, seq 42)
- expiry: 3600s (fact, seq 43)
## deploy
- region: us-east-1 (fact, seq 51)
- service: ECS Fargate (fact, seq 52)

memory_audit_export produces a compliance-ready structured export of the full WAL, with provenance metadata:

{
"tool": "memory_audit_export",
"scope": "repository",
"namespace": "my-project",
"from": "2026-01-01T00:00:00Z",
"to": "2026-06-30T23:59:59Z"
}

The export includes:

  • All WAL events (remember, supersede, retract)
  • Provenance: source, tool, actor, request_id
  • Timestamps and sequence numbers
  • Legal hold flags

Use audit export for:

  • Compliance reviews (“what did the agent know and when?”)
  • Debugging unexpected recall behavior
  • Handoff to a new environment

Seed memory from Markdown files using import_markdown.py. This is the standard path for:

  • Migrating from file-based memory systems
  • Pre-loading user profile and project conventions
  • Seeding from MEMORY.md or USER.md files
Terminal window
python3 app/import_markdown.py \
--data-dir .ai-memory/data \
examples/markdown/USER.md.sample \
examples/markdown/MEMORY.md.sample

The repository ships sample Markdown files:

File Purpose
examples/markdown/USER.md.sample User preferences and profile facts
examples/markdown/MEMORY.md.sample Project memory conventions

Copy and edit these samples for your project, then import.


Consolidation deduplicates redundant units and summarizes low-salience noise clusters. It produces proposals that must be reviewed before becoming current facts.

  1. Run dry-run to see proposals

    Terminal window
    node app/scripts/ai-memory.js consolidate \
    --data-dir .ai-memory/data \
    --dry-run
  2. Export review report

    Terminal window
    node app/scripts/ai-memory.js review export \
    --data-dir .ai-memory/data \
    --output .ai-memory/review.md
  3. Accept proposals (MCP tool or operator CLI)

    Terminal window
    node app/scripts/ai-memory.js consolidate \
    --data-dir .ai-memory/data \
    --export-review .ai-memory/review.md

Consolidation never removes facts under legal hold or current semantic units. It is reversible — the WAL is unchanged.


Run consolidation on a schedule from a shell script:

Terminal window
# Run every night
bash examples/claude-code/demo/run-consolidation-cron.sh

Or call directly:

Terminal window
node app/scripts/ai-memory.js consolidate \
--data-dir .ai-memory/data \
--export-review .ai-memory/review.md

After editing a review Markdown file, re-import accepted changes:

Terminal window
python3 app/import_markdown.py \
--data-dir .ai-memory/data \
.ai-memory/review.md

Use as_of on memory_get and memory_search to query historical state:

{
"tool": "memory_get",
"scope": "repository",
"namespace": "my-project",
"topic": "auth",
"field": "provider",
"memory_type": "fact",
"as_of": "2026-01-15T09:00:00Z"
}