Skip to main content

cognee_vector/
lib.rs

1//! Vector database abstraction for Cognee-Rust.
2//!
3//! Provides vector storage and similarity search for embeddings.
4
5/// Pure-Rust in-memory brute-force vector database (OSS default fallback).
6pub mod brute_force_vector_db;
7/// Error types for vector database operations.
8pub mod error;
9/// Data models for vector points, search results, and collection configuration.
10pub mod models;
11/// Vector database trait definition.
12pub mod vector_db_trait;
13
14#[cfg(feature = "pgvector")]
15pub mod pgvector_adapter;
16
17/// Embedded file-backed vector store via the LanceDB crate.
18///
19/// Disabled on Android — the LanceDB + Arrow native stack does not
20/// cross-compile cleanly to mobile targets, so `BruteForceVectorDB`
21/// remains the Android default.
22#[cfg(not(target_os = "android"))]
23pub mod lancedb_adapter;
24
25#[cfg(feature = "testing")]
26pub mod mock_vector_db;
27
28pub use brute_force_vector_db::BruteForceVectorDB;
29pub use error::{VectorDBError, VectorDBResult};
30pub use models::{CollectionConfig, DistanceMetric, SearchResult, VectorPoint};
31pub use vector_db_trait::VectorDB;
32
33#[cfg(feature = "pgvector")]
34pub use pgvector_adapter::PgVectorAdapter;
35
36#[cfg(not(target_os = "android"))]
37pub use lancedb_adapter::LanceDbAdapter;
38
39#[cfg(feature = "testing")]
40pub use mock_vector_db::MockVectorDB;