Skip to main content

Crate velesdb_mobile

Crate velesdb_mobile 

Source
Expand description

VelesDB Mobile - Native bindings for iOS and Android

This crate provides UniFFI bindings for VelesDB, enabling native integration with Swift (iOS) and Kotlin (Android) applications.

§Architecture

  • iOS: Generates Swift bindings + XCFramework (arm64 device, arm64/x86_64 simulator)
  • Android: Generates Kotlin bindings + AAR (arm64-v8a, armeabi-v7a, x86_64)

§Build Commands

# iOS - build for device and simulator
cargo build --release --target aarch64-apple-ios
cargo build --release --target aarch64-apple-ios-sim
cargo build --release --target x86_64-apple-ios  # Intel simulator

# iOS - create universal binary + XCFramework
lipo -create \
  target/aarch64-apple-ios-sim/release/libvelesdb_mobile.a \
  target/x86_64-apple-ios/release/libvelesdb_mobile.a \
  -output target/universal-sim/libvelesdb_mobile.a
xcodebuild -create-xcframework \
  -library target/aarch64-apple-ios/release/libvelesdb_mobile.a \
  -library target/universal-sim/libvelesdb_mobile.a \
  -output VelesDB.xcframework

# Android (requires cargo-ndk: cargo install cargo-ndk)
cargo ndk -t arm64-v8a -t armeabi-v7a -t x86_64 build --release

Structs§

IndividualSearchRequest
Individual search request within a batch.
MobileAdvancedConfig
Post-creation overrides for advanced collection configuration.
MobileAsyncIndexBuilderConfig
Async index builder configuration (parallel segment construction for deferred bulk loads).
MobileCollectionDiagnostics
Diagnostic snapshot of a collection’s health and search readiness.
MobileCollectionStats
Public statistics snapshot for a collection.
MobileDeferredIndexerConfig
Deferred indexing configuration (buffers bulk inserts before merging into the HNSW index).
MobileGraphEdge
A graph edge representing a relationship.
MobileGraphNode
A graph node for knowledge graph construction.
MobileGraphStore
In-memory graph store for mobile knowledge graphs.
MobileIndexInfo
Metadata and graph index details.
MobileQueryContext
Read-time context handed to a foreign MobileObserver.
MobileQueryLimits
Runtime query guardrail limits for a collection.
MobileStreamingConfig
Configuration for streaming ingestion on a collection.
PqTrainConfig
Configuration for Product Quantization training.
QueryResult
Result of executing a VelesQL query via crate::VelesDatabase::execute_query.
QueryResultRow
A single row in a query result, serialized as JSON for FFI safety.
SearchResult
A search result containing an ID and similarity score.
SemanticResult
Result from semantic memory query.
TraversalResult
Traversal result from BFS/DFS.
VelesCollection
A collection of vectors with associated metadata.
VelesDatabase
VelesDB database instance.
VelesPoint
A point to insert into the database.
VelesSemanticMemory
Semantic Memory for AI agents on mobile.
VelesSparseVector
A sparse vector represented as parallel arrays of indices and values.

Enums§

DistanceMetric
Distance metric for vector similarity.
FusionStrategy
Fusion strategy for combining results from multiple vector searches.
MobileAccessDecision
The control-plane decision returned by a foreign MobileObserver.
MobileQueryOperationKind
The read operation being gated (UniFFI mirror of core’s QueryOperationKind).
QueryResultKind
Classifies the kind of VelesQL statement that was executed.
SearchQuality
Search quality profile controlling the recall/latency tradeoff.
StorageMode
Storage mode for vector quantization (IoT/Edge optimization).
VelesError
Errors that can occur when using VelesDB on mobile.

Traits§

MobileObserver
Foreign-implementable read-path observer (UniFFI callback interface).