Skip to main content

Crate synaptic_sqlite

Crate synaptic_sqlite 

Source
Expand description

SQLite integration for the Synaptic framework.

This crate provides:

  • SqliteCache: A SQLite-backed implementation of the LlmCache trait for caching LLM responses with optional TTL expiration.
  • SqliteCheckpointer: A SQLite-backed implementation of the Checkpointer trait for persisting graph state between executions.

§Quick start

use synaptic_sqlite::{SqliteCache, SqliteCacheConfig};

// In-memory cache (great for testing)
let cache = SqliteCache::new(SqliteCacheConfig::in_memory())?;

// File-based cache with 1-hour TTL
let config = SqliteCacheConfig::new("/tmp/llm_cache.db").with_ttl(3600);
let cache = SqliteCache::new(config)?;

Re-exports§

pub use checkpointer::SqliteCheckpointer;

Modules§

checkpointer

Structs§

ChatResponse
A response from a chat model containing the AI message and optional token usage statistics.
SqliteCache
SQLite-backed implementation of the LlmCache trait.
SqliteCacheConfig
Configuration for SqliteCache.

Traits§

Checkpointer
Trait for persisting graph state checkpoints.
LlmCache
Trait for caching LLM responses.