TTemporalStore.AI GitHub

Use cases

Pick the model that fits your workload.

Context Management is the flagship. Long Sequence Feature, Aggregated Feature, and Control State are the temporal primitives behind ranking, risk, ads, and agent-safety workloads — all served by one store.

How to choose

Start from the question you ask at read time.

Every workload keys state by an entity — a session, a user, a device, a card — and asks one temporal question online. The shape of that question tells you the model.

Four questions cover almost everything teams build on temporal state:

  • “What has this agent seen, and what belongs in the prompt now?”Context Management. Replayable memory: messages, tool traces, retrieval evidence, and summaries assembled into a compact ContextPack.
  • “What is the recent ordered history for this entity?”Long Sequence Feature. Tail reads and windowed slices over a long behavior sequence, for rankers and investigation tools.
  • “What is the sum / min / max / count over a time window?”Aggregated Feature. Filtered, grouped rollups for risk and recsys features.
  • “How many, or how many distinct, in the last N minutes?”Control State. Counters and distinct sets for frequency caps, velocity, and fraud.

One store answers all four, so an entity's context and its safety counters live on the same read path instead of four separate systems.

Online question → model
What belongs in the prompt?Context Management
Recent ordered history?Long Sequence Feature
Sum / min / max / count in a window?Aggregated Feature
How many, or how many distinct?Control State

Pick by the question, not the storage. All four resolve on one temporal read path.

Flagship: Context Management

Agent memory needs temporal storage, not a loose prompt buffer.

A coding or research agent generates a stream of events: user goals, messages, file edits, tool calls, approvals, failures, and generated artifacts. A flat prompt buffer forgets most of it and cannot explain what it knew when. Context Management stores every event as a time-indexed record keyed by session_id, so the agent can resume with evidence and you can replay exactly what context was available at any decision.

At read time you do not dump the whole history into the prompt. You ask the store to build a ContextPack: it filters by scope and time, ranks source-backed memories and summaries, and returns a compact, budget-bounded slice — the tool traces, preference deltas, and retrieval evidence that matter right now.

Building agent context at read time

Build a ContextPack for the current turn
pack = store.build_context(
    session_id="sess-4817",
    now=turn_started_at,
    budget_tokens=2048,          # bound what enters the prompt
    include=["messages", "tool_traces", "summaries", "preferences"],
    window="24h",                 # recent events, plus pinned summaries
)

for item in pack.items:
    print(item.kind, item.ts, item.source)   # replayable, source-backed
prompt = render_system_context(pack)          # drop straight into the prompt

Worked examples

One store, many temporal questions.

The same engine, keyed differently, answers agent, ranking, risk, ads, and fraud questions online.

Use caseEntity keyModelOnline question
Agent contextsession_idContext ManagementWhat tool calls, summaries, and preference deltas should be in the prompt now?
Recommendation rankinguser_idLong Sequence FeatureWhat recent product, search, or content sequence should the ranker see?
Failed-login riskdevice_idAggregated FeatureHow many failed logins by country and method in the last 30 minutes?
Ads frequency capcampaign_id + user_idControl State (counter)How many impressions in the last hour, day, or campaign window?
Fraud velocityuser_idControl State (counter)How many purchases happened in the last 5 minutes?
Card-testing detectioncard_idControl State (distinct)How many unique merchants did this card touch in the last 24 hours?

Context management landscape

How TemporalStore compares to other memory systems.

Several projects tackle agent memory. In their own papers and pages, OpenViking / VikingMem report beating the other systems on standard memory benchmarks — so we benchmark head-to-head against OpenViking as the bar to clear.

SystemApproachTemporal & replayOne serviceRetrieval
TemporalStoreAppend-structured temporal store; Context modelNative event-time + replayYes — memory, retrieval, counters, replay in one engineFilter-first temporal; optional vector recall
OpenViking / VikingMemEvent/entity memory, L0/L1/L2 layers, temporal compressionTemporal layersMemory-focusedHierarchy + recall
Mem0Developer-friendly add/search, scoped memoriesLimitedNeeds a separate vector storeVector-first
Zep / GraphitiBi-temporal knowledge-graph memoryBi-temporal graphGraph + retrievalHybrid semantic / keyword / graph
MemOS / MemoriOS- and filesystem-style memoryFile-likeMemory-focusedPath + recall

Pros and cons of the TemporalStore approach

Where it wins: one service instead of vector DB + cache + feature store + queue; native event-time storage with replayable, auditable decisions; filter-first retrieval that respects time validity and supersession, so fewer stale or out-of-scope chunks reach the prompt; large token savings from managed context packs; low latency at scale via a multi-layer cache; and open source with an enterprise path to disaggregated, five-nines storage.

Honest trade-offs: for pure fuzzy semantic recall a vector-first system can surface loosely-related text that filter-first traversal skips (TemporalStore treats vector recall as an optional add-on); OpenViking's hierarchical memory experience is mature; and TemporalStore is a younger open-source project still growing its ecosystem.

Head-to-head benchmark results vs OpenViking

On a shared open-source harness — the same reader model and embeddings for both systems, scored by an LLM judge — TemporalStore matches or beats OpenViking: overall 42% vs 34.7%, driven by long-horizon memory (LongMemEval 38% vs 16%), while LOCOMO is a tie at 44%. Retrieval hit@k is comparable-to-better (LongMemEval 0.98 vs 0.81), and managed context packs cut prompt tokens sharply at equal answer quality.

See the full LOCOMO + LongMemEval report, the 3-arm token-quota study, and the published landscape →

Keep reading

Where to go next.

Data modelsAll temporal primitivesContext, sequences, aggregates, and control state in one place. BenchmarksScale & quality evidenceLatency, parity, and context-quality reports. Tech & infraHow it is servedServing core, caches, tiering, and storage backends.