Import a Markdown memory corpus
Build a derived Heartwood store from a folder of Markdown memory files while keeping Markdown as the human-readable source of truth.
Import
Point the importer at one or more memory folders. Tenants come from frontmatter or a caller-supplied map; every record is written through Heartwood.remember(), so it gets the full policy envelope, provenance signature, source-span hashes, audit events, and tenant-scoped storage.
python -m pip install "heartwood-memory[recall,mcp]"
python -m heartwood.cli import-markdown `
C:\path\to\workspace\memory `
C:\path\to\workspace\team-memory `
--db .\heartwood.db `
--tenant-map-json '{"acme":"tenant:acme-payments","northwind":"tenant:northwind-retail"}' `
--output .\heartwood-import-report.jsonHow fields are inferred
Explicit frontmatter wins; caller-supplied maps are the fallback; otherwise a generic fallback tenant is used. Filename prefixes map to epistemic class by default and can be overridden with --prefix-epistemic-map-json.
• tenant: / tenant_id: → tenant, normalized to tenant:<slug> • feedback_*.md → epistemic=user-stated • reference_*.md → kind=source, epistemic=imported-source • project_*.md → epistemic=observed-fact • filename contains "hypothesis" → epistemic=hypothesis • no tenant match → tenant:ops (or --default-tenant)
Supported frontmatter
---
tenant: northwind-retail
classification: confidential
pii: false
roles: [finance]
attrs: [region=us]
subject: northwind-retail:auth
kind: source
epistemic: imported-source
created_by: owner:operator
confidence: 0.95
salience: 0.8
valid_from: 2026-06-01
---Idempotent & secret-aware
Memory ids are stable for (tenant, relative path, content hash), so re-running an import skips already-imported records. If a filename or metadata contains secret-like hints (password, secret, api_key, token, credential), the importer forces classification=restricted and pii=true. Store credentials as pointers to vault records — never as Markdown body content.
Adapted from docs/integrations/markdown-import.md in the open-source core.