Export & import
Palimem provides operator tools for exporting memory (for review or compliance) and importing from Markdown files (for seeding or migration).
Export for review
Section titled “Export for review”The memory_review tool (MCP) and ai-memory review export operator CLI generate a human-readable review report of current memory state:
node app/scripts/ai-memory.js review export \ --data-dir .ai-memory/data \ --output .ai-memory/review.mdThis writes a Markdown file with all current facts, beliefs, and preferences grouped by scope and namespace.
{ "tool": "memory_review", "scope": "repository", "namespace": "my-project", "action": "export"}Review report format
Section titled “Review report format”# 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)Audit export (compliance)
Section titled “Audit export (compliance)”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
Import from Markdown
Section titled “Import from Markdown”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.mdorUSER.mdfiles
python3 app/import_markdown.py \ --data-dir .ai-memory/data \ examples/markdown/USER.md.sample \ examples/markdown/MEMORY.md.sampleSample files
Section titled “Sample files”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
Section titled “Consolidation”Consolidation deduplicates redundant units and summarizes low-salience noise clusters. It produces proposals that must be reviewed before becoming current facts.
-
Run dry-run to see proposals
Terminal window node app/scripts/ai-memory.js consolidate \--data-dir .ai-memory/data \--dry-run -
Export review report
Terminal window node app/scripts/ai-memory.js review export \--data-dir .ai-memory/data \--output .ai-memory/review.md -
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.
Cron-friendly consolidation
Section titled “Cron-friendly consolidation”Run consolidation on a schedule from a shell script:
# Run every nightbash examples/claude-code/demo/run-consolidation-cron.shOr call directly:
node app/scripts/ai-memory.js consolidate \ --data-dir .ai-memory/data \ --export-review .ai-memory/review.mdImport from review export
Section titled “Import from review export”After editing a review Markdown file, re-import accepted changes:
python3 app/import_markdown.py \ --data-dir .ai-memory/data \ .ai-memory/review.mdPoint-in-time recall
Section titled “Point-in-time recall”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"}Next steps
Section titled “Next steps”- Governance — retention, PII policy, and legal hold
- Supersession & audit — how the immutable WAL enables point-in-time recall
- MCP tools reference — full arguments for
memory_review,memory_consolidate,memory_audit_export