FLOW ALGEBRA
Ontology: AI Memory Metadata Ontology
Domain: Metadata Ontologies > AI Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/ai-metadata/ai-memory-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "AIMemoryMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: AIMetadata
subject: AIMemoryMetadata
purpose:
- represent metadata describing memory used by artificial intelligence systems
- preserve memory identity, source, type, content reference, lifecycle, relevance, and provenance
- support memory retrieval, validation, update, expiry, consolidation, and reasoning
- distinguish inference-time memory from model parameters, training data, and retrieved external context
- enable machine-readable reasoning over persistent and transient AI memory states
# ---------- CORE ENTITY ----------
entity AIMemoryMetadata:
type: AIMetadata
describes: AIMemory
may_include:
- memory_identifier
- memory_type
- memory_scope
- memory_source
- content_reference
- semantic_summary
- embedding_reference
- creation_time
- last_access_time
- update_time
- expiry_time
- validity
- relevance
- importance
- confidence
- access_count
- retrieval_method
- consolidation_state
- provenance
- version
entity AIMemory:
type: ContextualKnowledgeResource
may_be:
- WorkingMemory
- ShortTermMemory
- LongTermMemory
- EpisodicMemory
- SemanticMemory
- ProceduralMemory
- ConversationMemory
- UserMemory
- AgentMemory
- ExternalMemory
entity MemoryIdentifier:
type: Identifier
identifies: AIMemory
# ---------- MEMORY TYPES ----------
memory_types:
- working
- short_term
- long_term
- episodic
- semantic
- procedural
- conversational
- user_specific
- agent_specific
- external
# ---------- RELATIONSHIPS ----------
relationships:
AIMemoryMetadata -> DESCRIBES -> AIMemory
AIMemory -> IDENTIFIED_BY -> MemoryIdentifier
AIMemory -> HAS_TYPE -> MemoryType
AIMemory -> HAS_SCOPE -> MemoryScope
AIMemory -> HAS_SOURCE -> MemorySource
AIMemory -> MAY_REFERENCE_CONTENT -> MemoryContent
AIMemory -> MAY_HAVE_EMBEDDING -> EmbeddingReference
AIMemory -> MAY_BE_RETRIEVED_BY -> MemoryRetrievalProcess
AIMemory -> MAY_BE_USED_BY -> InferenceProcess
AIMemory -> MAY_BE_DERIVED_FROM -> AIMemory
AIMemory -> MAY_HAVE_VERSION -> MemoryVersion
AIMemoryMetadata -> MAY_REFERENCE -> MemoryProvenance
# ---------- MEMORY IDENTITY ----------
rule memory_identity:
AIMemory SHOULD have stable MemoryIdentifier
where persistent update, retrieval, or provenance is required
rule memory_instance:
separate memory records SHOULD remain distinguishable
even when content is lexically identical
rule memory_not_model:
AIMemory != AIModel
AIMemory != ModelParameters
# ---------- MEMORY SCOPE ----------
entity MemoryScope:
type: ContextMetadata
may_be:
- current_turn
- conversation
- task
- user
- agent
- project
- domain
- global_system
rule scope:
AIMemory SHOULD define applicable MemoryScope
rule scope_boundary:
memory MUST NOT be applied outside declared scope
unless explicit promotion or transfer occurs
# ---------- MEMORY SOURCE ----------
memory_sources:
- user_input
- conversation
- observation
- tool_result
- retrieval
- external_data
- inference
- summarisation
- human_annotation
- system_process
rule source:
MemorySource SHOULD remain explicit
rule inferred_memory:
inferred memory MUST remain distinguishable
from directly supplied information
# ---------- MEMORY CONTENT ----------
entity MemoryContent:
type: InformationResource
may_be:
- text
- structured_data
- entity_reference
- relationship
- event
- preference
- task_state
- summary
- embedding_reference
rule content_reference:
memory MAY store content directly
OR stable reference to source content
rule source_preservation:
summarised or transformed memory SHOULD preserve source relationship
where available
# ---------- WORKING MEMORY ----------
entity WorkingMemory:
subtype_of: AIMemory
role: ActiveInferenceState
rule working_memory:
WorkingMemory is typically transient
and scoped to current reasoning or task state
rule working_not_long_term:
WorkingMemory != LongTermMemory
# ---------- SHORT-TERM MEMORY ----------
entity ShortTermMemory:
subtype_of: AIMemory
role: TemporarilyRetainedContext
rule short_term:
ShortTermMemory SHOULD have finite validity or retention policy
where lifecycle is managed
# ---------- LONG-TERM MEMORY ----------
entity LongTermMemory:
subtype_of: AIMemory
role: PersistentContextualKnowledge
rule long_term:
LongTermMemory SHOULD preserve:
- stable identity
- source
- update history
- validity
- provenance
# ---------- EPISODIC MEMORY ----------
entity EpisodicMemory:
subtype_of: AIMemory
describes: EventOrExperience
may_include:
- event
- participants
- time
- location
- context
rule episodic:
EpisodicMemory SHOULD preserve temporal context
# ---------- SEMANTIC MEMORY ----------
entity SemanticMemory:
subtype_of: AIMemory
describes:
- concept
- fact
- entity
- relationship
- generalised_knowledge
rule semantic:
SemanticMemory SHOULD preserve semantic identifiers
where available
rule semantic_not_fact:
stored semantic memory != verified fact
unless validation metadata supports verification
# ---------- PROCEDURAL MEMORY ----------
entity ProceduralMemory:
subtype_of: AIMemory
describes:
- procedure
- workflow
- strategy
- action_sequence
rule procedural:
ProceduralMemory SHOULD preserve ordered steps
where sequence matters
# ---------- CONVERSATION MEMORY ----------
entity ConversationMemory:
subtype_of: AIMemory
may_include:
- conversation_identifier
- message_reference
- summary
- participant_context
- task_state
rule conversation_memory:
conversation summary SHOULD remain distinguishable
from original messages
# ---------- MEMORY RETRIEVAL ----------
entity MemoryRetrievalProcess:
type: AIProcess
may_include:
- retrieval_identifier
- query
- retrieval_method
- candidate_memories
- ranking
- relevance_score
- selected_memories
- timestamp
retrieval_methods:
- exact_identifier
- keyword
- semantic_similarity
- embedding_similarity
- graph_traversal
- temporal_retrieval
- hybrid_retrieval
rule retrieval:
retrieved memory SHOULD preserve MemoryIdentifier and provenance
rule ranking:
ranking score MUST preserve scoring semantics
where used for selection
# ---------- RELEVANCE ----------
entity MemoryRelevance:
type: EpistemicMetadata
range: [0.0, 1.0]
rule relevance_bounds:
REQUIRE 0.0 <= relevance <= 1.0
rule relevance_context:
relevance SHOULD be evaluated relative_to current query, task, or context
rule relevance_not_truth:
relevance != truth
# ---------- IMPORTANCE ----------
entity MemoryImportance:
type: PriorityMetadata
may_include:
- importance_score
- importance_reason
- source
rule importance:
importance MAY affect retention or retrieval priority
but MUST NOT imply factual correctness
# ---------- VALIDITY / EXPIRY ----------
entity MemoryValidity:
type: ValidityMetadata
may_include:
- valid_from
- valid_until
- expiry_time
- status
- conditions
memory_status:
- active
- stale
- expired
- superseded
- disputed
- invalid
- archived
rule validity:
expired or invalid memory SHOULD NOT be used as current context
without qualification
rule stale_memory:
stale != false
but SHOULD trigger recency or verification checks where relevant
# ---------- MEMORY UPDATE ----------
entity MemoryUpdate:
type: ChangeMetadata
may_include:
- previous_value
- new_value
- reason
- agent
- timestamp
- evidence
rule update:
material memory change SHOULD preserve previous state
where history or auditability is required
rule contradiction:
new memory contradicting existing memory SHOULD trigger:
- conflict_detection
- provenance_comparison
- validity_review
- confidence_reassessment
# ---------- CONSOLIDATION ----------
entity MemoryConsolidation:
type: AIProcess
may_include:
- source_memories
- consolidation_method
- resulting_memory
- timestamp
- provenance
rule consolidation:
consolidated memory SHOULD preserve links to source memories
rule summarisation:
summary memory MUST remain distinguishable
from verbatim source memory
# ---------- FORGETTING / RETENTION ----------
entity MemoryRetentionPolicy:
type: LifecycleMetadata
may_include:
- retention_period
- expiry_condition
- archival_policy
- deletion_policy
- consolidation_policy
rule retention:
memory lifecycle SHOULD follow applicable retention policy
rule deletion:
deletion event MAY preserve audit metadata
without preserving deleted content
where policy permits
# ---------- EMBEDDINGS ----------
entity EmbeddingReference:
type: VectorMetadata
may_include:
- embedding_identifier
- model
- model_version
- vector_dimension
- creation_time
rule embedding:
embedding SHOULD preserve generating model identity
where semantic similarity depends on embedding space
rule embedding_version:
embeddings from incompatible models or versions
MUST NOT be assumed directly comparable
# ---------- PROVENANCE ----------
entity MemoryProvenance:
type: ProvenanceMetadata
may_include:
- source
- creator_or_process
- creation_time
- transformations
- summarisation
- consolidation
- updates
- retrieval_history
rule provenance:
AIMemoryMetadata SHOULD preserve memory origin and transformations
at granularity available and permitted
# ---------- VALIDATION ----------
validation:
require:
- identifiable_memory_or_memory_candidate
validate_if_present:
- memory_identifier
- memory_type
- scope
- source
- content_reference
- validity
- relevance
- importance
- retrieval_method
- embedding_reference
- provenance
- version
reject:
- relevance_outside_valid_range
- memory_applied_outside_scope
- expired_memory_presented_as_current_without qualification
- transformed_memory_presented_as verbatim_source
- incompatible_embeddings_compared_without transformation
- contradictory_memory_states_silently_merged
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"AI memory metadata" ~= "metadata about AI memory"
"memory item" ~= "AI memory record"
"long-term memory" ~= "persistent AI memory"
"conversation memory" ~= "dialogue memory" WHEN conversational context is stored
"semantic memory" ~= "conceptual AI memory" WHEN storing generalised semantic knowledge
"memory retrieval" ~= "AI memory lookup" WHEN retrieving stored memory records
PRESERVE distinctions:
memory != model_parameters
memory != training_data
working_memory != long_term_memory
semantic_memory != verified_fact
conversation_summary != original_messages
relevance != truth
importance != confidence
stale != false
retrieved_memory != external_retrieval_context
embedding != memory_content
consolidated_memory != source_memory
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_memory_metadata:
score: 1.00
explicit_memory_identifier:
score: 1.00
direct_source_memory:
score: 0.98
traceable_consolidated_memory:
score: 0.95
contextually_retrieved_memory:
score: 0.90
inferred_memory:
score: <= 0.80
ambiguous_memory_source:
score: <= 0.60
action: preserve uncertainty
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_memory_creation:
- assign MemoryIdentifier
- classify MemoryType
- establish scope
- record source
- establish validity
- attach provenance
on_memory_access:
- update last_access_time
- update access_count
- preserve retrieval context where required
on_memory_update:
- preserve previous memory version
- record new state
- reassess validity and confidence
- detect conflicts
- update provenance
on_memory_expiry:
- preserve historical metadata where policy permits
- set status = expired
- exclude from current context by default
- preserve provenance
on_consolidation:
- preserve source memories
- create consolidated memory
- record method
- preserve derivation links
- update provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- memory_entities
- memory_types
- relationships
- scope_rules
- retrieval_rules
- validity_rules
- consolidation_rules
- validation
- semantic_equivalence
- confidence
- update_model
canonicalisation:
- normalise_whitespace
- preserve_case_sensitive_identifiers
- sort_unordered_property_sets
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- AI metadata ontology
- memory lifecycle model
- context retrieval structure
- memory provenance and consolidation model
operations:
- identify AI memory records
- resolve memory types and scope
- inspect memory source
- evaluate validity and expiry
- retrieve relevant memories
- rank memory candidates
- inspect embeddings
- detect memory conflicts
- update and version memory
- consolidate related memories
- apply retention policy
- preserve provenance
- expose uncertainty
constraints:
- do_not_equate_memory_with_model_parameters
- do_not_equate_memory_with_training_data
- do_not_present_semantic_memory_as verified_fact_without evidence
- do_not_use_expired_memory_as current_without qualification
- do_not_silently_merge_conflicting_memories
- preserve_scope_source_validity_versions_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- memory_identifier
- memory_type
- memory_scope
- memory_source
- query_context
- temporal_constraint
- relevance_threshold
- status
- version
resolve:
1. identify AIMemory candidates
2. apply MemoryScope
3. apply validity and status
4. resolve source and provenance
5. evaluate semantic or lexical relevance
6. inspect embeddings where applicable
7. rank candidates
8. resolve conflicts
9. inspect versions and consolidation history
10. return selected memories and confidence
output:
- memories
- memory_identifiers
- memory_types
- scope
- source
- relevance
- validity
- versions
- provenance
- confidence
# ---------- INFERENCE ----------
inference:
IF MemoryItem is expired
THEN exclude from current active memory
unless historical context is requested
IF MemoryItem is derived by summarisation
THEN classify as transformed_memory
AND preserve source links
IF multiple memories refer to same entity or concept
AND are compatible
THEN consolidation MAY be proposed
IF memories conflict
THEN preserve alternatives
AND compare source, recency, validity, and confidence
IF memory source remains ambiguous
THEN preserve candidate origins
AND reduce confidence
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: AIMemoryMetadata
memory_structure: machine_interpretable
memory_identity: explicit
memory_types: classified
scope: preserved
source: traceable
relevance_and_importance: explicit
validity_and_expiry: resolvable
retrieval_history: traceable
consolidation_history: preserved
versions: traversable
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard