Skip to content

Moss Android SDK v0.32.0

Choose a tag to compare

@moss-release-bot moss-release-bot released this 17 Nov 02:45
· 4 commits to main since this release
f152fd3

Moss Android SDK v0.32.0.

AAR: moss-android-0.32.0.aar (arm64-v8a, minSdk 24, namespace dev.usemoss.moss).

SHA-256: d59042e00235e64ddb311f9afa93adbb9394709e91c215907e72b13965a06278

Added

  • License. The AAR carries LICENSE.txt, the PolyForm Shield License 1.0.0
    terms of the SDK, at META-INF/LICENSE.txt and beside the notices at
    assets/moss/LICENSE.txt. The release attaches it and its notes name the terms.

Changed

  • A client created after another one in the same app reuses the project's token
    instead of exchanging the project key again, and a load from cachePath asks
    for the index metadata and its model provenance at once. From Europe, the
    token exchange took about 0.6 s of every new client's load, and the provenance
    lookup one more round trip after the metadata. Closing the last client still
    frees its model and connections at once.
  • loadIndex and loadIndexes need less memory. The index file, downloaded or
    read from cachePath, is freed once it is parsed, and its vectors and
    documents move into the loaded index instead of being copied. A load that
    writes the download to cachePath frees the file once it is written and
    copies the documents into the index. On an Apple M2, loading 250,000 documents
    with 384-dimension vectors peaked at 943 MB instead of 1,550 MB, and at about
    1,210 MB when the load writes the download to cachePath. Auto-refresh of an
    index loaded without cachePath installs a newer version the same way. Search
    results and cache files are unchanged.
  • Queries with a metadata filter test it while they score the vectors, in
    parallel on large indexes, and skip the vectors of documents it rejects. The
    filter values of $gt, $gte, $lt, $lte and $near are parsed once per
    query instead of once per document. On an Apple M2, an embedding or hybrid
    query over 100,000 documents with 1,536-dimension vectors and a filter that
    keeps 5% of them ran about six times faster. Results are unchanged.
  • Creating an index whose name is taken throws a MossException whose code
    is MossErrorCode.INVALID_ARGUMENT and the message "An index with this name
    already exists. Delete it or choose another name.", and a call the service
    refuses because a build for the index is still running, such as adding
    documents during a build, throws the same way with "A build is already
    running for this index. Wait for it to finish, then try again.", instead of
    the generic "The Moss service rejected the request as invalid.". The code is
    unchanged, and detail still names the service's code.

Fixed

  • A string that holds an unpaired surrogate or U+0000, which a UTF-8 C string
    cannot hold, throws MossException.InvalidArgument as a metadata filter of
    MossClient.query, MossClient.queryMultiIndex or MossSession.query, as an
    id of deleteDocs, and as a metadata entry or payload of MossSession.addDocs.
    The filter used to be dropped, so the query returned unfiltered results, and
    the id, entry or payload used to be dropped too.
  • MossClient.createIndex, addDocs and deleteDocs calls on one index run
    one at a time across every MossClient that uses the same loaded copy of the
    core. Each call keeps the index until it returns, the wait for its build
    included, so parallel writes to one index take as long as the same writes one
    after another. MossSession.pushIndex waits its turn with them, but keeps the
    index only until the service accepts the push, not through its build. Calls on
    different indexes still run in parallel. deleteIndex does not wait for them,
    since the service cancels a running build of the index it deletes. Parallel
    calls on one index used to reach the service together, which refused some of
    them and reported others as done without storing them: of three parallel
    addDocs calls with one new document each, only one document was stored. A
    call the service refuses because a build of the index is running, such as one
    started from another process, is sent again, with waits that grow from about
    one second to eight and add up to at most 60 seconds. If the service still
    refuses it after those waits, it throws a MossException whose code is
    MossErrorCode.INVALID_ARGUMENT and the message "A build is already running
    for this index. Wait for it to finish, then try again.", as it used to on the
    first refusal. Writes to one index from separate copies of the core, processes
    or hosts do not wait for each other. Such a write is sent again, with the same
    waits, only when the service refuses it with BUILD_IN_PROGRESS. The Moss
    cloud service refuses a write that overlaps a running build, but an index
    service without that refusal can accept the write and drop it.
  • The README says that Moss searches only the indexes a call names in indexes,
    so a call that leaves it out runs no search, as the gateway does.

Add it to an app module with implementation(files(...)). It is a file AAR, not a Maven Central package.

License

The AAR is licensed under the PolyForm Shield License 1.0.0, not under this repository's BSD 2-Clause License. LICENSE.txt holds the terms. The AAR carries it at META-INF/LICENSE.txt, and at assets/moss/LICENSE.txt beside the licenses of the third-party code it links.

Required Notice: Copyright InferEdge Inc. (https://inferedge.dev)