FLOW ALGEBRA
Ontology: AI Inference Metadata Ontology
Domain: Metadata Ontologies > AI Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/ai-metadata/ai-inference-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "AIInferenceMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: AIMetadata
subject: AIInferenceMetadata
purpose:
- represent metadata describing AI inference processes
- preserve model, input, prompt, context, parameters, tools, retrieval, and output state
- support inference traceability, reproducibility, validation, comparison, and governance
- distinguish inference-time processing from model training and evaluation
- enable machine-readable reasoning over AI-generated outputs
# ---------- CORE ENTITY ----------
entity AIInferenceMetadata:
type: AIMetadata
describes: InferenceProcess
may_include:
- inference_identifier
- model_identifier
- model_version
- input
- prompt
- system_instruction
- context
- inference_parameters
- retrieval_context
- tool_context
- memory_context
- timestamp
- latency
- output
- confidence
- uncertainty
- status
- provenance
entity InferenceProcess:
type: AIProcess
consumes:
- InferenceInput
- ModelState
produces: AIOutput
entity InferenceIdentifier:
type: Identifier
identifies: InferenceProcess
entity InferenceInput:
type: InputResource
may_be:
- text
- image
- audio
- video
- structured_data
- embedding
- sensor_data
- multimodal_input
# ---------- RELATIONSHIPS ----------
relationships:
AIInferenceMetadata -> DESCRIBES -> InferenceProcess
InferenceProcess -> IDENTIFIED_BY -> InferenceIdentifier
InferenceProcess -> USES_MODEL -> AIModel
InferenceProcess -> USES_MODEL_VERSION -> ModelVersion
InferenceProcess -> CONSUMES -> InferenceInput
InferenceProcess -> MAY_USE_PROMPT -> Prompt
InferenceProcess -> MAY_USE_CONTEXT -> InferenceContext
InferenceProcess -> HAS_PARAMETER -> InferenceParameter
InferenceProcess -> MAY_USE_RETRIEVAL -> RetrievalProcess
InferenceProcess -> MAY_USE_TOOL -> Tool
InferenceProcess -> MAY_USE_MEMORY -> MemoryContext
InferenceProcess -> PRODUCES -> AIOutput
AIOutput -> GENERATED_BY -> InferenceProcess
AIInferenceMetadata -> MAY_REFERENCE -> InferenceProvenance
# ---------- INFERENCE IDENTITY ----------
rule inference_identity:
InferenceProcess SHOULD have stable InferenceIdentifier
where auditability, reproducibility, or output traceability is required
rule inference_run:
repeated inference executions SHOULD remain distinguishable
even when model and input are identical
rule output_link:
AIOutput SHOULD link to generating InferenceProcess
# ---------- MODEL CONTEXT ----------
rule model_identity:
InferenceProcess SHOULD identify AIModel and ModelVersion
where deterministic attribution is required
rule version_context:
ModelVersion MUST remain distinct from ModelFamily
rule training_inference_distinction:
InferenceProcess != TrainingProcess
# ---------- INPUT ----------
rule input_preservation:
InferenceInput SHOULD preserve identity or stable reference
where reproducibility or provenance requires
rule input_modality:
input modality SHOULD be explicit for multimodal inference
rule transformed_input:
preprocessing applied before model inference SHOULD be traceable
where it affects output
# ---------- PROMPT ----------
entity Prompt:
type: InferenceInput
may_include:
- prompt_identifier
- prompt_text_or_reference
- system_instruction
- user_instruction
- template
- prompt_version
- language
rule prompt:
Prompt SHOULD be preserved or referenced
where output depends materially on prompt content
rule prompt_version:
template-based prompts SHOULD preserve PromptVersion
rule prompt_context_distinction:
Prompt != InferenceContext
# ---------- INFERENCE CONTEXT ----------
entity InferenceContext:
type: ContextMetadata
may_include:
- conversation_context
- task_context
- domain_context
- temporal_context
- spatial_context
- retrieved_context
- tool_results
- memory_context
rule context:
context affecting output SHOULD be preserved
where system policy permits and traceability requires
rule context_scope:
context MUST NOT be assumed to be part of model parameters
# ---------- PARAMETERS ----------
entity InferenceParameter:
type: AIParameter
may_include:
- name
- value
- datatype
- scope
parameter_examples:
- temperature
- top_p
- top_k
- max_output_tokens
- seed
- stop_sequence
- repetition_penalty
- beam_width
rule parameter:
effective inference parameters SHOULD be preserved
where reproducibility depends on them
rule defaults:
default parameter values SHOULD be distinguishable
from explicitly supplied values
# ---------- RANDOMNESS ----------
rule seed:
random seed MAY support repeatability
but same seed != guaranteed identical output
across model versions, hardware, software, or nondeterministic execution
# ---------- RETRIEVAL ----------
entity RetrievalProcess:
type: AIProcess
may_include:
- retrieval_identifier
- query
- retrieval_system
- source_corpus
- retrieved_resources
- ranking
- score
- timestamp
rule retrieval:
retrieval-augmented inference SHOULD preserve retrieved source references
where traceability is required
rule retrieval_not_model_memory:
retrieved external context != model parameters
rule source_ranking:
retrieval ranking SHOULD preserve scoring semantics
where used for downstream reasoning
# ---------- TOOLS ----------
entity Tool:
type: ComputationalResource
may_include:
- tool_identifier
- tool_type
- version
- permissions
entity ToolInvocation:
type: AIProcess
may_include:
- tool
- input
- output
- timestamp
- status
- provenance
rule tool_trace:
ToolInvocation SHOULD preserve tool identity, input, and output
where tool result affects AIOutput
rule tool_output:
ToolOutput != ModelGeneratedOutput
though model MAY transform or summarise tool output
# ---------- MEMORY ----------
entity MemoryContext:
type: ContextMetadata
may_include:
- memory_identifier
- memory_source
- memory_content_reference
- retrieval_method
- relevance
rule memory:
memory supplied at inference time SHOULD remain distinguishable
from model-trained knowledge
# ---------- OUTPUT ----------
entity AIOutput:
type: GeneratedResource
may_be:
- text
- image
- audio
- video
- prediction
- classification
- embedding
- recommendation
- action
- structured_data
output_status:
- generated
- validated
- reviewed
- corrected
- rejected
- superseded
rule output:
AIOutput SHOULD preserve relationship to model and InferenceProcess
rule output_not_fact:
AIOutput != VerifiedFact
# ---------- CONFIDENCE / UNCERTAINTY ----------
entity InferenceConfidence:
type: EpistemicMetadata
range: [0.0, 1.0]
rule confidence_bounds:
REQUIRE 0.0 <= confidence <= 1.0
rule confidence_semantics:
confidence MUST identify represented quantity
and MUST NOT automatically be interpreted as calibrated probability
entity InferenceUncertainty:
type: EpistemicMetadata
may_apply_to:
- classification
- prediction
- generation
- retrieval
- entity_resolution
- reasoning
# ---------- LATENCY ----------
entity InferencePerformance:
type: PerformanceMetadata
may_include:
- latency
- time_to_first_output
- tokens_per_second
- compute_usage
- memory_usage
- cost
rule performance_context:
inference performance SHOULD preserve environment and workload context
where comparison depends on them
# ---------- STATUS / ERRORS ----------
inference_status:
- pending
- running
- completed
- failed
- cancelled
- partial
entity InferenceError:
type: ProcessError
may_include:
- error_type
- error_message
- affected_stage
- timestamp
rule failed_inference:
failed InferenceProcess MAY have no valid AIOutput
and MUST NOT be treated as completed output generation
# ---------- PROVENANCE ----------
entity InferenceProvenance:
type: ProvenanceMetadata
may_include:
- model
- model_version
- inputs
- prompt
- parameters
- context
- retrieval_sources
- tool_invocations
- memory_context
- output
- timestamp
rule provenance:
AIInferenceMetadata SHOULD preserve derivation path
at granularity available and permitted
rule source_generated_distinction:
source content, retrieved content, tool output, memory context, and model-generated content
SHOULD remain distinguishable
# ---------- VALIDATION ----------
validation:
require:
- identifiable_inference_process
- model_identity
- input_or_prompt
- inference_status
validate_if_present:
- model_version
- parameters
- retrieval_context
- tool_context
- memory_context
- output
- confidence
- performance
- provenance
reject:
- confidence_outside_valid_range
- completed_inference_without_output where output is required
- output_without_generating_inference_link
- contradictory_inference_status
- model_version_mismatch
- retrieved_content_presented_as model_generated_without transformation context
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"AI inference metadata" ~= "metadata about AI inference"
"inference run" ~= "inference process" WHEN one execution is represented
"generation metadata" ~= "inference metadata" WHEN inference produces generated content
"inference parameters" ~= "generation parameters" WHEN generation is inference task
"retrieval context" ~= "retrieved inference context"
"tool invocation metadata" ~= "AI tool-use metadata"
PRESERVE distinctions:
inference != training
inference != evaluation
prompt != context
context != model_parameters
retrieval != model_memory
memory_context != trained_knowledge
tool_output != model_generated_output
AI_output != verified_fact
confidence != calibrated_probability unless explicitly defined
seed != deterministic_guarantee
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_inference_metadata:
score: 1.00
explicit_model_and_version:
score: 1.00
traceable_prompt_and_parameters:
score: 0.98
traceable_retrieval_sources:
score: 0.98
traceable_tool_invocations:
score: 0.98
inferred_inference_context:
score: 0.80
inferred_generation_source:
score: <= 0.75
incomplete_inference_provenance:
score: <= 0.60
action: preserve unknowns
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_inference_start:
- assign InferenceIdentifier
- record model and ModelVersion
- record input and prompt
- record effective parameters
- initialise provenance
- set status = running
on_retrieval:
- record retrieval query
- preserve retrieved resources
- preserve ranking
- attach retrieval context
- update provenance
on_tool_invocation:
- preserve tool identity and version
- record tool input and output
- record status
- update provenance
on_inference_completion:
- record AIOutput
- record completion time
- record performance metadata
- set status = completed
- finalise provenance
on_output_review:
- preserve raw AIOutput
- attach review or correction
- update output status
- preserve human interaction provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- inference_entities
- relationships
- model_rules
- prompt_rules
- parameter_rules
- retrieval_rules
- tool_rules
- provenance_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
- inference lifecycle model
- AI output provenance structure
- retrieval and tool-use reasoning model
operations:
- identify inference processes
- resolve model and version
- inspect input and prompt
- resolve inference context
- inspect effective parameters
- trace retrieval sources
- trace tool invocations
- resolve memory context
- inspect output and status
- evaluate confidence and uncertainty
- inspect performance
- preserve inference provenance
constraints:
- do_not_equate_inference_with_training
- do_not_equate_retrieval_with_model_memory
- do_not_equate_memory_context_with_trained_knowledge
- do_not_present_tool_output_as model_generated_without transformation
- do_not_present_AI_output_as verified_fact
- preserve_model_input_prompt_context_tools_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- inference_identifier
- model_identifier
- model_version
- input
- prompt
- inference_parameter
- retrieval_source
- tool
- output
- status
resolve:
1. identify InferenceProcess
2. resolve AIModel and ModelVersion
3. retrieve inputs and Prompt
4. resolve InferenceContext
5. inspect effective parameters
6. trace RetrievalProcess
7. trace ToolInvocations
8. inspect MemoryContext
9. retrieve AIOutput and performance
10. trace provenance and confidence
output:
- inference_process
- model
- model_version
- inputs
- prompt
- context
- parameters
- retrieval
- tools
- output
- status
- provenance
- confidence
# ---------- INFERENCE ----------
inference:
IF AIOutput explicitly links to InferenceProcess
AND InferenceProcess links to ModelVersion
THEN associate AIOutput with model state
WITH confidence = 1.00
IF RetrievalProcess supplies source resources to InferenceContext
THEN construct retrieval provenance chain
IF ToolInvocation output is incorporated into final AIOutput
THEN preserve tool-derived contribution relationship
IF same model, prompt, parameters, and seed are reused
THEN repeatability MAY increase
BUT do_not infer deterministic equality
IF inference provenance remains incomplete
THEN preserve unknown components
AND reduce confidence
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: AIInferenceMetadata
inference_structure: machine_interpretable
inference_identity: explicit
model_and_version: traceable
input_and_prompt: preserved
context: explicit_where_available
parameters: contextualised
retrieval_sources: traceable
tool_invocations: traceable
output: model_linked
status: explicit
performance: reportable
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard