Expand description
Vector-store insertion and similarity-search interfaces.
VectorStoreIndex implementations also implement Tool when their
filter is deserializable and uses JSON values.
use rig_core::vector_store::in_memory_store::InMemoryVectorStore;
let store = InMemoryVectorStore::<String>::from_documents([]);
assert!(store.is_empty());Re-exports§
pub use request::VectorSearchRequest;
Modules§
- in_
memory_ store - In-memory vector storage with cosine scoring. A search scores every
document by default;
InMemoryVectorStore::builderopts into scoring only approximate candidates (IndexStrategy::LSH) on large stores. - lsh
- Random-projection hashing for approximate vector-search candidates.
- request
- Vector-search requests and composable metadata filters.
Structs§
- Vector
Search IdResult - One document ID returned by
VectorStoreIndex::top_n_ids. - Vector
Search Result - One document returned by
VectorStoreIndex::top_n.
Enums§
- Index
Strategy - How the in-memory vector store picks the documents a search scores.
- Vector
Store Error - Errors from vector store operations.
Traits§
- Insert
Documents - Trait for inserting documents and embeddings into a vector store.
- Vector
Store Index - Trait for querying a vector store by similarity.
Functions§
- flatten_
embedded - Serializes each document to JSON once, then applies
fto every(document, embedding)pair, flattening the results into a single vector.