TemporalStore
Open-source Rust storage for online features, LLM context, and control state.
Feature serving and LLM context are equally important, first-class workloads.
Serve latest values, long histories, high-cardinality aggregates, WindowReduce
features, frequency caps, and agent memory in one engine. Context ingestion,
retrieval, ranking, token-budgeted packing, APIs, and SDKs are in TemporalStore.
Apache-2.0, available worldwide for use, modification, commercial deployment,
and contributions under the license.
Documentation |
Issues
Implementation entry points
On this page: Quick start |
Use cases | Recorded benchmarks |
Durability | Deployment boundaries |
Contributing.
The provider guide separates latest values, optional history, aggregates, and tracked
teardown. Enabling one path does not establish the throughput or storage cost of the
others; choose the API and acknowledgement policy before measuring a workload.
Use cases
| Workload |
What you can build |
Start here |
| Feast online serving |
Materialize features and retrieve current entity values through Feast, with explicit timestamp, expiry, and acknowledgement policies |
Feast integration |
| Latest features and profiles |
User/item profiles, lookup features, hashes, and online state for recommendation, search, ads, and personalization |
One-cluster architecture |
| Long-sequence features |
Recent clicks, sessions, interactions, and typed behavior histories; timestamp-window reads and count-based retention |
Sequences and aggregates |
| High-cardinality features |
Separate user-item, user-category, user-author, device, or campaign histories; exact windowed count, sum, average, min/max, and first/last |
Aggregate example |
| WindowReduce Features |
Merge cell samples, reduce member statistics over a time window, and rank candidates by counts, ratios, or weighted scores |
Window Reducer model, worked example |
| Control state |
Set/get online state, atomic single-key counters, quotas, pacing, suppression, and risk/fraud decisions |
Control-state guide |
| Frequency caps |
Per-user, campaign, or placement exposure limits using windowed counters |
Frequency-cap guide |
| LLM context and agent memory |
Conversations, resources, entities, reusable memory, retrieval, and token-budgeted context assembly |
Context guide |
| vLLM KV cache |
Reuse prompt KV blocks across requests and worker processes with LMCache |
KV cache setup |
| Collections, blobs, and streams |
Membership/deduplication, sorted sets, lists, multipart blobs, range reads, and batch/stream ingestion |
Command surface |
LLM KV cache with LMCache and vLLM
TemporalStore provides an L2 storage tier for LMCache. vLLM's
LMCacheMPConnector exchanges KV blocks with a local LMCache server.
TemporalStore streams the block payloads through its blob API and batches
metadata commands for lookup and expiry. Workers attached to the same LMCache
server can reuse a prompt prefix when the model and KV layout match.
- Start a TemporalStore datanode. Install the adapter and its command client
from this checkout with
python -m pip install ./integrations/feast ./integrations/lmcache.
- Start LMCache with the TemporalStore adapter. Point the blob and command URLs
at the same datanode. Use a separate adapter for each independent datanode
when configuring replicas.
- Start vLLM with
LMCacheMPConnector. On a test deployment, disable vLLM's
prefix cache, send a prompt, and wait for the adapter's store counter to
increase. Clear LMCache L1 with POST /cache/clear and repeat the prompt.
The adapter's load counter in GET /status confirms TemporalStore served it.
The adapter enforces a capacity budget per process and evicts unlocked entries.
Use one writer per namespace to enforce that budget. Metadata expiry controls
lookup visibility. Eviction or explicit deletion reclaims the payload.
LMCache's default store policy sends each block to all configured replicas,
and a reachable replica can serve blocks it accepted.
In a local WSL test with two CPU vLLM workers, eight concurrent clients, and
three datanodes, all 64 cross-worker replays loaded their KV blocks from L2.
All 32 replays also succeeded with one datanode disconnected.
See the LMCache integration guide for
configuration, replica setup, a vLLM smoke test, and the L2 benchmark.
Feast API support
The native Feast provider
is an online store and materialization target, not an offline training store.
| API or workflow |
Support |
get_online_features and its async form |
Latest-value serving through bounded compact projections; compatible views share entity planning. |
online_write_batch and its async form |
Materialization with timestamp suppression, optional TTL, and bounded requests; atomic timestamp checks apply to the eligible latest-only route. |
query_feature_aggregate / query_feature_aggregates |
Provider extensions for retained history; numeric reducers require integer features and the selected history layout. |
| Precomputed vector read/write |
Store and fetch vector-valued features; this does not provide provider vector search. |
update / teardown |
Schemaless updates and tracked cleanup; exact teardown requires key tracking before materialization. |
Feast async calls change client scheduling, not the node's persistence policy.
Eligible latest-only materialization uses interleaved atomic row groups by
default, with a final synchronous durability fence and older-node fallback.
Set interleave_materialization: false to keep the original atomic batch route.
See latency, amplification, and allocation choices
before comparing latest-only serving, history queries, or another backend. Provider
vector-search hooks and offline point-in-time retrieval are not implemented here.
Configure Feast
Start the data node with the quick start. From this checkout,
install Feast and enable the native provider on Python's import path:
pip install feast msgpack 'aiohttp>=3.9,<4'
export PYTHONPATH="$PWD/integrations/feast${PYTHONPATH:+:$PYTHONPATH}"
In your existing Feast repository, keep its project, registry, provider, entity
definitions, and offline sources. Set its feature_store.yaml online-store block:
online_store:
type: feast_temporalstore_command.TemporalStoreCommandOnlineStore
host: 127.0.0.1
port: 17102
shard_id: 1
max_batch_commands: 512
max_write_batch_commands: 4096
max_batch_request_bytes: 4194304
skip_dedup: false
adaptive_timestamp_prefetch: true
key_ttl_seconds: null
write_feature_history: false
track_keys_for_teardown: false
Use the reachable data-node address and assigned shard for your deployment.
The configuration above selects latest-value serving without history, expiry,
or teardown tracking. Set a positive key_ttl_seconds to enable whole-key expiry;
enable track_keys_for_teardown before writing if exact cleanup is required.
History and tracking add storage work and can change the write route.
Run Feast's normal workflow from that repository, with the provider import path
still exported:
feast apply
feast materialize-incremental "$(date -u +%Y-%m-%dT%H:%M:%S)"
Read using FeatureStore(repo_path=".").get_online_features(...) with your
registered feature names and entity rows. TemporalStore serves the materialized
online values; Feast's configured offline source and materialization engine
remain responsible for loading them. Async API calls do not relax the node's
durability policy. See the provider configuration and API guide
for history, aggregates, async calls, older-node behavior, and cleanup limits.
Read features with Feast
After registering and materializing a feature view, use Feast's public APIs.
Replace driver_stats:trips and driver_id with a registered feature and its
entity join key in your repository:
import asyncio
from feast import FeatureStore
store = FeatureStore(repo_path=".")
request = {
"features": ["driver_stats:trips"],
"entity_rows": [{"driver_id": 1001}, {"driver_id": 1002}],
}
values = store.get_online_features(**request).to_dict()
print(values)
async def read_features():
response = await store.get_online_features_async(**request)
return response.to_dict()
async_values = asyncio.run(read_features())
print(async_values)
In an existing async application, await read_features() on its running event
loop instead of calling asyncio.run. An entity with no materialized value
returns a missing feature, not a numeric zero. Both APIs serve the latest online
values; enabling history does not turn them into point-in-time training queries.
Async reads reuse loop-owned HTTP pools. Reuse the store during serving and await
store._get_provider().online_store.aclose() once at application shutdown;
applications managing loops manually must shut down async generators before
closing those loops. Async writes retain their blocking-worker path.
See the provider API coverage
for supported hooks and the separate history and aggregate extensions.
Choose a Feast materialization path
Use the native provider guide
to configure these independently; enabling latest-value serving does not enable them all.
| Requirement |
Configuration and consequence |
| Reject stale latest-value updates |
Keep skip_dedup: false; common latest-only, shared-layout conditional routes compare timestamps and mutate under one server shard guard. |
| Expire entity state |
Set key_ttl_seconds; rejected stale rows do not refresh expiry on the conditional TTL route. |
| Retain feature history |
Enable write_feature_history; this adds writes and uses a different path from latest-only materialization. |
| Enumerate keys during teardown |
Enable track_keys_for_teardown before materializing; without tracking, teardown cannot enumerate existing rows. |
| Reduce serialization for mostly stale batches |
Keep adaptive_timestamp_prefetch: true; a per-thread routing hint can add a fresh timestamp pre-read, while eligible survivors still use server-side conditional writes. |
History, tracking, mixed layouts, and older-node fallbacks can use a separate
timestamp-read and write sequence. That fallback is not an atomic conditional
update across concurrent writers. skip_dedup: true disables stored-timestamp
suppression; out-of-order materialization can then replace newer values.