Skip to main content
← CONCEPTS / AI-MACHINE-LEARNING
An end-to-end domain learning journey

Enterprise Agentic Memory, Bi-Temporal
Knowledge Graphs & Decay.

Scale agentic long-term memory across 50M+ namespaces without contradiction poisoning, HNSW post-filtering collapse, or slow GDPR erasure.
Start the journey7 sections· Last modified Nov 24, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

If model quality drifts from offline training baselines, Bi-Temporal Knowledge Graphs & Decay, pair a 3-tier memory hierarchy (Redis + Qdrant filterable HNSW + Neo4j bi-temporal KG) with async 8B SLM ADD/UPDATE/DELETE/NOOP conflict resolution, Ebbinghaus decay, and KMS DEK crypto-shredding.

TL;DR30-second simplified summary
▾

Scaling agent memory to millions of namespaces requires a synchronous 3-way read path (Redis <=3ms, Qdrant Int8 HNSW <=12ms, Neo4j <=15ms) and an asynchronous Kafka + 8B SLM write path.

The SLM emits ADD, UPDATE, DELETE, or NOOP mutations against bi-temporal edges (t_valid, t_invalid). Lazy Ebbinghaus decay R(t) = exp(-ddt/(SI)) re-ranks results at query time without batch sweeps.

Full walkthrough · 7 stages
01
foundation

Contradiction Poisoning & HNSW Post-Filtering Collapse.

Why this matters: Understand why append-only vector databases fail as long-term agent memory.

Think of Contradiction Poisoning & HNSW Post-Filtering Collapse as the intuition layer for Enterprise Agentic Memory, Bi-Temporal Knowledge Graphs & Decay: Understand why append-only vector databases fail as long-term agent memory.

In an append-only vector store, updating a user's city from Seattle to Austin leaves both embeddings in the index, causing contradictory top-k retrieval. Furthermore, across 50M tenant namespaces, naive HNSW post-filtering retrieves global top-100 neighbors and then filters by tenant_id—returning zero matches when a tenant owns <0.001% of the corpus.

Stage 1 • Failure Modes

Append-Only Poisoning & Post-Filter Collapse

Append-Only VectorDBbottleneckUnfiltered GlobalHNSWcomputePost-Query TenantFilterfailure0 Matches /ContradictionriskDrops 99.99% of candidates

1.Contradiction Poisoning: Old and new facts share identical cosine similarity.

2.Post-Filter Collapse: Global top-100 misses sparse tenant vectors completely.

Append-only embeddings and post-filtered HNSW collapse under contradictions and multi-tenancy.

02
foundation

3-Tier Memory Hierarchy (Working, Episodic, Bi-Temporal Graph).

Why this matters: Organize memory into Redis Working RAM, Qdrant Int8 HNSW, and Neo4j/FalkorDB KG.

Think of 3-Tier Memory Hierarchy (Working, Episodic, Bi-Temporal Graph) as the intuition layer for Enterprise Agentic Memory, Bi-Temporal Knowledge Graphs & Decay: Organize memory into Redis Working RAM, Qdrant Int8 HNSW, and Neo4j/FalkorDB KG.

A 3-tier hierarchy matches each recall pattern to its optimal engine: Tier 1 (Redis Cluster DRAM, <=3ms) holds active sliding session context; Tier 2 (Qdrant Int8 Filterable HNSW, <=12ms) performs single-pass bitset-masked semantic search over episodic turns; Tier 3 (Neo4j/FalkorDB, <=15ms) traverses structured entity relationships for multi-hop reasoning.

Stage 2 • 3-Tier Hierarchy

Working RAM + Filterable HNSW + Bi-Temporal KG

Tier 1: Redis DRAMcacheTier 2: Qdrant Int8indexTier 3:Neo4j/FalkorDBstorageRRF Context MergercomputeStreams episodic matches

1.Filterable HNSW: Bitset masks restrict graph traversal to the target namespace.

2.<=25ms Combined SLA: Parallel 3-way scatter-gather avoids sequential latency.

Parallel 3-tier memory fuses fast session cache, filterable HNSW, and structured graph edges.

Engineering Decision Framework
Problem
How to implement Enterprise Agentic Memory, Bi-Temporal Knowledge Graphs & Decay without hitting unbounded tail latency, state divergence, or operational fragility.
Naive Solution
Use a single unpartitioned path with unbounded retries and synchronous global coordination.
Why It Fails
Global coordination serializes throughput under load, while unbounded retries amplify transient stalls into full outages.
Alternatives
Compare synchronous strict-consistency paths against bounded asynchronous replication, local caching, or partitioned ownership.
Engineering Decision
If model quality drifts from offline training baselines, bi-Temporal Knowledge Graphs & Decay, pair a 3-tier memory hierarchy (Redis + Qdrant filterable HNSW + Neo4j bi-temporal KG) with async 8B SLM ADD/UPDATE/DELETE/NOOP conflict resolution, Ebbinghaus decay, and KMS DEK crypto-shredding.
Trade-Offs
Gains predictable p99 latency and fault isolation in exchange for explicit bounding, observability, and slightly higher implementation complexity.
Decision Exercise · Make the Call

When Enterprise Agentic Memory, Bi-Temporal Knowledge Graphs & Decay experiences a sudden 5x traffic spike alongside a slow downstream dependency, which engineering choice best protects system stability?

03
intermediate

Bi-Temporal Fact Model (t_valid vs t_created).

Why this matters: Track both world-time validity and system-time transactions for point-in-time audits.

Think of Bi-Temporal Fact Model (t_valid vs t_created) as the intuition layer for Enterprise Agentic Memory, Bi-Temporal Knowledge Graphs & Decay: Track both world-time validity and system-time transactions for point-in-time audits.

Every graph edge and fact carries four timestamps: t_valid and t_invalid (when the fact was true in the real world) plus t_created and t_deleted (when the system recorded it). Active queries automatically inject t_invalid IS NULL AND t_deleted IS NULL, while compliance audits can reconstruct exact agent knowledge at any historical timestamp without mutating history.

Stage 3 • Temporal Invariants

Bi-Temporal Edge Model (World Time vs System Time)

Old Edge: SeattlestorageNew Edge: AustinstorageQuery InvariantguardPoint-in-Time AuditoutputMatched by active recall

1.Non-Destructive: Historical facts are closed (t_invalid = now()), never overwritten.

2.Audit-Ready: Supports 'what did the agent know on Oct 15?' queries.

Bi-temporal edges separate world validity from system transaction time for lossless audits.

04
intermediate

Async Kafka + 8B SLM Conflict Resolver (ADD/UPDATE/DELETE/NOOP).

Why this matters: Decouple 800ms LLM fact extraction from the <=5ms synchronous write acknowledgment.

Waiting for an LLM to extract triplets on the hot write path would add 800ms of blocking latency.

Instead, writes append to Tier 1 Redis and a Kafka ingestion topic in <=5ms.

Stage 4 • Async Conflict Loop

Kafka -> 8B SLM -> ADD / UPDATE / DELETE / NOOP

Sync Write Ack(<=5ms)ingress8B SLM ExtractorcomputeConflict ResolverguardQdrant + Neo4jCommitstorageCompares vs active facts

1.<=5ms Write Ack: User turns never block on 800ms LLM extraction.

2.Deterministic 4 Ops: ADD, UPDATE, DELETE, NOOP prevent duplicate/stale edges.

Async Kafka + 8B SLM extraction resolves factual conflicts without blocking interactive turns.

05
intermediate

Lazy Ebbinghaus Decay & Reciprocal Rank Fusion (RRF).

Why this matters: Rank retrieved memories by semantic relevance, graph proximity, and spaced-repetition decay.

Think of Lazy Ebbinghaus Decay & Reciprocal Rank Fusion (RRF) as the intuition layer for Enterprise Agentic Memory, Bi-Temporal Knowledge Graphs & Decay: Rank retrieved memories by semantic relevance, graph proximity, and spaced-repetition decay.

Updating decay scores across 100B facts via nightly batch jobs is computationally impossible. Instead, Ebbinghaus retention R(t) = exp(-(d * dt) / (S * I)) is evaluated lazily at query re-ranking time over the top-k candidates returned by RRF, where dt is elapsed time since last recall, S is stability (incremented on recall), and I is intrinsic importance.

Stage 5 • Lazy Retention

RRF + Lazy Ebbinghaus Decay Re-Ranking

3-Tier Top-KCandidatesingressLazy EbbinghausScorercomputeStability Boost(S+1)updateRanked AgentContextoutputSelects top-N context

1.Zero Batch Sweeps: Lazy query-time math avoids touching 100B cold facts.

2.Spaced Repetition: Frequently recalled facts gain higher stability S.

Lazy Ebbinghaus scoring at RRF time prioritizes fresh, important memories with zero batch overhead.

06
advanced

Hedged Scatter-Gather Reads to Tame 3-Way Tail Amplification.

Why this matters: Bound 3-way scatter-gather p99 latency under 25 ms despite independent tail skew.

Think of Hedged Scatter-Gather Reads to Tame 3-Way Tail Amplification as the intuition layer for Enterprise Agentic Memory, Bi-Temporal Knowledge Graphs & Decay: Bound 3-way scatter-gather p99 latency under 25 ms despite independent tail skew.

A parallel read across 3 tiers with independent 99% reliability suffers tail amplification: 1 - 0.99^3 = 2.97% of requests hit a tail delay. Dispatching a hedged read to a replica if any tier exceeds its p95 threshold (e.g., 8.5 ms) and cancelling the slower flight drops tail delay probability to ~0.12% for just ~5% extra read traffic.

Stage 6 • Tail Latency

8.5ms Hedged Reads Across 3-Way Scatter-Gather

gRPC Recall Gatewayingress8.5ms p95 HedgeTimerguardFirst-CompletedWinscomputeTier 3 CircuitBreakercircuitTriggers replica @ 8.5ms

1.2.97% -> 0.12%: Hedged reads slash 3-way tail amplification by 24x.

2.Graceful Degradation: If Neo4j trips, Tier 1+2 return degraded vector context.

8.5 ms hedged reads and Tier 3 circuit breakers keep p99 recall under 25 ms.

07
advanced

Envelope Encryption & <=60s GDPR DEK Crypto-Shredding.

Why this matters: Achieve instant 'Right to be Forgotten' erasure without rebuilding 115 TB HNSW graphs.

Re-indexing 115 TB of HNSW graphs on disk for every GDPR deletion request is impossible.

Instead, every namespace's payloads and graph attributes are encrypted with a dedicated KMS Data Encryption Key (DEK).

Stage 7 • Compliance & Security

Tombstone -> Async Purge -> KMS DEK Shredding

Stage 1: Tombstone(<100ms)guardStage 2: Async Purge(<5m)computeStage 3: KMS DEKShredsecurityInert SnapshotsoutputDestroys envelope DEK

1.Zero Re-Indexing: Crypto-shredding satisfies GDPR without HNSW rebuilds.

2.<=100ms Block: Redis tombstone halts reads before async cleanup finishes.

Per-namespace KMS DEK crypto-shredding delivers <=60s GDPR erasure across immutable backups.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

Why does naive HNSW post-filtering fail when serving 50M+ isolated agent namespaces?

Recommended Learning Flow