You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P2 — implement after the interchange contract and verified clone workflow are stable. It may run after or alongside the embedding-boundary work, but must not delay P0/P1 delivery.
Goal
Define a lean, forward-compatible annotation envelope so a HotMem company brain can transport entity aliases, relationships, and other externally produced enrichment without HotMem becoming an entity-extraction or knowledge-graph engine.
HotMem's job is preservation, validation, provenance, deterministic merge, and lossless movement.
Unknown future annotation namespaces are preserved losslessly.
Every annotation can identify its producer, schema/version, timestamp, confidence, and source memory/evidence when supplied.
HotMem performs no mandatory LLM call and adds no production dependency.
Existing records and clients remain valid without annotations.
Format contract
Use one reserved, versioned envelope rather than new database columns for every enrichment type. Prefer the existing JSON metadata storage unless implementation evidence shows that lossless round-trip cannot be guaranteed there.
The final field placement and exact names may differ, but the following are mandatory:
namespaced ownership;
schema version;
stable item identity where an annotation type supports it;
producer/extraction provenance;
optional confidence;
optional evidence references;
preservation of unknown keys.
Validation rules
Validate envelope structure, JSON types, namespace syntax, version, finite confidence in [0, 1], and local evidence references when present.
Distinguish malformed from unknown: malformed known structure fails clearly; unknown namespaces/fields are preserved.
Set explicit size and nesting limits to prevent pathological metadata from exhausting memory. Limits must be documented and return actionable errors.
Never interpret an extracted entity or relationship as verified truth.
Never fetch evidence URIs during validation.
Never execute or import producer-supplied code.
Deterministic merge and replay
Specify and test:
byte/logical canonicalization rules;
duplicate annotation identity handling;
same-ID/same-content replay as a no-op;
same-ID/different-content as an explicit conflict;
ordering rules for deterministic snapshot output;
preservation of source and transfer provenance;
behavior when the receiving runtime does not understand a namespace.
No silent last-write-wins behavior.
Query behavior
This ticket may provide exact filtering by namespace, annotation ID, entity name, or alias only if it can reuse SQLite/FTS5 without new required dependencies.
Do not add semantic entity resolution, graph traversal, automatic alias inference, or ranking-weight changes. Preservation and portability are the acceptance boundary.
Import/export interoperability
Provide synthetic mapping fixtures showing how an external enrichment source could map:
entity and alias annotations;
typed relationships;
producer/model/version metadata;
confidence and evidence references.
Fixtures must not depend on Mem0, Hindsight, or any remote service at test time and must not claim full vendor-format compatibility.
Tests
Legacy records without annotations remain unchanged.
Known annotations validate and round-trip.
Unknown namespace and fields survive byte-equivalent logical round-trip.
Malformed confidence, excessive depth/size, and invalid references fail safely.
Duplicate replay is idempotent.
Conflicting same-ID annotations are reported and neither version is silently lost.
Snapshot -> verify -> hydrate preserves the envelope.
Priority
P2 — implement after the interchange contract and verified clone workflow are stable. It may run after or alongside the embedding-boundary work, but must not delay P0/P1 delivery.
Goal
Define a lean, forward-compatible annotation envelope so a HotMem company brain can transport entity aliases, relationships, and other externally produced enrichment without HotMem becoming an entity-extraction or knowledge-graph engine.
HotMem's job is preservation, validation, provenance, deterministic merge, and lossless movement.
Required outcome
Format contract
Use one reserved, versioned envelope rather than new database columns for every enrichment type. Prefer the existing JSON metadata storage unless implementation evidence shows that lossless round-trip cannot be guaranteed there.
The logical shape must support:
{ "annotations": { "schema_version": 1, "namespaces": { "org.hotmem.entities": { "items": [ { "id": "entity:acme", "type": "organization", "name": "Acme GmbH", "aliases": ["Acme"], "confidence": 0.98, "evidence": ["memory-id"] } ] } }, "producers": { "external-enricher": { "version": "1.0", "created_at": "..." } } } }The final field placement and exact names may differ, but the following are mandatory:
Validation rules
[0, 1], and local evidence references when present.Deterministic merge and replay
Specify and test:
No silent last-write-wins behavior.
Query behavior
This ticket may provide exact filtering by namespace, annotation ID, entity name, or alias only if it can reuse SQLite/FTS5 without new required dependencies.
Do not add semantic entity resolution, graph traversal, automatic alias inference, or ranking-weight changes. Preservation and portability are the acceptance boundary.
Import/export interoperability
Provide synthetic mapping fixtures showing how an external enrichment source could map:
Fixtures must not depend on Mem0, Hindsight, or any remote service at test time and must not claim full vendor-format compatibility.
Tests
Performance and lean-core constraints
Explicitly out of scope
Definition of done
Dependencies