Jefferson Andrade

EpochDB - Agentic Memory Engine

by
EpochDB is a high-performance, state-aware memory engine designed for lossless, tiered storage, atomic state management, and multi-hop relational reasoning. It is built specifically for AI agents that require perfect historical recall, long-term state persistence, and deterministic fact corrections.

Add a comment

Replies

Best
Jefferson Andrade

EpochDB is a high-performance, state-aware memory engine designed for lossless, tiered storage, atomic state management, and multi-hop relational reasoning. It is built specifically for AI agents that require perfect historical recall, long-term state persistence, and deterministic fact corrections.

Why EpochDB?

Flat vector databases retrieve text based on semantic similarity but struggle to resolve conflicting facts (e.g. "where does the user work now?" vs "where did they work last year?"). EpochDB solves this through Atomic State Management:

  • Topic Lock & Entity Seeding: Ensures retrieval stays within the target topic by seeding candidates directly from the Knowledge Graph.

  • State-Aware Supersession: Automatically identifies and filters out stale facts when they are updated.

  • Tiered HNSW Hierarchy: Sub-millisecond recall across working memory (L1 RAM) and historical archives (L2 Disk).

  • Memory Forking & Lineage: Supports logical branches (db.fork) for multi-agent collaboration and hypothetical reasoning without copying data.

  • Rich Domain Objects: Returns structured Memory, Entity, and Graph abstractions rather than raw database tuples.

Architecture

EpochDB uses a tiered hierarchy modeled after CPU caches to balance low latency and massive scale:

Performance, Latency & Token Efficiency

EpochDB achieves a perfect 1.000 score across named benchmark suites designed to validate engine logic:

Benchmark

What it tests

Metric

Score

LoCoMo

Multi-hop relational reasoning

Multi-hop recall

1.000

ConvoMem

Fact correction & preference recall

recall@3

1.000

LongMemEval

Longitudinal recall (cross-epoch)

recall@3

1.000

NIAH

Needle in a Haystack (High-noise)

precision@3

1.000

Operational Latency

Precision metrics across Hot and Cold tiers:

  • Direct/Multi-Hop Relational Retrieval (Hot Tier): 0.2 ms – 0.4 ms

  • Historical HNSW Retrieval (Cold Tier): ~4.0 ms (30x speedup from ~125 ms via persistent indexing)

  • Cold Tier Full Scan (pyarrow.dataset): 45.0 ms (for cross-epoch scalar aggregations)

  • Scalar Range Query (B-tree): 0.8 ms

  • Series Interpolation (IntervalTree): 1.2 ms

  • Constraint Satisfaction (Z3 SAT Solver): 2.5 ms

  • WAL Crash Recovery Replay: 9.1 ms

LangGraph Token Savings

When used as a checkpointer, EpochDB keeps LangGraph states "thin" by storing historical turns as Unified Memory Atoms and querying them selectively. This achieves linear O(N) token scaling (saving 55% to 79% of input tokens compared to standard checkpointers' quadratic O(N2) accumulation).

Sync vs. Async Concurrency Benchmark

This benchmark evaluates E2E latency and input token consumption under concurrent multi-user load, comparing three execution configurations using the live Gemini API (gemini-embedding-2 and gemini-3-flash-preview):

  1. Sync LangGraph + Sync EpochDB: Sequential graph invocation with blocking I/O.

  2. Async LangGraph + Async EpochDB: Concurrent graph execution (ainvoke) using async checkpointers and DB facades.

  3. Async Astraea + EpochBlackboard: Decoupled event-driven reactive coordination running in parallel.

The scenario simulates 3 concurrent users executing 3 conversation turns each (9 turns total) over the live API:

Metric

Sync LangGraph

Async LangGraph

Async Astraea

E2E Latency (seconds)

352.060s

113.027s

39.869s

Average Turn Latency

11735.3ms

3767.6ms

1329.0ms

Throughput Speedup

1.00x (Baseline)

3.11x

8.83x

Total Input Tokens

28,385

24,145

21,932

Technical Specifications & Constants

  • +20.0 Topic Lock Boost: Set mathematically larger than the maximum possible Reciprocal Rank Fusion (RRF) score sum (which caps at ≈0.05 across semantic and recency ranks, using K=60). This acts as a "hard lock," ensuring query-intent-matched facts always outrank adjacent semantic noise.

  • 0.0001x Supersession Penalty: Multiplicatively demotes stale facts (e.g. older conflicting values for the same subject-predicate pair) to the bottom of the retrieval pool, resolving contradictions deterministically while preserving database history.

  • 1e-7 Signal-to-Noise Demotion: Once a Topic-Locked fact is identified, all non-locked background noise is demoted by 10−7 to keep the LLM's context window clean and free from distractors.

  • Quantitative logic & Triggers: Native support for Scalars, Time-Series, and Constraints. IntervalTree enables precise O(log⁡n+k) range queries with base-unit normalization via persistent schema_registry.json.

  • Reactive Cascade Graphs: CascadeManager automatically triggers downstream policy updates, while Coefficient of Variation (CV) reflections auto-generate constraint atoms from observed historical data trends.

  • Analytical Cold Tier: Leveraging pyarrow.dataset for high-performance cross-epoch scanning and numeric aggregation directly over compressed Parquet archives.

  • ACID Crash Recovery: Zero data loss for in-flight memories via the synchronous Write-Ahead Log.