MossCore. Nif
(moss_core v0.19.0)
Copy Markdown
Rustler NIF declarations for the moss library.
All functions raise :not_loaded if the NIF is not compiled.
Functions that can fail return {:ok, result} or {:error, reason}.
Summary
Functions
Add docs to a cloud index. Returns {:ok, MutationResult} or {:error, reason}.
Create an index in the cloud. Returns {:ok, MutationResult} or {:error, reason}.
Create an index from files via the parse pipeline. Returns {:ok, MutationResult} or {:error, reason}.
Delete docs from a cloud index. Returns {:ok, MutationResult} or {:error, reason}.
Delete a cloud index. Returns {:ok, bool} or {:error, reason}.
Get docs from a cloud index. Returns {:ok, [DocumentInfo]} or {:error, reason}.
Get a cloud index's metadata. Returns {:ok, IndexInfo} or {:error, reason}.
Get job status. Returns {:ok, JobStatusResponse} or {:error, reason}.
List all cloud indexes. Returns {:ok, [IndexInfo]} or {:error, reason}.
Create a new ManageClient resource. Returns {:ok, ref} or {:error, reason}.
Validate project credentials. Returns {:ok, CredentialsInfo} or {:error, reason}.
Current {device_id, moss_device_id} pair of an IndexManager.
Get index metadata. Returns {:ok, IndexInfo} or {:error, reason}.
Check if an index is loaded. Returns boolean.
Load an index from cloud. Returns {:ok, IndexInfo} or {:error, reason}.
Bulk-load indexes. Returns %Moss.LoadIndexesResult{loaded: [...], failed: %{name => reason}}.
Preload the built-in embedding model for a loaded index.
Create a new IndexManager resource. Returns {:ok, ref} or {:error, reason}.
Query a loaded index. Returns {:ok, SearchResult} or {:error, reason}.
Multi-index query with a caller-supplied embedding. Returns {:ok, SearchResult} or {:error, reason}.
Multi-index query where the core embeds the text. Returns {:ok, SearchResult} or {:error, reason}.
Query a loaded index using built-in embeddings from the query text.
Force refresh an index from cloud. Returns {:ok, RefreshResult} or {:error, reason}.
Set the stable per-device id on an IndexManager; nil keeps the current id. Returns :ok.
Unload an index. Returns {:ok, :ok} or {:error, reason}.
Bulk-unload indexes; names that are not loaded are ignored. Returns :ok.
Add documents to a SessionIndex. Returns {:ok, {added, updated}} or {:error, reason}.
Add documents to a SessionIndex using built-in embeddings from document text.
Delete documents from a SessionIndex by IDs. Returns count deleted.
Get the document count of a SessionIndex.
Get documents from a SessionIndex. doc_ids may be nil for all docs.
Load an existing cloud index into the session. Returns {:ok, doc_count} or {:error, reason}.
Load a cloud index into the session with auto-refresh options.
Preload the built-in embedding model for a SessionIndex.
Get the name of a SessionIndex.
Create a new SessionIndex resource.
Push the session index to the cloud. Returns {:ok, PushIndexResult} or {:error, reason}.
Query a SessionIndex. Returns {:ok, SearchResult} or {:error, reason}.
Query a SessionIndex using built-in embeddings from the query text.
Set the stable per-device id on a SessionIndex; nil keeps the current id. Returns :ok.
Override a SessionIndex's device ids when given (nil keeps them) and replace its user id (nil clears it). Returns :ok.
Functions
Add docs to a cloud index. Returns {:ok, MutationResult} or {:error, reason}.
Create an index in the cloud. Returns {:ok, MutationResult} or {:error, reason}.
Create an index from files via the parse pipeline. Returns {:ok, MutationResult} or {:error, reason}.
Delete docs from a cloud index. Returns {:ok, MutationResult} or {:error, reason}.
Delete a cloud index. Returns {:ok, bool} or {:error, reason}.
Get docs from a cloud index. Returns {:ok, [DocumentInfo]} or {:error, reason}.
Get a cloud index's metadata. Returns {:ok, IndexInfo} or {:error, reason}.
Get job status. Returns {:ok, JobStatusResponse} or {:error, reason}.
List all cloud indexes. Returns {:ok, [IndexInfo]} or {:error, reason}.
Create a new ManageClient resource. Returns {:ok, ref} or {:error, reason}.
Validate project credentials. Returns {:ok, CredentialsInfo} or {:error, reason}.
Current {device_id, moss_device_id} pair of an IndexManager.
Get index metadata. Returns {:ok, IndexInfo} or {:error, reason}.
Check if an index is loaded. Returns boolean.
Load an index from cloud. Returns {:ok, IndexInfo} or {:error, reason}.
Bulk-load indexes. Returns %Moss.LoadIndexesResult{loaded: [...], failed: %{name => reason}}.
Preload the built-in embedding model for a loaded index.
Create a new IndexManager resource. Returns {:ok, ref} or {:error, reason}.
Query a loaded index. Returns {:ok, SearchResult} or {:error, reason}.
Multi-index query with a caller-supplied embedding. Returns {:ok, SearchResult} or {:error, reason}.
Multi-index query where the core embeds the text. Returns {:ok, SearchResult} or {:error, reason}.
Query a loaded index using built-in embeddings from the query text.
Force refresh an index from cloud. Returns {:ok, RefreshResult} or {:error, reason}.
Set the stable per-device id on an IndexManager; nil keeps the current id. Returns :ok.
Unload an index. Returns {:ok, :ok} or {:error, reason}.
Bulk-unload indexes; names that are not loaded are ignored. Returns :ok.
Add documents to a SessionIndex. Returns {:ok, {added, updated}} or {:error, reason}.
Add documents to a SessionIndex using built-in embeddings from document text.
Delete documents from a SessionIndex by IDs. Returns count deleted.
Get the document count of a SessionIndex.
Get documents from a SessionIndex. doc_ids may be nil for all docs.
Load an existing cloud index into the session. Returns {:ok, doc_count} or {:error, reason}.
Load a cloud index into the session with auto-refresh options.
When auto_refresh is true, a background task polls the cloud index every
polling_interval_in_seconds and pulls newer versions in on the next
session_query/session_get_docs/session_doc_count. Auto-refresh pauses
while the session has un-pushed local edits, so it never clobbers local work.
Returns {:ok, doc_count} or {:error, reason}.
Preload the built-in embedding model for a SessionIndex.
Get the name of a SessionIndex.
Create a new SessionIndex resource.
Push the session index to the cloud. Returns {:ok, PushIndexResult} or {:error, reason}.
Query a SessionIndex. Returns {:ok, SearchResult} or {:error, reason}.
Query a SessionIndex using built-in embeddings from the query text.
Set the stable per-device id on a SessionIndex; nil keeps the current id. Returns :ok.
Override a SessionIndex's device ids when given (nil keeps them) and replace its user id (nil clears it). Returns :ok.