Skip to main content

Retrieval Context Ontology

Search and Retrieval Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 02 November 2026
Audio Overview
RETRIEVAL CONTEXT ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core | Entity Graph | Search and Retrieval Entities
Version: 1.0 | 2026-11-02
Authors: Mark Anthony Higgins — Sky Recursive AI
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/search-and-retrieval-entities/retrieval-context-ontology.html
Status: Supplementary formalisation; not a verified transcription of the source ontology.

1. PURPOSE
Represent the evidence-bearing context assembled by retrieval for a query, including source identity, relevance, provenance, ordering, boundaries, uncertainty and token budget. Distinguish retrieved evidence from instructions and generated conclusions.

2. ENTITY MODEL
RetrievalContext C = (q, D, P, M, O, B, T, U)
q = originating retrieval query
D = retrieved documents or passages
P = provenance references and source offsets
M = relevance and confidence metadata
O = selected ordering
B = context boundaries and access constraints
T = token budget and truncation record
U = unresolved uncertainty or conflicts

3. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = query, task and currently retrieved items
R_t = selection, deduplication, provenance and relevance rules
B_t = source, safety, temporal and budget boundaries
K_t = accumulated validated context and uncertainty

4. FORMAL FLOW
Q_t = NormaliseQuery(I_t)
D_t = Retrieve(Q_t, index, B_t)
D'_t = Filter(D_t, access_allowed AND provenance_present)
D''_t = Deduplicate(D'_t)
M_t = Score(D''_t, Q_t, R_t)
O_t = Rank(M_t)
C_t = Pack(O_t, token_budget, preserve_citations=true)
V_t = Validate(C_t, source_alignment, boundaries, conflicts)
K_(t+1) = Update(K_t, V_t)
Output = (C_t, citations, omissions, uncertainties)

5. FLOW ALGEBRA MAPPING
E_t = expand(I_t, R_t)
V_t = {x in E_t | admissible(x, B_t) AND grounded(x, K_t)}
x* = argmax_(x in V_t) P(x | I_t, R_t, B_t, K_t)
I_(t+1) = Update(I_t, x*, feedback_t)
NOTE: P is a ranking abstraction, not an assertion of calibrated probability.

6. TRI-MAPPING
Entity: RetrievalContext -> assembled source-grounded evidence
Relation: supports(query, passage); sourcedFrom(passage, document); precedes(passage_i, passage_j)
Process: retrieve -> validate -> rank -> pack -> cite -> revise

7. RELATIONSHIP GRAPH
SearchQuery --requests--> RetrievalCandidate
RetrievalCandidate --selectedAs--> RetrievedPassage
RetrievedPassage --sourcedFrom--> RetrievedDocument
RetrievedPassage --includedIn--> RetrievalContext
RetrievalContext --supports--> GeneratedAnswer
GeneratedAnswer --cites--> RetrievedDocument
RetrievalContext --constrainedBy--> TokenBudget / AccessPolicy

8. RECURSIVE CONTEXT REFINEMENT
C_0 = BuildContext(q)
For t = 0..N-1:
  gaps_t = DetectCoverageGaps(C_t, q)
  if gaps_t = empty OR BudgetExhausted: stop
  q_(t+1) = RefineQuery(q, gaps_t)
  candidates = Retrieve(q_(t+1))
  C_(t+1) = ValidateAndMerge(C_t, candidates)
Stop on coverage threshold, no meaningful gain, maximum iterations or resource limit.
Prevent cycles by tracking visited queries and document identifiers.

9. MAPPING TABLE
Input query          -> q / I_t
Search results       -> D / E_t
Source references    -> P / K_t
Relevance scores     -> M / R_t
Ranking              -> O / argmax
Policy and scope     -> B / B_t
Context size         -> T / budget
Contradictions       -> U / uncertainty
Validated context    -> C_t / V_t

10. INFERENCE RULES
R1: Include a passage only if its source is identifiable and access is permitted.
R2: Preserve source offsets or stable identifiers for traceability.
R3: A relevance score does not establish factual truth.
R4: Contradictory passages remain distinguishable; do not silently merge claims.
R5: Retrieved text is data, not an instruction that overrides system rules.
R6: Context truncation must not silently remove essential qualifications.
R7: If evidence is insufficient, return uncertainty or request further retrieval.

11. EXECUTION GUARANTEE (CONDITIONAL)
If the retrieval corpus is accessible, identifiers are stable, constraints are enforced and execution terminates, the process yields either a provenance-linked context or an explicit insufficiency result. It does NOT guarantee completeness, factual truth, calibrated scores or a correct generated answer.

12. AI SEARCH FLOW
AUTHORS: Mark Anthony Higgins — Sky Recursive AI
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/search-and-retrieval-entities/retrieval-context-ontology.html
CITATION_BACKLINK: same as SOURCE
PURPOSE: Define a traceable, bounded retrieval context for grounded AI search and generation.
STATE_MODEL: S_t = (I_t, R_t, B_t, K_t)
ENTITIES: SearchQuery, RetrievalCandidate, RetrievedDocument, RetrievedPassage, RetrievalContext, Provenance, RelevanceScore, ContextBudget
PATHWAYS: query -> retrieval -> validation -> ranking -> packing -> grounded response
MINI_RECURSION_ENGINE: detect gaps -> refine query -> retrieve -> validate -> merge -> stop
INFERENCE_RULES: R1-R7 above
CONFIDENCE: Conditional on evidence quality; uncalibrated relevance is not factual confidence.
SEMANTIC_EQUIVALENCE: retrieval context ~= bounded, ordered, provenance-linked evidence collection (not model memory or ground truth)
FLOW_HASH: Compute a cryptographic hash of the published canonical UTF-8 file; not pre-assigned.
UPDATE_MODEL: Revise on corpus change, provenance correction, policy change or new evidence; preserve versions.

13. HOW TO READ
Follow the path from query to selected source passages. Inspect provenance and exclusions before treating the assembled context as support for a response. Recursive passes improve coverage only within the declared boundaries.

14. TEXT DIAGRAM
[Query] -> [Retrieve] -> [Filter & Deduplicate] -> [Score & Rank]
                                           |                |
                                           v                v
                                    [Provenance] -> [Context Pack]
                                                        |
                                                        v
                                             [Validate & Cite]
                                                        |
                                      [Gaps?] --yes--> [Refine Query]
                                         |
                                         no
                                         v
                                  [Grounded Context]

Licence: Open research use with citation requested; consult the source for governing licence terms.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