moonchroma

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

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

    #moonchroma

    A Chroma 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/moonchroma

    let store = @moonchroma.ChromaStore::new("http://127.0.0.1:8000", 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.

    ChromaStore

    pub struct ChromaStore {
    base : String
    tenant : String
    database : String
    collection : String
    embedder : &
    Embedder

    dimension : Int
    id : String
    counter : Int
    }

    ChromaStore::add

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

    ChromaStore::clear

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

    Remove every stored document, leaving the collection.

    ChromaStore::create

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

    Create the collection (or reuse one of the same name) and remember the id Chroma assigns it.

    ChromaStore::delete

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

    ChromaStore::len

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

    The number of stored documents.

    ChromaStore::new

    fn ChromaStore::new(base : String, embedder : &
    Embedder
    , dimension~ : Int, collection? : String, tenant? : String, database? : String) -> ChromaStore raise

    A store over the Chroma server at base (for example http://127.0.0.1:8000), in the default tenant and database unless named.

    ChromaStore::search

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

    Source Files