Crate ragfs_store

Crate ragfs_store 

Source
Expand description

Vector storage layer for RAGFS.

This crate provides storage backends for RAGFS, implementing the VectorStore trait.

§Cargo Features

  • lancedb (default): Enables the LanceDB backend for production use
  • Without lancedb: Only MemoryStore is available (for testing/development)

§Backends

BackendDescription
LanceStoreProduction backend using LanceDB (requires lancedb feature)
MemoryStoreIn-memory backend for testing (always available)

§LanceDB Features

When the lancedb feature is enabled:

  • Vector Search: Fast approximate nearest neighbor search using HNSW
  • Hybrid Search: Combined FTS and vector search for better relevance
  • Full CRUD: Create, read, update, delete operations for chunks and files
  • Automatic Indexing: Creates vector and FTS indices automatically

§Example

use ragfs_store::LanceStore;
use ragfs_core::VectorStore;

// Create and initialize store
let store = LanceStore::new("path/to/db.lance".into(), 384);
store.init().await?;

// Store chunks
store.upsert_chunks(&chunks).await?;

// Search
let results = store.search(query).await?;

Re-exports§

pub use lancedb::LanceStore;
pub use memory::MemoryStore;

Modules§

lancedb
LanceDB implementation of VectorStore.
memory
In-memory store for testing without LanceDB.
schema
Arrow schema definitions for LanceDB tables.