TemporalStore.AI GitHub

Open-source temporal state engine

Benchmarked temporal memory and model-aware online state for AI systems.

TemporalStore.AI is the technical home for TemporalStore: a serving engine for time-indexed entity state, rolling feature windows, behavior sequences, agent context, and replayable online decisions.

PUT /v1/entities/user_42/events
{
  "stream": "checkout",
  "ts_ms": 1786114920000,
  "attrs": {
    "merchant": "m_812",
    "amount_usd": 129.50,
    "country": "US"
  }
}

GET /v1/entities/user_42/window?metric=sum_amount&range=15m
200 { "value": 487.20, "events": 9, "watermark_ms": 1786114920000 }

Start here

The pages people were missing are now first-class routes.

Detailed use cases Risk, fraud, ads, recommendations, and agent context Find the deep pages we already wrote and the concrete example table. Benchmarks Latency, scale, context quality, and storage parity reports Open benchmark summaries and source artifacts. Data models and use cases TemporalCounter, TemporalAggregate, TemporalDistinct, Sequence, Profile, Context Map each model to practical AI, fraud, ads, and product workloads. API shape Write events, query windows, build agent context See the serving interface at a glance.

Why it exists

Modern AI and risk systems need more than latest-value KV.

Agents, fraud models, ad serving, recommendation systems, and real-time product policies all ask temporal questions: what happened recently, how often, in what sequence, under which filters, and with what replayable evidence?

Most teams approximate that with stream jobs, caches, feature tables, and application logic. TemporalStore moves those temporal primitives into the serving engine so open source users can build, inspect, benchmark, and improve the actual online state layer.

Architecture

Designed around event time, entity locality, and model-aware storage.

Clients

SDK writes stream consumers online reads replay jobs

Serving core

namespace + table router partition worker temporal model executor query planner

Persistence

WAL / oplog page store snapshot index recovery replay

Data models

Temporal primitives exposed as first-class serving objects.

Open the full data model and use-case page

TemporalCounterbucketed counts, sums, rates, caps, and velocity checks
TemporalAggregatefiltered sum, min, max, count, and grouped rollups
TemporalDistinctunique devices, merchants, campaigns, sessions, and IPs by window
Sequenceordered behavior history for rankers, agents, and investigation tools
Profilelatest entity facts colocated with temporal history
Contextstructured agent memory, tool events, retrieval traces, and safety counters

API shape

Small primitives, explicit semantics, testable behavior.

Ingest event

ts.put_event(
  table="checkout_events",
  entity="user_42",
  ts_ms=event.ts_ms,
  attrs={
    "merchant": "m_812",
    "amount_usd": 129.50,
    "country": "US"
  }
)

Read feature window

features = ts.window(
  table="checkout_events",
  entity="user_42",
  range="15m",
  metrics=[
    "count",
    "sum(amount_usd)",
    "distinct(merchant)"
  ]
)

Build agent context

context = ts.context(
  entity="workspace_7",
  streams=["tool_calls", "decisions"],
  since="24h",
  summarize=True,
  include_evidence=True
)

Contributor map

Good open-source work starts with narrow, inspectable problems.

01

Benchmark harness

Separate ingest throughput, read latency, sequence scans, distinct cardinality, and mixed workload tests.

02

Storage engine

WAL records, snapshots, page cache policy, object encoding, and replay correctness.

03

Query engine

Window planning, filter pushdown, distinct algorithms, sequence scans, and result explainability.

04

Agent memory

Context streams, tool-event schemas, memory summarization hooks, and retrieval evidence.