Skip to content

V2.8.0

Choose a tag to compare

@liuqin164 liuqin164 released this 19 Jun 13:18
· 18 commits to main since this release
39af6c7

Cogmem 2.8.0 — Memory Binding v1.5 and Governed Memory Foundation

Cogmem 2.8.0 introduces the next step toward a governed agent-memory brain: Memory Binding v1.5, activation-aware graph edges, transactional memory governance plans, and a formal schema migration path.

This release moves Cogmem beyond basic graph-recall stabilization. The memory system now has stronger primitives for stable topic routing, claim-key separation, correction-aware graph edges, read-only graph inspection, and CPU-validated semantic memory operations.

Highlights

  • Added Memory Binding v1.5 primitives:

    • TopicPathRegistry
    • ClaimKeyGenerator
    • BindingDecisionEngine
    • improved deterministic BindingClassifier
  • Added activation-aware weighted memory graph edges.

  • Added bounded read-only graph traversal through BrainGraphView.

  • Added evidence-backed MemoryGovernancePlan.

  • Added strict CPU-side validation for memory governance operations.

  • Added transactional governance execution and audit records.

  • Added schema version 15 and a new cogmem migrate command.

  • Updated cogmem update --yes to install from GitHub Releases and run schema migration with backup.

  • Added regression tests for binding v1.5, governance validation, transaction rollback, migration, and CLI behavior.


Memory Binding v1.5

Stable topic path registry

Cogmem now includes a TopicPathRegistry for CPU-canonicalized topic paths.

The registry maps multilingual and variant topic labels into stable canonical paths. For example:

memory storage
memory write
memory pipeline
记忆写入
记忆存储
写入管线

are canonicalized under:

PROJECT/Cogmem/memory-write-pipeline

This reduces topic-path drift and prevents arbitrary model-generated paths from becoming durable organization structure.

Claim-key separation

Cogmem now includes a ClaimKeyGenerator.

This separates distinct claims under the same topic path. For example:

写入时不看历史
分类树会漂移
context pollution
source fidelity

can now become different claim keys instead of being over-fused into one broad cluster.

This is an important step toward preventing large topic clusters from becoming mixed, noisy, or semantically overloaded.

Binding decision engine

Cogmem now includes a BindingDecisionEngine.

It classifies new high-value raw user events as:

create_new_cluster
attach_to_existing
strengthen_existing
possible_conflict
corrects_prior_memory
refines_prior_memory
needs_review

This lets the binding layer distinguish new claims, repeated support, and correction signals instead of treating every new event as an isolated memory row.

Improved binding classifier

The deterministic binding classifier now uses the new registry and claim-key modules.

It recognizes project aliases such as:

Cogmem
memory kernel
记忆内核
agent brain
OpenClaw
Lobster
Hermes

It also strips volatile Cogmem context blocks before binding:

<COGMEM_RECALL_CONTEXT>
<COGMEM_TURN_BRIDGE>
<COGMEM_SESSION_STATE>

These blocks remain context scaffolding and must not become durable user memory.


Activation-Aware Memory Graph Edges

Memory graph edges now distinguish:

confidence
baseWeight
stability
activation
validFrom
validTo
version
sourceAuthority

This separates historical truth/provenance from current surfacing priority.

In practical terms:

confidence = how strongly the evidence supports the relation
stability = how durable the relation is
activation = how likely it should surface now

Maintenance decay can reduce activation without weakening provenance confidence or long-term stability.

This allows Cogmem to forget what is currently relevant without corrupting why a memory was originally accepted.

New edge semantics

The binding graph now supports correction and contradiction relationships:

CORRECTS
CONTRADICTS
REFINES
SUPERSEDES

Correction events can now point back to earlier same-topic evidence instead of simply creating a generic conflict cluster.


Read-Only Brain Graph View

Cogmem now includes a bounded read-only graph traversal surface:

BrainGraphView

It can inspect active graph neighbors up to a bounded hop limit and return:

rootId
nodeIds
edges
evidenceEventIds
truncated

This is intentionally read-only. It provides graph visibility for agents and debugging without allowing graph mutation through the inspection interface.


Memory Governance Plan Foundation

Cogmem 2.8.0 introduces a new MemoryGovernancePlan abstraction.

