TTemporalStore.AI GitHub

Use cases

Start with context management, then apply the same store to temporal features.

Context Management is the flagship use case: serving compact, replayable LLM context from temporal memory. Ranking, risk, ads, and fraud use the same engine through sequence, aggregate, and control-state primitives.

Primary story

Agent and enterprise LLM systems need short-term and long-term team memory across sessions, agents, devices, tools, evidence, policies, and summaries.

Reusable primitives

Long sequences, aggregates, counters, and distinct state are the lower-level temporal data models used by context, ranking, risk, ads, and fraud.

Persistent, memory-first

One durable store handles memory, feature serving, replay, and safety state — and data moves automatically across memory, SSD, and shared storage, so hot state serves from RAM while everything stays persisted. It replaces the usual web of caches, stream jobs, and custom services.

Flagship use case

LLM context management as temporal storage plus serving.

A coding, support, research, or enterprise agent creates a temporal stream: goals, files, tools, retrieved evidence, decisions, user preferences, device context, and policy state. TemporalStore stores that stream as queryable short-term and long-term memory across sessions, agents, and devices, then serves only the right slice into the next model call.

Context workflow

Write everything, serve only what matters now.

1

Capture events

Messages, tool calls, retrieved evidence, file edits, user corrections, and policy outcomes.

2

Attach time and scope

Key memory by session, team, project, user, source, and validity window.

3

Compress naturally

Keep raw history, summaries, counters, and preference deltas together as temporal state.

4

Build ContextPack

Filter, rank, and assemble a token-bounded slice for the next LLM request.

5

Replay and audit

Recover what the model knew at decision time and debug long-running work.

Build a ContextPack for the current turn
pack = store.build_context(
    session_id="sess-4817",
    now=turn_started_at,
    budget_tokens=2048,
    include=["messages", "tool_traces", "summaries", "preferences"],
    window="24h",
)

prompt = render_system_context(pack)

Additional use cases

The same engine serves temporal features beyond LLM context.

These are important, but they are secondary to the flagship context story. They show why TemporalStore is a general temporal serving engine, not a one-off memory component.

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.

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?

Proof for the flagship use case

How TemporalStore compares to other memory systems.

This section belongs after the use-case map: it is evidence for the context-management story, not a separate product direction. We benchmark against the strongest agent-memory baselines because that is the bar a context-serving engine has 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
SOTA agent-memory baselinesEvent/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; append-structured, event-time storage with replayable, auditable decisions and no LSM compaction write-amplification on temporal appends; filter-first retrieval that narrows to a controlled candidate set and scores it exactly — no lossy approximate-nearest-neighbor stage — while respecting 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 memory-first serving with automatic memory–SSD–shared-storage tiering; 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); the leading hierarchical-memory systems are mature; and TemporalStore is a younger open-source project still growing its ecosystem.

Head-to-head benchmark results vs SOTA agent-memory baselines

On a shared open-source harness — the same reader model and embeddings for both systems, scored by an LLM judge — TemporalStore matches or beats the strongest baseline: overall 88% vs 78%, driven by long-horizon memory (LongMemEval 98% vs 66%), while LOCOMO is a tie (~83–84%). Retrieval hit@k is comparable-to-better (LongMemEval 1.00 vs 0.88), 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.