Skip to main content

Crate juncture_store

Crate juncture_store 

Source
Expand description

Cross-thread persistent key-value storage for Juncture.

This crate re-exports the Store types from juncture-core::store so that consumers can depend on juncture-store directly without pulling in the full juncture-core facade.

All types originate from the authoritative implementation in juncture-core::store. There are no duplicate definitions.

§Re-exported items

TypeDescription
StoreAsync key-value store trait
StoreErrorError type for store operations
ItemStored item with metadata
FilterExprFilter expression for search queries
SearchQuerySearch query builder
SearchResultSearch result set
SearchItemSearch result item with optional score
StoreOpBatch operation type
StoreResultBatch operation result
MemoryStoreIn-memory store implementation
TTLConfigTime-to-live configuration
IndexConfigVector index configuration
EmbeddingFuncEmbedding generation trait

§Example

use juncture_store::{MemoryStore, Store};
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let store = MemoryStore::new();

    // Store a value
    store.put(
        "checkpoint",
        "run_1",
        json!({"step": 5, "data": "example"}),
        None,
    ).await?;

    // Retrieve it
    let item = store.get("checkpoint", "run_1").await?;
    assert!(item.is_some());

    Ok(())
}

Structs§

IndexConfig
Vector index configuration
Item
Stored item
MemoryStore
In-memory store implementation
SearchItem
Search result item with optional similarity score
SearchQuery
Search query
SearchResult
Search result
TTLConfig
Configuration for time-to-live (TTL) behavior on MemoryStore.

Enums§

FilterExpr
Filter expression for search
StoreError
Store error types
StoreOp
Store operation type
StoreResult
Store operation result

Traits§

EmbeddingFunc
Trait for computing embeddings for vector search.
Store
Store trait for cross-thread long-term memory