A governance plan contains evidence-backed semantic memory operations such as:

BIND_EVENT
RECLASSIFY_TOPIC
MERGE_CLUSTER
SPLIT_CLUSTER
LINK_ENTITY_ALIAS
MERGE_ENTITY
CREATE_BELIEF
REINFORCE_BELIEF
SUPERSEDE_BELIEF
REJECT_BELIEF
CREATE_TIME_ANCHOR
EXPIRE_TIME_ANCHOR
CREATE_PROSPECTIVE_MEMORY
RESOLVE_PROSPECTIVE_MEMORY

This is the foundation for future Belief Graph, Entity Brain, Temporal Memory, and Intent Cortex work.

Evidence and ownership requirements

Every governance operation must include:

operationId
operation type
projectId
evidenceEventIds
sourceRole
ownership
idempotencyKey
payload

The CPU validator rejects unsafe operations before persistence.

It rejects:

missing evidence
unknown raw evidence
cross-project evidence references
user-owned memory without explicit user-role evidence
invalid expected versions
duplicate operation ids
duplicate idempotency keys

This keeps user-owned durable memory from being created from assistant-only or tool-only evidence.

Transactional execution

MemoryGovernanceExecutor applies governance plans in a single SQLite transaction.

If any operation fails:

projection writes are rolled back
operation records are rolled back
audit records are rolled back

If the same plan or idempotency key is replayed, the executor avoids double-application.

Governance audit records

Applied governance operations are recorded in:

memory_governance_plans
memory_governance_operations
memory_governance_audit

This gives Cogmem a durable audit trail for future belief promotion, belief supersession, entity merging, temporal versioning, and prospective memory.


Schema Version 15 and Migration CLI

Cogmem now includes schema migration support.

A new migration was added:

0015_memory_governance

It creates governance tables and upgrades memory_edges with activation-aware edge columns.

New command

cogmem migrate

Supported options:

--db <memory.db>
--config <config.toml>
--dry-run
--yes
--backup
--json

By default, migration runs in dry-run mode unless --yes is provided.

Legacy adoption

The migration runner can adopt an existing _meta.schema_version and mark earlier migrations as already applied.

This allows existing 2.7.x databases to move forward without replaying obsolete migrations.

Backup support

When running:

cogmem migrate --yes --backup

Cogmem creates a timestamped backup of the database before applying schema changes.

Update command integration

cogmem update --yes now:

resolves the selected GitHub Release
installs the release asset
runs cogmem migrate --yes --backup using the newly installed package

Dry-run mode exposes the planned install and migration command without writing.


Memory Map and Maintenance Tick Updates

The memory self-map now exposes memory binding as an explicit data lane.

It includes:

memory bindings
topics
entities
clusters
edges

The maintenance tick now reports:

unboundRawEvents
bindingFailures

and may suggest:

cogmem memory bind --project <id> --json

when high-value raw user events have not yet been attached to memory binding clusters.

If non-fatal binding failures were recorded, the tick suggests inspection while preserving the raw ledger as authoritative.


Public API Updates

The public API now exports memory binding types, including:

MemoryBindingRecord
MemoryBindingStats
MemoryBindingType
MemoryBindingAction
MemoryClusterRecord
MemoryClusterStatus
MemoryEdgeRecord
MemoryEdgeRelation
MemoryEntityRecord
MemoryEntityType
MemoryGraphRecallAnchor
MemoryTopicRecord

This allows host integrations and agent runtimes to inspect the binding graph without depending on internal implementation modules.


Tests Added

New regression coverage includes:

Memory Binding v1.5

  • multilingual topic alias canonicalization;
  • unsafe topic path normalization;
  • claim-key separation under the same topic;
  • correction and reinforcement binding decisions;
  • activation decay without confidence or stability decay;
  • bounded read-only graph traversal with provenance.

Memory Governance

  • rejection of durable operations without raw evidence;
  • rejection of user-owned memory without explicit user evidence;
  • idempotent execution;
  • rollback of operation effects and audit records on failure.

Schema Migration

  • dry-run planning without mutation;
  • transactional migration application;
  • idempotent repeated migration;
  • schema version update from 14 to 15;
  • migration backup creation.

CLI Update Flow

  • update command now reports the migration command;
  • update flow includes cogmem migrate --yes --backup.