moonweavte

    A Weaviate vector store for moonbitstack/moonrag, over its REST API.

    moonrag
    weavte
    vector-store
    vector-database
    moonbit
    Download zip
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    9 hours ago
    Downloads
    9

    #moonweavte

    A Weaviate vector store for moonrag, over its REST API. Native only: it opens sockets, so it is not built for js or wasm.

    moon add moonbitstack/moonweavte

    let store = @moonweavte.WeaviateStore::new("http://127.0.0.1:8080", embedder, dimension=256)

    It implements moonrag's VectorStore. Like the in-memory, SQLite and MySQL stores it recomputes the cosine in this process and ranks by the same Filter::matches, so its results agree with the other backends rather than trusting the server.

    See this store's page, the guide and the API.

    WeaviateStore

    pub struct WeaviateStore {
    base : String
    class_name : String
    embedder : &
    Embedder

    dimension : Int
    counter : Int
    }

    WeaviateStore::add

    async fn WeaviateStore::add(self : WeaviateStore, documents : Array[
    Document
    ]) -> Array[String]

    WeaviateStore::clear

    async fn WeaviateStore::clear(self : WeaviateStore) -> Unit

    Remove every stored object, leaving the class.

    WeaviateStore::create

    async fn WeaviateStore::create(self : WeaviateStore) -> Unit

    Create the class this store needs. Safe on every start: an existing class answers 422, which is not an error here.

    WeaviateStore::delete

    async fn WeaviateStore::delete(self : WeaviateStore, ids : ArrayView[String]) -> Unit

    WeaviateStore::len

    async fn WeaviateStore::len(self : WeaviateStore) -> Int64

    The number of stored objects.

    WeaviateStore::new

    fn WeaviateStore::new(base : String, embedder : &
    Embedder
    , dimension~ : Int, class_name? : String) -> WeaviateStore raise

    A store over the Weaviate server at base (for example http://127.0.0.1:8080), in class class_name.

    WeaviateStore::search

    async fn WeaviateStore::search(self : WeaviateStore, vector : ArrayView[Double], limit~ : Int, filter? :
    Filter
    ) -> Array[
    Scored
    ]

    Source Files