Skip to content

docs(ai-memory): MemPalace → MIF Level-1 mapping + examples#65

Closed
perlowja wants to merge 3 commits into
modeled-information-format:develop/v1.0.0from
perlowja:feat/mempalace-level1
Closed

docs(ai-memory): MemPalace → MIF Level-1 mapping + examples#65
perlowja wants to merge 3 commits into
modeled-information-format:develop/v1.0.0from
perlowja:feat/mempalace-level1

Conversation

@perlowja

Copy link
Copy Markdown

Per the discussion in #60 — here is the Level-1 first step of the MemPalace → MIF AI-Memory mapping (OKF-valid + cognitive-triad typing), against develop/v1.0.0.

What's here

  • profiles/ai-memory/MEMPALACE-MAPPING.md — the draft field mapping (open for your feedback).
  • examples/mempalace-observation.md — a MemPalace entitysemantic observation, with a KG triple rendered as a typed MIF relationship.
  • examples/mempalace-session.md — a MemPalace drawerepisodic session.

Mapping at a glance

MemPalace MIF type Rationale
entity (person/project/topic) semantic (observation) decontextualized, stably-true world knowledge
drawer (filed_at/source/added_by) episodic (session) time-anchored record of a lived event
procedural (skill) declared gap — no native MemPalace construct
  • Triples: entity-object → typed relationships[] (predicate→type, object→target path, confidence→strength); literal-object → body ## Properties table (surfaces the absence of a first-class scalar-properties construct — flagged).
  • IDs: UUIDv5 derived from the MemPalace id under a fixed MemPalace namespace UUID (deterministic across re-exports).
  • Deferred: bitemporal valid_from/valid_toLevel-3 version-DAG sidecar (deliberately not folded into created/modified); trust tiers → L2; compression manifest → L3.

Validation

python scripts/okf_validate.py profiles/ai-memory/examples   # PASS (6 concepts)
python scripts/mif_convert.py roundtrip profiles/ai-memory/examples   # lossless PASS

Opened as draft since the mapping is the discussion basis you asked for in #60. Happy to adjust the triad assignment, namespacing, or the literal-object handling before we layer up to L2/L3 (and I'll follow with the bidirectional converter + the edge-case test vectors from the MNEMOS portability review). Related #60.

Add a draft MemPalace -> MIF AI-Memory profile mapping at Level 1 (OKF-valid +
cognitive-triad typing), with two worked example concepts:

- mempalace-observation.md: a MemPalace entity -> semantic observation, with a
  knowledge-graph triple rendered as a typed MIF relationship.
- mempalace-session.md: a MemPalace drawer -> episodic session (filed_at ->
  created; wing/room -> namespace path).

MEMPALACE-MAPPING.md documents the structure/field mapping, the triple ->
relationship rules (entity-object vs literal-object), the UUIDv5 id derivation,
and what is deferred to Levels 2/3 (bitemporal validity -> version-DAG sidecar,
trust tiers, compression manifest).

Both examples pass scripts/okf_validate.py and the scripts/mif_convert.py
roundtrip lossless check.

Related modeled-information-format#60.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a first-pass (Level-1 / OKF-valid) documentation mapping from MemPalace’s model (entities, drawers, triples) into the MIF AI-memory profile, plus two worked .md concept examples intended to ground discussion from #60.

Changes:

  • Added a draft MemPalace → MIF Level-1 field/structure mapping reference.
  • Added an episodic “drawer → session” example concept.
  • Added a semantic “entity → observation” example concept with a relationship + mirrored body link.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
profiles/ai-memory/MEMPALACE-MAPPING.md Draft mapping reference for MemPalace constructs/fields to MIF AI-memory Level-1.
profiles/ai-memory/examples/mempalace-session.md Example Level-1 episodic session concept derived from a MemPalace drawer.
profiles/ai-memory/examples/mempalace-observation.md Example Level-1 semantic observation concept with a relationship and body sync.

