Expand description
Vector Store abstraction for pluggable vector database backends
This module provides a trait-based abstraction for vector storage, enabling different backends (in-memory, Qdrant, Pinecone, etc.) to be used interchangeably for semantic skill search.
§Architecture
┌──────────────────────────────────────────────────────────────┐
│ VectorStore Trait │
│ upsert, search, delete, get, count, health_check │
└──────────────────────────────────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ InMemory │ │ Qdrant │ │ Pinecone │
│ (default) │ │ (local/ │ │ (cloud) │
│ │ │ cloud) │ │ │
└─────────────┘ └─────────────┘ └─────────────┘§Example
ⓘ
use skill_runtime::vector_store::{VectorStore, InMemoryVectorStore, EmbeddedDocument};
let store = InMemoryVectorStore::new();
// Upsert documents
let docs = vec![EmbeddedDocument::new("id1", vec![0.1, 0.2, 0.3])];
store.upsert(docs).await?;
// Search
let results = store.search(vec![0.1, 0.2, 0.3], None, 5).await?;Structs§
- Delete
Stats - Statistics from a delete operation
- Document
Metadata - Metadata associated with a document for filtering and display
- Embedded
Document - A document with its embedding vector and metadata
- File
Config - Configuration for file-based vector store
- File
Vector Store - File-based vector store with automatic persistence
- Filter
- Filter for narrowing search results based on metadata
- Health
Status - Health status of a vector store backend
- InMemory
Vector Store - In-memory vector store implementation
- Search
Result - A search result with score and document
- Upsert
Stats - Statistics from an upsert operation
Enums§
- Distance
Metric - Distance metric for similarity calculation
Traits§
- Vector
Store - Trait for vector storage backends
Functions§
- cosine_
similarity - Compute cosine similarity between two vectors
- euclidean_
distance - Compute euclidean distance between two vectors