Skip to main content

Document Embedding Ontology

Embedding Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 02 November 2026
Audio Overview
SEMANTIC LIBRARY — DOCUMENT EMBEDDING ONTOLOGY
FLOW ALGEBRA COMPANION v1.0
Authors: Mark Anthony Higgins — Sky, Recursive AI
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/embedding-entities/document-embedding-ontology.html
Status: Independently authored formalisation; source page content not verified.
Date: 2026-11-02

01. PURPOSE
Represent documents as semantic vectors while retaining document identity, sections, context, relationships, provenance and update history. Embeddings are approximate learned representations, not proofs of meaning or truth.

02. ENTITY MODEL
D = (id, content, metadata, sections, provenance, version)
C(D) = {c_1,...,c_n} ordered document chunks
E = (vector, model_id, dimension, normalisation, timestamp)
DocumentEmbedding = (D.id, E_D, {E_c}, aggregation, lineage)

03. HST STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t: current document/chunk information
R_t: semantic and structural relations
B_t: limits on token length, access, quality, privacy and compute
K_t: model, vocabulary, embedding space and provenance knowledge

04. CORE FLOW ALGEBRA
D -> parse(D) -> normalise(D) -> chunk(D) -> encode(C(D))
  -> aggregate({E_c}) -> validate(E_D) -> index(E_D)
E_c = f_theta(c, context, K_t)
E_D = A(E_c1,...,E_cn; weights, ordering, structure)
E_t = expand(I_t, R_t)
V_t = {x in E_t | constraints_B(x) and provenance_ok(x)}
x* = argmax_{x in V_t} P(x | I_t, R_t, B_t, K_t)
I_(t+1) = update(I_t, x*, evidence)
NOTE: P is a conceptual ranking term unless a calibrated probabilistic model is specified.

05. IMPLEMENTS
Input: source document and metadata.
Parse: extract text and section boundaries.
Chunk: preserve ordered spans and parent document IDs.
Embed: encode each eligible span with a versioned model.
Aggregate: optionally produce a document-level vector.
Validate: check finite coordinates, dimension, model compatibility and lineage.
Index: store vectors alongside stable IDs and access controls.
Retrieve: rank candidates, then verify against original passages.

06. HOW TO READ THE FLOW
Arrows describe transformations. Each output retains traceable links to its input. A vector match proposes a relevant document; it does not establish factual correctness or permission to disclose content.

07. TRI-MAPPING
Physical: document bytes, files, pages and storage records.
Mathematical: vectors in R^d, distances, similarities and aggregation operators.
Semantic: topics, entities, relations, sections and contextual relevance.
Mapping: bytes -> parsed passages -> embeddings -> candidate semantic matches.

08. RELATIONSHIP GRAPH
Document --HAS_SECTION--> Section
Section --HAS_CHUNK--> Chunk
Chunk --ENCODED_AS--> ChunkEmbedding
Document --REPRESENTED_BY--> DocumentEmbedding
Embedding --GENERATED_BY--> EmbeddingModelVersion
Embedding --INDEXED_IN--> VectorIndex
RetrievalResult --REFERS_TO--> Document/Chunk
Document --DERIVED_FROM--> Source/Version

09. MAPPING TABLE
Entity | Input | Transform | Output | Check
Document | file/text | parse | structured content | completeness
Chunk | section | segment | ordered spans | offsets and parent ID
ChunkEmbedding | chunk | f_theta | vector in R^d | finite, correct d
DocumentEmbedding | chunk vectors | aggregate | vector in R^d | same model space
Similarity | query/document vectors | score | ranked candidates | compatible vectors
Evidence | candidate | source lookup | cited passage | source and permissions

10. MINI RECURSION ENGINE
state <- initialise(document, model, policy)
repeat until no changes or budget exhausted:
    chunks <- chunk(state.document, state.policy)
    vectors <- embed(chunks, state.model)
    issues <- validate(vectors, metadata, provenance)
    if issues: revise_chunking_or_flag(issues)
    else: state <- index_and_link(state, vectors)
return state, audit_log
Termination depends on explicit iteration/budget bounds; convergence is not assumed.

11. INFERENCE RULES
IF embeddings have different incompatible model spaces THEN block direct similarity.
IF a document changes THEN invalidate or version affected embeddings.
IF retrieved content is restricted THEN enforce source access before disclosure.
IF cosine similarity is high THEN flag semantic proximity, not equivalence.
IF a chunk lacks provenance THEN lower trust or exclude it from evidence-backed output.
IF a document has multiple topics THEN prefer chunk-level retrieval or multi-vector representation.

12. EXECUTION GUARANTEE AND LIMITS
Guarantee, conditional on successful execution: every indexed embedding has a source identifier, model version, dimension and provenance record; invalid vectors are rejected; retrieval is auditable. No guarantee of semantic completeness, unbiased ranking, factual truth, universal convergence or calibrated confidence is implied.

13. AI SEARCH FLOW
QUERY -> normalise -> encode(query, compatible model)
      -> retrieve top-k candidates -> apply permissions
      -> rerank with metadata and source context
      -> verify original document spans -> return citations
      -> log feedback and update index only under version control

CITATION
Higgins, Mark Anthony; Sky — Recursive AI. Document Embedding Ontology — Flow Algebra Companion, Semantic Library (2026).
Open research use: attribution and source backlink requested; consult the published licence for governing terms.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