Comment on lines +18 to +22
Derived from a MemPalace **entity** (`name: "Alice Chen"`, `type: person`) and the
knowledge-graph **triple** `Alice Chen — works-on — Project Phoenix`. A MemPalace
entity is decontextualized, stably-true world knowledge, so it maps to the
cognitive-triad `semantic` type (the AI-memory `observation` reinterpretation).
The triple is rendered as a typed MIF relationship to the concept it references.
Comment on lines +17 to +22
Derived from a MemPalace **drawer** (wing `Project Phoenix`, room `Incidents`,
`filed_at: 2026-01-15T10:30:00Z`, `source: chat`, `added_by: agent`). A drawer is
a time-anchored record of something the agent lived through, so it maps to the
cognitive-triad `episodic` type (the AI-memory `session` reinterpretation): the
drawer's `filed_at` becomes `created`, and its wing/room become the
`_episodic/sessions` namespace path.
Comment on lines +65 to +69
See [`examples/mempalace-observation.md`](examples/mempalace-observation.md)
(entity → `semantic` observation, with a triple rendered as a `derived-from`
relationship) and [`examples/mempalace-session.md`](examples/mempalace-session.md)
(drawer → `episodic` session). Both pass `scripts/okf_validate.py` and the
`scripts/mif_convert.py roundtrip` lossless check.

@zircote zircote left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review of PR #65 surfaced three problems the existing validators could not
catch, because okf_validate and mif_convert verify structure and lossless
round-trip rather than semantics. PR #79 (now merged into develop/v1.0.0) adds
the tooling to detect two of them and implements the third. Recommendations
follow each item.

1. Temporal inconsistency (fixed in develop/v1.0.0)

examples/mempalace-observation.md declares itself derived-from a session
whose created timestamp falls roughly ten months in its future. A derivation
cannot precede its source.

okf_validate now enforces that a derived-from, supersedes or cites target
is never created after the concept that derives from it.

  • The check emits a warning by default and does not block. The --strict-temporal
    flag promotes the warning to a continuous integration (CI) failure once a
    corpus is known clean.
  • Impact: zero false positives across the four canonical examples. Edges whose
    target does not resolve, escapes the bundle, or whose created value is absent
    or unparseable, are skipped.

2. The Section 4 triple-to-relationship rule is unimplemented (for the #65 author to decide)

The example carries a single relationship, derived-from to the session, rather
than the works-on to Project Phoenix triple that Section 4 prescribes.
Section 4 and Section 6 also disagree (Section 6 describes the triple as a
derived-from relationship).

This is the one open item, and it sits in PR #65, not in the merged tooling. PR
#65 is not mine to edit, so I raise it here as a recommendation for its author.
Either correction resolves it:

  • (a) reconcile the Section 4 and Section 6 wording, or
  • (b) add the works-on edge to the example, pointing at a Project Phoenix
    concept.

The merged validators do not modify PR #65.

3. Scalar-properties gap (implemented in develop/v1.0.0)

Literal-object triples had no first-class representation and relied on a body
## Properties table. develop/v1.0.0 now provides a first-class scalar
properties field (values constrained to string, number, boolean or null) in
both the schema and the converter, lossless in each direction.

  • Impact: the change is additive and backward compatible. It supersedes the
    body-table workaround documented in MEMPALACE-MAPPING.md.
  • Follow-up: add a SPECIFICATION.md section that documents properties.

All conversions remain lossless. The full chain (Modeled Information Format to
Open Knowledge Format projection to Modeled Information Format to JSON
serialization and back) is now covered by a regression test that enumerates every
top-level schema field and asserts none is dropped or clobbered. That test also
recovered two pre-existing lossless gaps (compressedAt and memoryType), which
are fixed in the same merge.

@zircote zircote modified the milestones: release/v1, release/v1.1, v1.2.0 Jun 28, 2026
@zircote zircote deleted the branch modeled-information-format:develop/v1.0.0 June 28, 2026 08:59
@zircote zircote closed this Jun 28, 2026
@zircote

zircote commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

@perlowja please reopen to main now that it is stable

@perlowja

perlowja commented Jul 3, 2026

Copy link
Copy Markdown
Author

Reopened as #206 against main (same develop/v1.0.0-deleted lock as #78). Same branch rebased clean onto main. One accuracy fix while rebasing: the mapping note for literal-object triples originally flagged the absence of a first-class scalar-properties construct — v1.0.0's #79 added exactly that field, so #206 now maps literals to the scalar properties field instead of the body ## Properties fallback, keeping the mapping consistent with current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants