Sofuu inside your app.
The same engine as the CLI, as a library: offline embeddings, encrypted memory, streaming, and voice. No cloud account, no API key in your binary, no telemetry.
Three integrations.
iOS / macOS
SwiftPM package or CocoaPods pod. A checksum-stamping script pins the binary so SwiftPM verifies it.
Neither coordinate installed in the 2026-10-31 audit. At the v0.3.0-beta tag the SwiftPM binary target still carries an all-zero placeholder checksum and points at the v0.2.0 xcframework zip, and the podspec in the repo vendors that same release xcframework, which is not committed (dist/ is ignored). They become installable when a release stamps the checksum and uploads the xcframework; until then, build from source (make libsofuu).
.package(url: "https://github.com/sofuu-runtime/sofuu.git", exact: "0.3.0-beta")// or with CocoaPods (podspec in the repo; not on trunk yet)pod 'Sofuu', :git => 'https://github.com/sofuu-runtime/sofuu.git', :tag => 'v0.3.0-beta'
Android
Gradle AAR with the same engine and the same embedding spaces. The site recorded the coordinate below as available in the 2026-10-31 audit; verify current artifact availability and device support before use.
maven { url = uri("https://sofuu-runtime.github.io/sofuu/maven") }implementation 'com.sofuu:sofuu-android:0.3.0' // tracks the v0.3.0-beta.2 release
C / C++
One header plus a static or shared library. No prebuilt C ABI archive is published yet: the header is committed at include/sofuu_embed.h and make libsofuu buildsdist/libsofuu.a / libsofuu.dylib.
// one header + static/shared lib#include "sofuu_embed.h"
A private agent in ten lines.
Typed Swift layer over the C ABI: offline embed, an encrypted local brain, streaming with cancel. Typechecked against the real C header in CI.
import Sofuulet sofuu = try Sofuu()let vec = try sofuu.embed("the sky is blue")let brain = try Brain.openDefault(sofuu: sofuu)try brain.remember("the sky is blue")for hit in try brain.recall("what colour is the sky?", k: 3) {print(hit.text, hit.score)}
What the library exposes.
| Area | Functions |
|---|---|
memory | open · remember · recall · count · flush — persistent vector store. |
embed | sofuu_embed_local / batch / image / info — offline vectors, no network. |
stream | delta events with exactly one terminal done event, success or failure — plus live mid-flight cancel. |
voice | sofuu_voice_transcribe / speak — speech-to-text and text-to-speech. |
mcp | mcp.call — call tools on a connected MCP server. |
http | http.serve — serve from inside the host app. |
Error model: unknown methods return a distinct unknown_method code, and supported streams have a terminal done event. Hosts should still handle failures and timeouts. Default embedding space is hash-768, matching the brain, so embed-to-remember works with no configuration.
Text queries retrieve images.
Image bytes map to 64-dim vectors joint with text. Store captioned images, recall them with words.
// 1. Open a 64-dim image storeopen(path, 64, "image-projector-v1")// 2. Remember image vectors with captionsremember(imageVector, "a red bicycle")// 3. Recall with a text vectorrecall(textVector("red bike"), k: 3)
Voice follows the same local-first shape: transcription and speech through an endpoint you configure, with on-device handling in the SDK wrappers.
Embedding considerations.
| Property | How it holds |
|---|---|
No JIT | QuickJS has no JIT. App-store acceptance depends on the complete application and has not been established here. |
0-byte model | Embeddings ship with no model file at all. |
Sealed brain | Memory is encrypted by default; plaintext mode and unencrypted brain-card exports exist. |
Pinned binaries | The release script stamps and commits the SwiftPM checksum; the current v0.3.0-beta tag still carries a placeholder, so SwiftPM resolution is pending. |
One header | The C ABI is one header plus a static/shared library; unknown methods return a distinct unknown_method code. |