Skip to main content

Module brute_force_vector_db

Module brute_force_vector_db 

Source
Expand description

Pure-Rust in-memory brute-force vector database (OSS default fallback). Pure-Rust in-memory brute-force VectorDB implementation.

Linear-scan O(n) similarity search over all stored vectors. Used as:

  • the Android default (LanceDB + Arrow do not cross-compile cleanly there);
  • the vector_db_url = ":memory:" escape hatch on every target (handy for tests and ephemeral cognify runs);
  • a test fixture in lieu of the testing-feature-gated MockVectorDB.

No persistence. Data is lost on process restart. For durable storage prefer the default LanceDbAdapter (on non-Android targets) or vector_db_provider="pgvector".

Memory: O(n × dim). At ~6 GB for 1M × 1536-dim, this is a soft cap — beyond that, pgvector (or the closed cognee-vector-qdrant) is the correct choice.

Distance metric: every collection uses cosine similarity (higher = more similar). The VectorDB trait’s create_collection(data_type, field_name, dimension) does not carry a DistanceMetric; per-collection metric plumbing is beyond T5’s scope.

Structs§

BruteForceVectorDB
In-memory brute-force vector database.