0xPlaygrounds / rig

A library for developing LLM-powered Rust applications.
https://rig.rs
MIT License
81 stars 3 forks source link

refactor: Generalize and simplify vector store interface #34

Open cvauclair opened 2 hours ago

cvauclair commented 2 hours ago

Feature Request

Generalize and simplify the vector store interface (and the integration of third party vector stores).

Motivation

Rig's current approach to vector stores and vector search is lacking in multiple ways:

  1. The interface forces developers to use the DocumentEmbeddings type, which is somewhat opinionated and a little over-engineered.
  2. The interface doesn't lend itself well to use cases where a developer already has a populated vector store since the interface expects the vector store to be modeled after DocumentEmbeddings.
  3. The process of integrating new vector stores is convoluted for non-document databases (e.g.: Postgres, LanceDB) since DocumentEmbeddings was designed for document vector stores.
  4. The interface assumes that user's would use Rig constructs (e.g.: DocumentEmbeddings) to populate their vector store.

Proposal

Alternatives

Open to alternatives

cvauclair commented 2 hours ago

@0xMochan @ThierryBleau what do you guys thinks of this?