Repository navigation
Moss Android SDK v0.32.0
·
4 commits
to main
since this release
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, atMETA-INF/LICENSE.txtand 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 fromcachePathasks
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. loadIndexandloadIndexesneed less memory. The index file, downloaded or
read fromcachePath, 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 tocachePathfrees 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 tocachePath. Auto-refresh of an
index loaded withoutcachePathinstalls 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,$lteand$nearare 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
MossExceptionwhose code
isMossErrorCode.INVALID_ARGUMENTand 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, anddetailstill names the service's code.
Fixed
- A string that holds an unpaired surrogate or U+0000, which a UTF-8 C string
cannot hold, throwsMossException.InvalidArgumentas a metadata filter of
MossClient.query,MossClient.queryMultiIndexorMossSession.query, as an
id ofdeleteDocs, and as a metadata entry or payload ofMossSession.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,addDocsanddeleteDocscalls on one index run
one at a time across everyMossClientthat 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.pushIndexwaits 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.deleteIndexdoes 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
addDocscalls 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 aMossExceptionwhose code is
MossErrorCode.INVALID_ARGUMENTand 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 withBUILD_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)