Episodic-to-Semantic Consolidation
Without Identity Drift
July 02, 2026
Long-running adaptive intelligent agents face a structural tension between knowledge consolidation and information integrity. Memory consolidation is conventionally treated as an agent-changing operation: a model is fine-tuned, a prompt rewritten, a policy distilled, or a reflection appended to the context that governs future behaviour. In regulated autonomic deployment this is a liability because the agent operates under commitments and audit contracts that bind to a specific, cryptographically certified identity. We propose to treat consolidation not as a mutation of the planner or the identity manifest, but as a deterministic function \(f: M^{\mathrm{ep}}_{A}\to M^{\mathrm{sem}}_{A}\) from the agent’s episodic event log \(M^{\mathrm{ep}}_{A}\) (an append-only record of past interactions) to a separately addressable semantic knowledge layer \(M^{\mathrm{sem}}_{A}\) (queryable, consolidated facts derived from that log); the identity hash does not read \(M^{\mathrm{sem}}_{A}\), so consolidation updates knowledge without changing the agent’s certified identity. We give a formal account of the agent representation, prove identity invariance through a structural lemma on the manifest’s hash-input set, specify a deterministic aggregation algorithm whose outputs are auditable database rows with explicit confidence and supporting- event provenance, and validate the construction with synthetic experiments demonstrating per-field correctness, byte-equal identity across consolidation passes, and a mean \(79.8\%\) reduction in unproductive planner attempts (95% BCa CI \([78.0\%, 81.5\%]\) across \(10\) seeds) against a calibrated Bayesian-shrunk baseline. The construction is a knowledge-update discipline for autonomic agents in which lessons accumulate as queryable facts while the agent’s certified identity remains byte-equal across its operational lifetime, with an embodied service agent as the running case study.
Episodic Memory ,Semantic Consolidation , Identity Invariance ,Cryptographic Provenance , Long-Running Embodied Agents ,Information Integrity
Long-running adaptive intelligent agents are increasingly deployed in regulated environments where two demands collide. From an adaptive-systems standpoint, the agent must calibrate to its lived experience: per-task confidence must update with empirical outcomes, risk posture must respond to incident history, and operator-facing parameters must track ground-truth task difficulty. From an information-integrity standpoint, the same agent must present a stable, cryptographically certifiable identity to compliance auditors, cross-deployment migration tooling, and the downstream cyber-physical infrastructure that consumes the agent’s outputs. Embodied service agents in hospitals, manufacturing cells, and warehouse logistics are the running case: each is operated under commitments and audit contracts that bind to a specific certified identity. If knowledge consolidation silently mutates the agent, every consolidation pass becomes a re-certification event. Either the certificate is updated continuously (which compliance paperwork cannot sustain) or the consolidation is treated as drift (which the operator cannot tolerate).
The tension is the standard expression of the stability-plasticity problem under autonomic governance, but with an extra constraint absent from the classical formulation: the agent’s identity is not defined by its weights, its prompt, or its current context window; it is defined by a cryptographic digest over a separately maintained manifest. Knowledge consolidation that changes the weights, the prompt, or the in-context summary therefore breaks identity integrity even when behaviour improvement is the intended outcome. The conventional CL toolbox (parameter-side regularisers, gradient projection, replay, reflection-driven prompt rewrites) all bind the learned signal to the artefact whose hash defines identity. None of them, taken as-is, preserves the cryptographic certificate while still letting the agent become operationally smarter from lived experience.
This paper asks: can an adaptive intelligent agent consolidate operational knowledge from episodic experience while its identity certificate remains byte-equal? Our answer, which we refer to as identity-stable consolidation, treats consolidation not as a mutation of the planner or the identity manifest, but as a deterministic function over episodic memory whose output is a separately addressable semantic knowledge layer \(M^{\mathrm{sem}}_{A}\) which downstream planners query for grounding facts. The approach factors memory into two stores (an episodic event log \(M^{\mathrm{ep}}_{A}\) and a derived semantic layer \(M^{\mathrm{sem}}_{A}\)) and constrains consolidation to write only the semantic store, leaving the manifest’s hash-input set untouched. The identity hash therefore does not read this layer, so consolidation updates knowledge without changing who the agent is in any sense the auditor, the insurer, or the operator can detect.
The setting is an autonomic-governance substrate for long-running deployed agents. We assume an underlying architecture that separates an immutable identity certificate (a manifest hashed into a single fixed-length value) from the operational scaffolding the agent uses moment-to-moment, and persists episodic events under that identity in an append-only store partitioned by identity hash. Such substrates are consistent with prior work on identity-orthogonal memory layers for long-running adaptive agents under autonomic governance. We treat the existence of the manifest hash and the episodic store as substrate; this paper’s contribution is the knowledge-consolidation layer above them, and the proof that this layer can update without moving the cryptographic identity.
Suppose a robot’s manipulation.grasp capability fails on glass cups at \(15\) N three times and succeeds at \(25\) N twelve times across one week of operation. A robot that
merely stores these events has memory but no operational knowledge: each future grasp begins from the same default. A robot that consolidates can answer a future planner query with a fact such as “for glass_cup under this environment,
recommended grasp force is \(25\) N with confidence \(0.83\) over \(15\) observations.” That fact is not a policy rewrite, not a manifest mutation, and not a
fine-tuning gradient. It is a derived row in a semantic table, computed from the episodic rows by a deterministic rule, and recoverable byte-for-byte from the same inputs. A reviewer can ask why the recommendation is \(25\) N and walk back to the supporting events. Figure 2 walks through this same example end-to-end, including the manifest hash check that completes once consolidation is done.
Identity-stable consolidation is realised through four elements that together constitute the framework developed in the remainder of the paper. (i) A formal model of agent state as a tuple \((M, M^{\mathrm{ep}}_{A}, M^{\mathrm{sem}}_{A}, \pi)\) that explicitly separates the identity manifest \(M\) (the bytes hashed into the identity certificate) from the operational substrate the agent uses moment to moment (§3.1). (ii) A structural identity-invariance result (Lemma 1) that excludes the semantic layer \(M^{\mathrm{sem}}_{A}\) from the manifest’s hash-input set by construction rather than by runtime assertion. (iii) A deterministic v1 consolidation algorithm \(f: M^{\mathrm{ep}}_{A}\to M^{\mathrm{sem}}_{A}\) that materialises the semantic store as auditable database rows with explicit confidence, observation counts, and supporting-event provenance (§3.2). (iv) A read-only planner interface (§3.4) that exposes \(M^{\mathrm{sem}}_{A}\) as grounding facts to the downstream planner without giving the planner write access to the manifest or the semantic store. The remainder of the paper develops each element in turn and then reports empirical validation (§4).
The paper’s contribution is formal, architectural, and empirical, and is positioned as an information-integrity discipline for adaptive intelligent agents under autonomic governance.
A structural identity-invariance result. We define semantic memory as \(M^{\mathrm{sem}}_{A}= f(M^{\mathrm{ep}}_{A})\) and prove, via input-set inspection of the manifest’s hash (Lemma 1, Corollary 1), that the cryptographic identity hash is byte-equal across arbitrary sequences of consolidation passes, by construction rather than by runtime check. The result follows from the type signature of \(f\) and the field set of the manifest dataclass, not from a runtime assertion.
A deterministic, auditable consolidation algorithm. We specify a v1 consolidation pass whose outputs are plain database rows with explicit confidence, observation counters, and supporting-event provenance, enabling end-to-end traceability from any planner-consulted fact back to the supporting episodic evidence. The pass is idempotent, order-invariant, and recoverable byte-for-byte from the same inputs under the same rule version.
An empirical validation under three controls. We ablate the contribution of consolidation structure against no-memory, uniform-confidence, and calibrated Bayesian-shrunk controls on a 1000-decision synthetic benchmark across \(10\) seeds (Table 1). The calibrated control retires the straw-man critique of the no-memory baseline: a mean \(79.82\%\) reduction in unproductive planner attempts (95% BCa CI \([78.02\%, 81.49\%]\)) holds against a held-out Bayesian-shrunk confidence estimate, while the cryptographic identity hash remains byte-equal across all consolidation passes (verified through SHA-256 recomputation, see V2 fixture).
An LLM-assisted v2 is sketched only as future work (§3.3) because it introduces non-determinism that complicates audit; deploying it before v1 stabilises would inherit the drift problem we are trying to avoid. Planner integration is realised through a read-only query interface (§3.4) that exposes \(M^{\mathrm{sem}}_{A}\) as grounding facts without giving the planner write access to the semantic store or the manifest.
We position our contribution against five research currents, led by autonomic-computing and adaptive-systems work that frames the broader problem, and followed by the more specialised sub-currents whose mechanisms our construction borrows from or contrasts with.
The autonomic-computing tradition frames the central problem of long-running deployed systems as continuous self-adaptation: agents monitor their operating context, analyse it against declared objectives, plan corrective action, and execute the plan, with knowledge accumulated across iterations of this loop. The MAPE-K reference architecture [1] is the canonical realisation, and the broader family of self-adaptive systems work has elaborated it into a programme on architectural support for runtime adaptation under explicit goals [2], [3]. Within this tradition, the central methodological question is how knowledge accumulated by the autonomic loop is represented, updated, and shared between the loop’s monitoring and execution phases without compromising the system’s externally visible contracts.
Recent work in Information Sciences has elaborated this question across several axes that touch our construction directly. [4] studies adaptive-belief update in agent-based negotiation; [5] develops heterogeneous update strategies for reinforcement-learning agents; [6] combines data-driven and knowledge-driven belief-rule learning; [7] introduces knowledge-guided coordination between cooperative multi-agent systems; and [8] formalises fuzzy-knowledge inference for dynamic task allocation. These works share an implicit substrate assumption: the knowledge surface (be it a belief table, a Q-function, or a belief-rule base) is also the substrate whose update defines the agent. Our construction parts from this assumption by separating the knowledge surface that updates (semantic memory \(M^{\mathrm{sem}}_{A}\)) from the substrate that defines the agent’s externally visible identity (the manifest hashed into the identity certificate).
Modern realisations of the autonomic loop in the LLM-agent space inherit its shape while differing in substrate: reflection-based language agents such as [9] and [10] store verbal feedback and feed it into later episodes; [11] builds a persistent skill library through trial; [12] manages a memory hierarchy under context pressure; [13] treats memory itself as agentic, with the agent deciding what to record and how to index it. [14] frames these designs as cognitive architectures for language agents, mapping each onto memory, decision-making, and learning loops. Across this body of work the artefact that consolidates is also the artefact that is deployed: the same parameter set, prompt context, or skill library that produces behaviour is the one that learns. The property is operationally effective but structurally incompatible with an identity certificate that must remain byte-equal across the adaptive loop. The present paper preserves the autonomic loop’s substantive content (continuous knowledge update from lived experience) while inverting the bind: consolidation produces a separately addressable artefact whose update does not touch the agent’s cryptographic identity. The separation can be stated information-theoretically: by a mutual-information argument [15], the identity hash, computed only from the manifest’s hash-input bytes, carries zero information about the bytes of \(M^{\mathrm{sem}}_{A}\); therefore arbitrary updates to \(M^{\mathrm{sem}}_{A}\) cannot influence the hash. The formal account in §3.1 makes this argument structural.
The vocabulary of knowledge representation and reasoning [16] supplies the formal substrate within which the episodic-semantic distinction can be precisely stated. The distinction itself descends from [17]: episodic memory holds traces of specific events; semantic memory holds structured knowledge about the world. [18] argues that declarative memory in mammals decomposes along the same axis, with the hippocampus mediating event traces and the cortex holding consolidated knowledge. Complementary learning systems theory [19], [20] develops this into an explicit two-store model: a fast-learning hippocampal system encodes individual episodes and a slower neocortical system extracts statistical regularities, with sleep-time replay [21] as the canonical biological mechanism by which knowledge moves between the two. These traditions motivate the distinction between event logs and extracted knowledge, and they motivate the design choice of representing extracted knowledge in a separate substrate from the event log itself. They do not address an engineered identity certificate because the cognitive-science agent is the brain and there is no separate “identity hash” to preserve. Our construction inherits the two-store decomposition but re-anchors it in an information-integrity setting: the identity-bearing substrate is the manifest’s hash, and the consolidation function’s correctness target is the byte-equality of that hash rather than any neural-fidelity claim.
Reinforcement learning uses replay buffers, offline datasets, and policy updates to turn experience into better behaviour [22], [23]. The continual-learning literature has elaborated this into a family of mechanisms for acquiring new knowledge without overwriting old: parameter-side regularisers such as EWC [24] and distillation-based variants such as LwF [25]; gradient-projection methods such as GEM [26] and its averaged-gradient extension A-GEM [27]; and replay-based baselines such as CLEAR [28] and DER [29]. [30] surveys the incremental-learning design space; [31] reviews lifelong learning more broadly. Across all of this work the agent is normally identified with its learned policy. A consolidation step that updates policy parameters changes the agent in the relevant sense. The property is acceptable when the research object is performance improvement; it is less acceptable when an autonomic deployment requires stable identity across time. The underlying assumption that the agent is its weights does not hold in our setting, where a deployed agent is the combination of a frozen identity manifest, a swappable planner, an audited capability registry, and the persistent memory layers studied here.
A related current focuses specifically on how language-model agents retain and reuse information across episodes. [9] stores verbal feedback and feeds it into later episodes; [10] use memory retrieval and reflection to produce higher-level summaries; [11] builds a persistent skill library; [12] manages a memory hierarchy under context pressure; [32] attaches a forgetting curve so older, less-rehearsed memories decay; [13] treats memory itself as agentic, with the agent deciding what to record and how to index it. For embodied agents, [33] grounds language-model intent in robotic affordances by composing skills the runtime can actually execute. These mechanisms all bind the consolidated output to the engine that produced it: a different model, prompt, or policy after consolidation is, operationally, a different agent. Our construction inverts the bind: consolidation produces a separately addressable artefact whose update does not change the agent’s certificate.
The BDI tradition [34], [35] factors an agent’s mental state into beliefs, desires, and intentions, and pins observable behaviour to the intentions an agent is currently committed to. The identity certificate introduced here plays a structurally similar role: it freezes a specific set of commitments (manifest, policy version, audited capability set) and forces any update path to be visible to the operator. The present paper differs from BDI by routing the commitment through a hashed identity manifest rather than through an explicit intention-revision protocol, and by treating semantic memory as identity-orthogonal rather than as a derivable view over current beliefs.
Closest in spirit is a line of work on persistent episodic memory that separates the identity manifest from the episodic event log so that logging events does not alter the agent’s certificate. The present paper extends that programme by adding a derived memory layer (semantic facts) whose update is likewise excluded from the identity hash by construction, and by proving the exclusion structurally rather than asserting it as a runtime invariant.
This section develops identity-stable consolidation in four parts. §3.1 formalises the agent state, proves the structural identity-invariance result (Lemma 1), and gives a high-level walkthrough of the four framework elements introduced in §1. §3.2 specifies the deterministic consolidation algorithm, its determinism and idempotence properties, and the audit chain that keeps every semantic row traceable to supporting evidence. §3.3 discusses an LLM-assisted extension as a future direction. §3.4 describes the read-only planner integration interface.
This section presents identity-stable consolidation as four interacting elements before turning to the formal account that pins down the identity-invariance guarantee. The four elements were named informally in §1 and visualised as the derived-layer construction in Figure 1 (b); here we describe how they fit together and where the remainder of the paper develops each one.
(i) Manifest, episodic store, and semantic store. The agent state separates an identity manifest \(M\) from two operational substrates: an episodic event log \(M^{\mathrm{ep}}_{A}\) that accumulates timestamped observations append-only, and a semantic store \(M^{\mathrm{sem}}_{A}\) that materialises consolidated facts derived from \(M^{\mathrm{ep}}_{A}\). The identity hash \(h = \mathrm{SHA256}(M)\) binds the agent’s cryptographic certificate to a fixed-field manifest dataclass, so growth in \(M^{\mathrm{ep}}_{A}\) or \(M^{\mathrm{sem}}_{A}\) has no effect on \(h\) by construction. Section 3.1.2 formalises the state tuple and the canonical serialisation rules.
(ii) Structural identity invariance. The first guarantee we prove is that the consolidation operation \(f : M^{\mathrm{ep}}_{A}\to M^{\mathrm{sem}}_{A}\) cannot move \(h\). The proof is structural rather than runtime: inspection of the manifest dataclass’s field set shows that \(M^{\mathrm{sem}}_{A}\) is not a hash input, so any \(f\) writing only to the semantic store leaves the canonical serialisation of \(M\) unchanged (Lemma 1, Corollary 1). Section 3.1.3 states the lemma and the input-set argument that supports it.
(iii) Deterministic v1 consolidation. The first concrete realisation of \(f\) is a deterministic SQL-style aggregation pass that turns structured episodic payloads into semantic rows with explicit confidence values, observation counts, and supporting-event provenance. The pass is idempotent and order-invariant; the same episodic state under the same rule version produces a byte-equal semantic snapshot on every re-run. Section 3.2 specifies the schema, the algorithm, and the audit chain through which every semantic row remains traceable to its supporting events. An LLM-assisted v2 is discussed as future work (§3.3).
(iv) Read-only planner interface. A downstream planner consumes \(M^{\mathrm{sem}}_{A}\) through a read-only HTTP endpoint that surfaces top-ranked facts as grounding for the planner’s prompt. The interface deliberately does not give the planner write access to \(M^{\mathrm{sem}}_{A}\) or \(M\); semantic memory is an information surface, not an authority surface. The interface specification, including auditability of fact-consultation, is in Section 3.4.
With these four elements named, the remainder of this section gives the formal state tuple (§3.1.2) and the identity-invariance lemma (§3.1.3) on which the rest of the paper builds.
We model the agent state as a tuple \((M, M^{\mathrm{ep}}_{A}, M^{\mathrm{sem}}_{A}, \pi)\) where \(M\) is the identity manifest (a frozen dataclass with a fixed, finite set of fields), \(M^{\mathrm{ep}}_{A}\) is the episodic event log (an append-only sequence of timestamped events partitioned by \(\mathrm{SHA256}(M)\)), \(M^{\mathrm{sem}}_{A}\) is the derived semantic memory table, and \(\pi\) is the planner. The identity hash is \(h = \mathrm{SHA256}(M)\). The consolidation operation is \(M^{\mathrm{sem}}_{A}{} \leftarrow f(M^{\mathrm{ep}}_{A}{})\), a deterministic function.
The construction’s correctness rests on a structural property of the manifest’s hash-input set rather than on a runtime check. Concretely, we identify a class of operations that, by their signature alone, cannot modify the manifest and therefore cannot change the identity hash.
Lemma 1 (Structural identity invariance). Let \(\mathcal{F}_{\mathrm{sem}}\) denote the class of operations \(f : M^{\mathrm{ep}}_{A}\to M^{\mathrm{sem}}_{A}\) whose only write target is the semantic store. For every \(f \in \mathcal{F}_{\mathrm{sem}}\) and every well-formed agent state \((M, M^{\mathrm{ep}}_{A}, M^{\mathrm{sem}}_{A}, \pi)\), applying \(f\) leaves \(M\) syntactically unchanged. Consequently, by determinism of \(\mathrm{SHA256}(\cdot)\) over canonical serialisations, \(h = \mathrm{SHA256}(M)\) is byte-equal before and after applying any \(f \in \mathcal{F}_{\mathrm{sem}}\).
Proof (by input-set inspection). The hash \(h\) is a deterministic digest whose input is the canonical serialisation of \(M\)’s fields. Inspection of the manifest dataclass declared in the runtime confirms that the field set is fixed at type-design time and does not include any reference to \(M^{\mathrm{sem}}_{A}\). Operations in \(\mathcal{F}_{\mathrm{sem}}\) have \(M^{\mathrm{sem}}_{A}\) in their write footprint and \(M\) outside it; their effect on the agent state is therefore disjoint from the hash-input set, and the canonical serialisation of \(M\) is unchanged. SHA-256 over the same byte string yields the same digest. The result is structural: it follows from the type signature of \(f\) and the field set of \(M\), not from a runtime assertion. Figure 3 visualises the input set and the structural exclusion that the proof rests on. ◻
Corollary 1 (Iterated invariance). For any finite sequence \(f_1, f_2, \dots, f_k \in \mathcal{F}_{\mathrm{sem}}\) applied in any order, the identity hash remains byte-equal to its initial value.
The lemma is enforced by construction, not by runtime check: the type of \(f\) and the field set of \(M\) are fixed at compile time, so the property cannot be violated by a well-typed implementation. A regression test (Section 4) verifies the property holds for the shipped consolidator, but a test failure would indicate a typing or schema bug, not a violated invariant.
We specify the consolidation algorithm in three modules. §3.2.1 defines the schema of the semantic store. §3.2.2 specifies the deterministic aggregation algorithm that populates that schema from the episodic store, the determinism and idempotence guarantees the algorithm provides, and the role of confidence in keeping the resulting facts honest. §3.2.3 describes the audit chain that keeps every semantic row traceable to its supporting evidence, and the mechanisms the algorithm deliberately leaves out of scope.
The schema fixes the minimal table that v1 writes into and the key under which semantic rows are uniquely addressed. The table is intentionally small:
CREATE TABLE IF NOT EXISTS semantic_facts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
identity_hash TEXT NOT NULL,
fact_kind TEXT NOT NULL,
fact_key TEXT NOT NULL,
fact_value_json TEXT NOT NULL,
last_updated TEXT NOT NULL,
UNIQUE (identity_hash, fact_kind, fact_key)
);
The table is partitioned by identity_hash, mirroring the episodic store. The triple (identity_hash, fact_kind, fact_key) is unique: exactly one current fact exists for each stable key, and updates upsert. The four
fact_kind values that v1 supports in the shipped module are skill_success_rate, object_property, zone_risk, and interaction_pattern. A fact_key is a stable, human-readable string
such as manipulation.grasp + glass_cup + sim_relaxed. The fact_value_json blob carries the recommended parameter (or property value, or failure-pattern descriptor), the number of supporting observations, the success rate where
applicable, an explicit confidence value, the last supporting episodic event id, and the consolidation rule version. The last_updated column records the consolidation checkpoint at which the row was last written.
The algorithm module reads uncommitted episodic rows past the last checkpoint, aggregates them into stable-keyed semantic facts under an explicit confidence value, and guarantees that the resulting snapshot is reproducible byte-for-byte from the same inputs.
A consolidation pass for one identity hash proceeds in five steps. (1) Read: select episodic rows whose timestamp is greater than the last consolidation checkpoint for this identity hash; the checkpoint is itself recorded as an episodic event
of kind consolidation_run, so the next pass resumes cleanly. (2) Extract: project the structured fields already present in each row’s payload (skill_id, target class, environment descriptor, parameter values,
success/failure flag, failure reason); rows whose payloads lack enough structure are skipped, as v1 deliberately does not attempt linguistic abstraction over free-form summaries. (3) Group: bucket the records by stable keys; for
skill_success_rate the natural key is (skill_id, target_class, environment), for interaction_pattern it is (skill_id, target_class, failure_reason). (4) Aggregate: compute counts, success rates,
parameter distributions (mean and a robust band such as the IQR), and the most common failure reason per group. (5) Upsert: write the aggregated value into the semantic table under the unique key, with an updated n_observations
counter (cumulative across passes for this key), a confidence value computed from observation count and variance, and a pointer to the last contributing episodic event id; the consolidation rule version is recorded inside
fact_value_json. §3.2.3 describes the audit-append step that closes the pass.
By construction, two consecutive consolidation passes against the same episodic state and the same rule version produce byte-equal semantic output. The first pass writes; the second pass observes no new episodic rows past the checkpoint and writes
nothing new. Idempotence under partial restart is also preserved: if a pass crashes after writing to semantic but before appending the consolidation_run event, the next pass reprocesses the same range, upserts the same values, and
then appends. No row leaks, no row double-counts. Order-independence within one pass follows because the aggregates are commutative-associative: the order in which episodic rows are extracted does not change the upsert’s final value. Section 4 reports a regression test that shuffles insertion order and asserts byte-equal semantic output, which the shipped consolidator passes on every fixture.
A fact derived from two observations should not have the same planner influence as a fact derived from \(200\). Without an explicit confidence column, downstream planners would treat all facts as equally authoritative, and the system would inherit a brittle preference for the most recently observed pattern. A minimum viable confidence rule combines observation count with within- group variance: more observations and lower variance imply higher confidence; contradictory outcomes (success rate near \(0.5\) with no clean parameter band) imply lower confidence. The exact formula matters less than the discipline of making uncertainty visible to both the planner and the audit chain.
The auditability discipline pairs the algorithm with a self-contained audit chain and an explicit list of mechanisms v1 leaves out of scope. The chain keeps every semantic row traceable to its supporting evidence; the scope list draws a sharp boundary around what v1 does and does not contribute.
After the pass, the runtime appends a consolidation_run event to the episodic store with the rule version, the row range processed (first_processed_event_id, last_processed_event_id), and the count of semantic rows
touched. This keeps the audit trail self-contained: a reviewer asking “why does this skill_success_rate row exist” can walk back through last_supporting_event_id and the consolidation_run event whose row range
contains it. Figure 4 summarises the pass as a five-step pipeline with the audit-append loop.
The deterministic v1 design is not proposed as a complete memory architecture. It defines a minimal substrate with three properties that the proof of identity invariance (Section 3.1) relies on: deterministic execution,
a schema whose hash-input disjointness with respect to \(M\) is checkable at type-design time, and an audit-trace mapping each derived row back to its supporting episodic events. Several mechanisms that a more expressive
memory system would include are explicitly out of scope of v1. Linguistic abstraction over event summaries: v1 aggregates over structured fields only; free-form generalisation of operator notes or failure explanations is not performed. Section 3.3 discusses an LLM-assisted extension that would address this and the additional auditability requirements such an extension introduces. Decay and forgetting: v1 records observation counts and confidence values but
does not model temporal decay; a fact’s confidence does not diminish as supporting evidence ages. The n_observations field is reduced only indirectly through capacity-driven pruning of the underlying episodic store. Adversarial
robustness: v1 assumes a trusted episodic substrate. Defences against an adversary capable of writing poisoned episodic rows are deferred to Section 5, which discusses the failure-mode implications.
Cross-identity transfer: the semantic store is partitioned strictly by identity_hash, so semantic tables associated with distinct agent identities are isolated by construction. Mechanisms for sharing or merging semantic content across
identities are outside the v1 scope. These limitations bound the v1 contribution but do not invalidate it; the remaining construction is a deterministic, identity-invariant consolidation pass whose soundness argument need not be re-derived for richer
mechanisms layered on top.
Some lessons cannot be captured by counters. A robot may need to abstract a free-form pattern such as “when the operator says fragile cup in this workspace, prefer a lower approach speed and require confirmation before raising force.” Such a lesson requires linguistic abstraction over event summaries, operator notes, and failure explanations, not arithmetic over numerical fields. An LLM-assisted consolidation pass is the natural v2.
The primary trade-off is auditability. Deterministic v1 lets the runtime explain a semantic row as a function of input rows and rule code: every row of \(M^{\mathrm{sem}}_{A}{}\) is reproducible from a fixed slice of \(M^{\mathrm{ep}}_{A}{}\) under a versioned, human-readable rule. An LLM-assisted v2 adds a non-deterministic (or, at minimum, model-dependent) summariser between the inputs and the row. Two passes over the same episodic slice may produce different generated facts, and even when they do not, a human auditor cannot inspect the rule that produced them in the way they can inspect a SQL aggregation.
We do not deploy v2 in this work, and we are explicit about why. Several disciplines must be in place before v2 could earn the same audit guarantees v1 has by construction: provenance signing (every LLM-generated semantic row signed by the
consolidating model, with model identity, prompt template version, and decoding parameters recorded in the audit chain); human review gate (generated facts in pending_review state until a reviewer approves, excluded from the
planner-facing query endpoint until then); bounded vocabulary (generated fact_kind values restricted to a closed schema, even if content is free-form, so downstream planners do not encounter silently-introduced categories); and
stable comparison oracle (v1 outputs remain a baseline; a v2 fact that contradicts a v1 fact derived from the same episodic slice flags for review, never silently overrides). These disciplines are tractable, but each is non-trivial and we view
their composition as a research question rather than an immediate engineering target. Shipping v1 first lets the runtime accumulate operational evidence about which fact kinds are worth abstracting and where human-review fatigue arises, empirical questions
whose answers should shape v2’s design. We therefore mark v2 as future work and reserve no unimplemented hooks for it in v1.
Semantic memory is useful only when downstream planners can consume it without that consumption turning it into identity state. The shipped interface is a read-only HTTP endpoint with an explicit request and response contract, an information-not-authority discipline, and a fact-consultation audit trail.
The endpoint exposes semantic facts for one agent identity at a time:
GET /api/agent/semantic
?skill_id=<string>
&target_class=<string>
&env=<string>
The agent identity is resolved from the authenticated session, not passed as a query parameter, so a mis-authenticated request cannot read another agent’s semantic store. Request parameters select the fact_kind subset and the stable-key
components from §3.2.1. The response is a list of top-ranked facts ordered by confidence; each fact carries the recommended parameter value (or property, or failure-pattern descriptor), the confidence, the
n_observations count, the last_supporting_event_id, and the consolidation rule version that produced the row. A planner about to issue a manipulation.grasp intent can prepend a short grounding block (“known facts
for this robot: grasp + glass_cup + sim_relaxed: recommended_force_n = 25, confidence = 0.83, n_observations = 15”) into its prompt before generating the structured intent. The integration deliberately echoes existing prompt-grounding conventions:
facts in, structured action out, so planners already wired for retrieval-augmented prompting adopt semantic memory with minimal change.
The runtime does not require planners to use these facts. The boundary between planner and runtime is a protocol: the planner emits a structured intent, the runtime gates it. A planner that ignores the semantic endpoint still emits intents and still passes through admission, policy, contract, and audit gates. A planner that consumes the endpoint can propose better parameters, but those parameters remain subject to runtime policy clamps, contract checks, and audit. Semantic memory is an information surface, not an authority surface.
Every consumption should be auditable. When a planner includes semantic facts in the grounding for a structured intent, the intent payload (or the audit trace recorded as it passes through the runtime) should include the consulted fact ids. If a future failure occurs, a reviewer must be able to identify both the action the agent took and the consolidated knowledge that helped shape the proposed action. Because v1 facts are themselves traceable to supporting episodic rows and the consolidation rule version, the chain runs all the way back from “action taken” through “intent generated” through “facts consulted” through “supporting events,” without ever crossing the identity manifest.
The deterministic consolidation pass described in Section 3.2 is implemented in the underlying runtime as a single module of approximately \(1040\) lines of Python (reproducibility anchor:
commit 16b92b7), accompanied by a regression suite of roughly \(760\) lines and more than \(20\) test cases covering the four fact_kind categories of Section 3.2.1 together with the identity-invariance and idempotence claims of Section [sec:v1-determinism]. The runtime invokes the
consolidator at startup and again on each episodic write through a threshold-driven post-record hook, so the construction is exercised on the same write path that produces the audit trail on which it depends. Two follow-on items remain queued for
subsequent work: bundle export of the semantic facts under the identity-hash partitioning, and a typed event emitted on threshold-triggered consolidation passes. The consolidation pass developed in this paper is therefore an in-tree shipped artefact, not a
planned one.
What we defer to a follow-on note is production traffic data: a real fleet’s episodic stream long enough to drive non-trivial consolidation has not yet accumulated, and we do not fabricate a synthetic substitute for it. The validations below are deterministic correctness checks against synthetic episodic streams.
A synthetic episodic database receives \(N=1000\) execution_result rows for manipulation.grasp (\(800\) success, \(200\)
failure). One pass of SemanticConsolidator.consolidate produces exactly one semantic_facts row of type skill_success_rate with value_json = {n: 1000, success: 800, rate: 0.8} and
source_count = 1000, matching the Section 3.2.1 schema bit-for-bit. A second pass on the same database upserts zero rows and produces a snapshot byte-equal to the first (idempotence). On a fresh
database, the same \(1000\) rows inserted in a deterministic-shuffle order produce a snapshot byte-equal (modulo source-id ordering) to the unshuffled run (order invariance). All six per-field correctness
checks pass.
A PersistentAgent-equivalent IdentityManifest snapshot is taken; the consolidator runs against an episodic stream of \(100\) execution_result rows; semantic_facts ends
with \(1\) row; the manifest is recomputed and the hash is byte-equal to the snapshot (5f6c5afc6b3924ba4a328138…). A second consolidation pass produces the same hash. Mutating one of the seven manifest inputs
(the ecm_registry_hash, simulating a registered- capability addition) flips the manifest hash to c778ffffc51d1346bb014770…, confirming the manifest itself is identity-bearing and the invariance result is not a degenerate all-zeros
artefact.
The driver injects \(200\) episodic rows for manipulation.grasp.glass_cup (\(80\%\) success rate hidden from the planner) and \(50\) rows for
manipulation.grasp.unknown_object (\(20\%\) success), then runs \(N=1000\) decisions over a synthetic scene under four planner configurations. The no-memory control
attempts every grasp regardless of skill. The three grounded controls all read semantic_facts and threshold attempts at confidence \(\geq 0.5\), but differ in how the confidence is weighted: raw uses
the consolidator’s success-rate as-is; uniform overrides every consolidator-known skill’s confidence to \(1.0\), isolating the value of the structure (a fact exists / does not exist) from the value of any rate
signal; calibrated applies Bayesian shrinkage of each per-skill rate against a held-out \(20\%\) slice of its outcome history (prior mean \(0.5\), prior weight \(10\), chosen ex ante). Table 1 reports the result.
| Control | Att.mean | Unprod.mean | Rate mean | Reduction mean | \(95\%\) BCa CI |
|---|---|---|---|---|---|
| no_memory | \(1000.0\) | \(497.5\) | \(0.498\) | — | — |
| uniform | \(1000.0\) | \(510.2\) | \(0.510\) | \(-2.6\%\) | \([-4.7\%, +0.4\%]\) |
| raw | \(544.4\) | \(109.7\) | \(0.201\) | \(79.82\%\) | \([78.02\%, 81.49\%]\) |
| calibrated | \(544.4\) | \(109.7\) | \(0.201\) | \(\mathbf{79.82\%}\) | \(\mathbf{[78.02\%, 81.49\%]}\) |
The headline reduction is the calibrated-vs-no_memory mean across \(10\) seeds: \(79.82\%\) fewer unproductive attempts on \(N=1000\)
decisions per seed, with \(95\%\) BCa bootstrap CI \([78.02\%, 81.49\%]\) over \(10\,000\) resamples (Figure 5). The
originally-published single-seed value of \(74.58\%\) (seed``=``20260506) sits \({\approx}4\) percentage points below the CI lower bound: the published seed turned out to be the
unfavourable minimum of the \(10\)-seed distribution rather than a cherry-picked maximum, and so the prior single-seed claim under-stated rather than over-stated the effect. The uniform control’s \(95\%\) CI straddles zero (\([-4.7\%, +0.4\%]\)), statistically confirming that bare consolidation structure (a fact exists / does not exist) does not improve over no-memory when the confidence
signal is removed. The calibrated and raw controls produce a byte-equal attempt set on every seed in this \(10\)-sample sweep because the Bayesian-shrunk rate for unknown_object (\(\approx 0.3\)) remains below the \(0.5\) threshold while the shrunk rate for glass_cup (\(\approx 0.9\)) remains above, on every seed; the audit’s
straw-man critique (that the no-memory baseline inflates the apparent improvement) is therefore answered structurally and across-seed-robustly. The runtime’s safety clamp is held constant across all four configurations, so the reduction is attributable to
the planner’s grounding-aware decision rule and not to a different safety budget. Each control on each seed runs deterministically in under \(4\) s on a single CPU core (\({\approx}20\) s
wall for the full \(10\,{\times}\,3\) sweep). Per-control raw outputs, the combined summary, and the bootstrap configuration are reproducible from the public release as described in §4.0.0.7.
Three design choices were fixed ex ante for the V3 ablation: the attempt threshold (\(0.5\)), the Bayesian shrinkage prior (mean \(0.5\), weight \(10\)),
and the per-seed decision count (\(N=1000\)). We sweep each in turn while holding the other two at their defaults and re-run the calibrated control over the same \(10\)-seed set used in
Table 1. Tables 2–4 report the resulting calibrated reductions with \(95\%\) BCa bootstrap confidence intervals (\(10\,000\) resamples, random_state``=``20260524). The headline reduction is robust along the entire \(\mathrm{threshold}
\in [0.5, 0.7]\) plateau, across the entire \(\mathrm{prior\_mean} \in
\{0.3, 0.5\}\) row of the \(3{\times}3\) prior grid, and for every \(N \geq 500\). Two collapse regions lie outside the chosen defaults and correspond to specific failure mechanics
rather than threshold sensitivity: \(\mathrm{threshold} \leq 0.3\) falls below the calibrated unknown_object rate (\(\approx 0.3\)) so the planner attempts every decision; and
\(\mathrm{prior\_mean} = 0.7\) with high weight (\(20\)) lets the prior dominate the small holdout slice (10 outcomes for unknown_object), again inflating the shrunk rate above
the cutoff. Neither region would be a defensible default; the chosen defaults sit in the safe interior of the swept landscape.
| Threshold | Mean reduction | \(95\%\) BCa CI |
|---|---|---|
| \(0.3\) | \(-2.6\%\) | \([-4.7\%, +0.4\%]\) |
| \(0.4\) | \(55.0\%\) | \([28.3\%, 73.0\%]\) |
| \(\mathbf{0.5}\) (default) | \(\mathbf{79.82\%}\) | \(\mathbf{[78.0\%, 81.5\%]}\) |
| \(0.6\) | \(79.82\%\) | \([78.0\%, 81.5\%]\) |
| \(0.7\) | \(81.6\%\) | \([78.8\%, 88.3\%]\) |
| prior_mean \(\backslash\) weight | \(5\) | \(10\) (default) | \(20\) |
|---|---|---|---|
| \(0.3\) | \(79.82\%\) | \(79.82\%\) | \(79.82\%\) |
| \(\mathbf{0.5}\) (default) | \(79.82\%\) | \(\mathbf{79.82\%}\) | \(79.82\%\) |
| \(0.7\) | \(63.7\%\) | \(55.0\%\) | \(-2.6\%\) |
| \(N\) | Mean reduction | \(95\%\) BCa CI |
|---|---|---|
| \(100\) | \(80.4\%\) | \([75.2\%, 84.9\%]\) |
| \(500\) | \(79.9\%\) | \([77.9\%, 81.9\%]\) |
| \(\mathbf{1000}\) (default) | \(\mathbf{79.82\%}\) | \(\mathbf{[78.0\%, 81.5\%]}\) |
| \(5000\) | \(79.8\%\) | \([79.4\%, 80.3\%]\) |
| \(10000\) | \(79.9\%\) | \([79.4\%, 80.3\%]\) |
Per-sweep summaries (machine-readable JSON, CSV) and the \(190\) per-run output files are reproducible from the multi-knob CLI loop described in §4.0.0.7.
A production deployment of the deterministic consolidation pass imposes the costs reported in Table 5 and visualised in Figure 6. Per-pass latency scales sub-linearly with input
size, ranging from \(40\) ms on \(N{=}10^2\) episodic rows to \(309\) ms on \(N{=}10^5\); the semantic_facts
table grows by \(O\)(distinct fact-key count), which on the V3 two-skill synthetic stream is exactly \(2\) rows regardless of episodic input size up to \(10^5\) rows, with the \(20\) KB DB-file delta dominated by SQLite’s \(4\) KB page granularity rather than fact-row content; the SQL query the planner-facing
endpoint would issue (SELECT ... FROM semantic_facts WHERE identity_hash ``=`` ? AND fact_type ``=`` ?) returns in \(0.004\) ms at the \(99^{th}\) percentile across \(1000\) requests, on both small and large fact tables; and the consolidator process holds a stable \(60\) MB resident set with a \(15\) MB peak delta at \(10^5\) rows. These numbers make the construction cheap enough to invoke on every episodic write through the post-record hook described above, without observable planner-loop impact. The HTTP wrapper at
GET /api/agent/semantic is deferred to a follow-on; the reported query latency is the in-process SQLite lower bound (HTTP/uvicorn typically adds \(1\)–\(3\) ms).
| Metric | Units | \(N{=}10^2\) | \(N{=}10^3\) | \(N{=}10^4\) | \(N{=}10^5\) |
|---|---|---|---|---|---|
| Per-pass latency (median) | ms | \(39.9\) | \(38.8\) | \(67.9\) | \(309.0\) |
| Per-pass latency (p90) | ms | \(46.9\) | \(42.0\) | \(74.8\) | \(324.5\) |
| rows after pass | count | \(2\) | \(2\) | \(2\) | \(2\) |
| DB size delta | KB | \(20\) | \(24\) | \(20\) | \(20\) |
| Query latency (p50) | ms | \(0.003\) | — | — | \(0.002\) |
| Query latency (p99) | ms | \(0.004\) | — | — | \(0.004\) |
| Consolidator RSS baseline | MB | — | \(60\) | — | \(60\) |
| Consolidator RSS peak | MB | — | \(60\) | — | \(75\) |
| Claim | Status | Evidence |
|---|---|---|
| \(\Msem\) outside manifest hash inputs | design + code inspection | Manifest dataclass field set fixed at type-design time |
| Episodic substrate exists | shipped | Episodic store module with \(20+\) regression tests |
| Capability-evolution identity invariance | shipped | Identity byte-equality regression test |
| Consolidation v1 extracts facts correctly | shipped + measured | V1: \(6/6\) per-field checks; idempotent; order-invariant |
| Consolidation preserves identity hash | shipped + measured | V2: byte-equal across passes; mutation detected |
| Grounding reduces unproductive attempts | shipped + measured | V3: \(79.82\%\) mean reduction with \(95\%\) BCa CI \([78.02\%, 81.49\%]\) over \(10\) seeds \(\times\) \(N=1000\) decisions (calibrated vs.no-memory) |
| V3 robust to ad-hoc design choices | measured | D: \(\pm 2\) pp across swept threshold/prior/N ranges containing defaults (Tables [tbl:tab:d-threshold]–[tbl:tab:d-n]) |
| Production-cheap runtime overhead | measured | G: \(\leq 309\) ms / pass at \(10^5\) rows; constant size; sub-ms SQL query (Table [tbl:tab:g-runtime]) |
From a runtime checkout with the [bridge,dev] extras installed, .venv/bin/python scripts/consolidation_validation.py writes paper_data/validation_results.json and prints a single-line JSON summary to stdout. The V3
ablation in Table 1 is reproduced by re-running the same driver with -``-``confidence-weighting {raw,uniform,calibrated}; the default is raw with seed \(20260506\) so the test_consolidation_validation.py historical \(74.58\%\) assertion continues to pass byte-stably. The multi-seed sweep used in Table 1 is reproduced by looping the same driver over seeds [20260506, 20260507, 20260513, 20260517, 20260519, 20260523, 20260529, 20260531, 20260601, 20260607] via the new -``-``seed flag, then
aggregating with scipy.stats.bootstrap (BCa, \(10\,000\) resamples, random_state``=``20260524). Raw outputs, the combined summary, and the per-seed CSV are reproducible by aggregating the per-seed
JSONs locally (§4.0.0.7). Pass --quick for a single-control smoke run with smaller \(V1\)/\(V3\) sample sizes (\(\sim 1\) s wall clock).
The reference implementation analysed above is released as a slim public artefact at https://github.com/s20sc/semantic-consolidation-ref under an MIT license, with the
submission-time snapshot tagged v0.1.0-ins-submission and fixed to the parent runtime’s anchor commit 16b92b7. The reviewer-facing README.md reproduces every command appearing in the preceding paragraph, the
tests/ suite ships the \(> 20\) regression cases that back the identity-invariance and idempotence claims of Section [sec:v1-determinism], and the paper_data/ directory ships the headline validation JSON (validation_results.json, with companion SHA256SUMS) backing the published single-seed
\(74.58\%\) V3 value (the seed``=``20260506 entry in Table 1), so that a checksum match certifies a byte-stable re-run.
The contribution rests on three commitments the runtime makes elsewhere. One robot is one persistent agent: semantic memory respects this by partitioning facts strictly by identity hash; consolidation never synthesises a “helper agent” inside the robot to hold facts separately. Governance is a runtime property: a planner that consumes semantic facts still passes through admission, policy, and contract gates, so even maximally informative facts cannot bypass runtime safety. Audit is structural: every semantic fact is traceable to its supporting episodic events and the consolidation rule version that produced it, because the chain is recorded in the same store the runtime already treats as the audit substrate.
Reflexion [9] and related self-reflection loops improve behaviour by inserting verbal lessons into future context. This is effective for language agents whose policy is the LLM and whose context window is the runtime substrate. For embodied agents under runtime governance, the same mechanism inherits a problem: any verbal lesson powerful enough to change behaviour is also powerful enough to amount to identity drift, because the artefact that learns is also the artefact that is deployed. The construction here keeps lessons in a separate, queryable, audited layer. Lessons are facts, not prompt mutations. The identity manifest is unchanged. Planners that consume facts may propose different intents, but the bridge gates, not the prompt, decide whether intents become actions. Planners that ignore semantic memory entirely face the same gates as planners that consume it, so no bypass exists.
An agent with new semantic facts is operationally changed: it may propose better parameters, prefer different planners for known environments, or demand perception rechecks for known- fallback-prone manipulations. Operationally, week \(52\) of deployment should look measurably different from week \(1\); that is the point of remembering. But the same agent is not identity-changed in the runtime’s compliance sense: the certificate that defines this agent for operators, insurers, and auditors has not moved. Calibration grew; the contract did not break. This is the core of “learning without becoming someone else,” and it is the regime in which long-running embodied deployment becomes auditable.
A consequence of treating consolidation as a versioned function is that the rule set itself becomes a governed artefact. Changes to the aggregation logic, the confidence formula, or the supported fact kinds can change downstream planner behaviour even
when no episodic row changed. The runtime addresses this by recording the rule version on every semantic row, by appending a consolidation_run event to the episodic store on every pass, and (for richer rule deployments) by routing rule updates
through the same staged-rollout discipline used for capability updates. Consolidation is therefore not outside governance; it is another governed runtime process.
Several limits are inherent in the deterministic consolidation design. Structured aggregates only: the algorithm captures facts expressible as counts, success rates, parameter bands, and most-common failure reasons over already-structured
payload fields; it does not capture narrative lessons or facts that require linguistic synthesis (deferred to an LLM-assisted extension, §3.3). No decay or forgetting: the algorithm has n_observations and
confidence but no formal decay model; a fact derived from observations a year old is treated identically to a fact derived from observations from last week, given the same count and variance. No adversarial defence against poisoned
episodic rows: the algorithm trusts the episodic store; an attacker who can write episodic rows can shift semantic aggregates. Episodic provenance signing is the obvious mitigation but is out of scope here. Long- horizon drift in planner
behaviour: even though identity is invariant, downstream planner behaviour can drift over many years of accumulated facts; this is not a contradiction (it is the intended effect) but operators should monitor how the fact set evolves across long
deployments. Episodic payload structure is assumed: the algorithm depends on episodic payloads carrying enough structured fields for grouping; capabilities emitting only free-form summaries are invisible to aggregation. Adaptive temperament is
out of scope: semantic memory may inform planner proposals but it must not become a hidden route for changing the agent’s risk appetite, ethical floor, or human-check thresholds; those quantities belong to a separate discipline of governed temperament
adaptation under operator authority.
By defining \(M^{\mathrm{sem}}_{A}= f(M^{\mathrm{ep}}_{A})\) and keeping \(M^{\mathrm{sem}}_{A}\) outside the manifest hash, a runtime governance layer for embodied robots gains a path to learn operational facts while preserving identity. Deterministic consolidation is modest, auditable, and implementable. It turns episodic history into planner-usable knowledge without mutating the agent’s certificate of identity. The agent that remembers events becomes the agent that learns from them, without becoming a different agent in any sense the auditor, the insurer, or the operator can detect. That asymmetry, operationally changed and identity-unchanged, is the regime in which long-running autonomic deployment becomes sustainably auditable. Future directions include extending the substrate with an LLM-assisted layer (§3.3) once provenance signing and a human-review gate are in place, adding a decay-and- forgetting discipline that preserves byte-equal reproducibility, signing episodic rows at producer time to close the trust-the-substrate gap, and supporting operator-mediated cross-identity fact transfer for governed fleet learning.