RetrievalKit is a local retrieval engine for on-device semantic, keyword, and graph search in edge AI apps, with SDKs for Swift, Python, TypeScript, and Kotlin plus a browser WebAssembly build. After model download, zero network calls. v0.1.0 published preview.
Fast, private retrieval for edge AI.
Search private data inside your app.
RetrievalKit is a local retrieval SDK for on-device semantic, keyword, and application-graph search. No retrieval server, account, or API key.
let hits = try await retrievalDatabase.search( text: "When did the crew enter lunar orbit?", embedding: queryEmbedding, alpha: 0.6, limit: 5)
Hybrid ranked results15 passages
01Mission Highlights0.870
On July 19, after Apollo 11 had flown behind the moon out of contact with Earth, came the first lunar orbit insertion maneuver. At about 75 hours, 50 minutes into the flight, a retrograde firing of the SPS for 357.5 seconds placed the spacecraft into an initial, elliptical-lunar orbit of 69 by 190 miles.
vector #1 · keyword #5 · matched lunar, orbit
02Mission Objective0.851
03Mission Highlights0.843
04Mission Highlights0.839
05Mission Highlights0.826
One real hybrid run over all 15 Apollo 11 passages. Scores combine exact vector similarity and BM25.
Eagle undocks from ColumbiaNEXT_EVENTLunar landing
2 states visited · 1 edge traversed · no embedding
A real graph-only traversal over app-declared relationships. It returns the related Event record directly, so there is no relevance score.
let scope = try await graphRetrievalDatabase.query( from: [GraphNodeID(nodeType: "Vehicle", recordID: "vehicle-eagle")], traversing: [ GraphTraversal(relationship: "USED_IN_EVENT"), GraphTraversal(relationship: "EVENT_EVIDENCE") ])// What happened to Eagle from undocking// through reunion with Columbia?let hits = try await graphRetrievalDatabase.search( embedding: queryEmbedding, within: scope, limit: 5)
Graph-scoped vector results6 candidates
ScopeEagle → related events → evidence passages
01Mission Highlights0.390
Armstrong and Aldrin spent 21 hours, 36 minutes on the moon’s surface. After a rest period that included seven hours of sleep, the ascent stage engine fired at 124 hours, 22 minutes.
ranked #1 inside 6 graph-selected passages
02apollo11-mission-highlights-040.375
03apollo11-mission-highlights-050.304
04apollo11-mission-highlights-010.254
05apollo11-mission-highlights-070.225
Graph scope narrowed 15 passages to 6; vector similarity ordered the eligible hits.
Switch between hybrid ranking, graph traversal, and graph-scoped vector search to compare each Swift query with its real output.
Ask Apollo 11 anything—in your browser.
Every question runs live through local browser models and RetrievalKit's WebAssembly core. No canned answers or hosted fallback. Open any citation to see the exact passage in the source document.
Up to 443 MiB
One-time download of MiniLM and Qwen model weights on first use.
~1.4 GB
GPU memory the demo needs, via WebGPU.
Desktop browsers
Tested in Chromium, Firefox, and Safari with WebGPU. Physical mobile browsers remain unqualified.
Choose retrieval, graph, or graph-scoped search through separate APIs over the same local corpus. Your app supplies relationships; RetrievalKit handles traversal and ranking.
The API shapes are exact; the domains are illustrative. No hand-written fusion or query translation layer.
01
Hybrid vector + BM25
RetrievalDatabase
Rank the whole corpus with exact vector similarity and BM25.
Swift
let hits = try await retrievalDatabase.search( text: "What did we decide about offline sync?", embedding: queryEmbedding, alpha: 0.6, limit: 5)
02
Graph query alone
GraphDatabase
Select records by relationship. No embedding or retrieval ranker is involved.
Select candidates with the graph, then rank only that scope with vector + BM25.
Kotlin
graphRetrievalDatabase.query( GraphQuery( GraphSeed.Nodes( listOf(GraphNodeId("Project", "mobile-app")), ), traversals = listOf(GraphTraversal("contains")), ),).use { selection -> val hits = graphRetrievalDatabase.search( text = "Why is cold start slow on Android?", embedding = queryEmbedding, alpha = 0.6f, within = selection, limit = 5, )}
7–10× faster than sqlite-vec.
Across 10K, 25K, and 50K chunks, RetrievalKit completed exact top-10 queries 7.17–7.60× faster. Filtered queries were 8.43–10.38× faster.
Speedup vs sqlite-vec 0.1.9 · higher is better
RetrievalKit query speedup compared with sqlite-vec 0.1.9
Search mode
10K chunks
25K chunks
50K chunks
Exact search
7.17×faster
7.60×faster
7.29×faster
Filtered search
10.38×faster
9.08×faster
8.43×faster
10K chunks
Exact search
7.17×faster
Filtered search
10.38×faster
25K chunks
Exact search
7.60×faster
Filtered search
9.08×faster
50K chunks
Exact search
7.29×faster
Filtered search
8.43×faster
Median query time (P50) on Apple M1 Max, exact F32/384d, top-10. Based on 20 warmups and 100 measured queries. Embedding time excluded. Both engines passed the same correctness checks. Full methodology.
Relationship-aware retrieval, built in.
In this documented comparison, RetrievalKit is the only product with built-in relationship traversal, relationship-scoped ranking, and a detailed trace for every hybrid result.
Swipe horizontally to compare products.
Comparison of RetrievalKit with Moss, sqlite-vec, Zvec, LanceDB OSS, and Qdrant Edge based on official public documentation.
All compared products can query locally. Moss builds and updates its durable index in the cloud, then downloads a local query snapshot.
Comparison based on linked official documentation. Not documented means no native API was found; it may still be built in application code. A remote embedding service can still send application data off-device.
Graph-scoped lift on HotpotQA
NDCG@10
0.858 → 0.928
Recall@10
0.872 → 0.958
Complete-evidence Recall@10
0.743 → 0.922
HotpotQA, 296 queries, 12,670 chunks. Retrieval-only baseline → graph-scoped, same exact ranker: 121 wins, 157 ties, 18 losses on NDCG@10, zero empty scopes. One dataset, one configuration, self-comparison against our own unscoped baseline — not a competitor benchmark, and candidate reduction is not a latency speedup.
RetrievalKit exact top-10 retrieval measured 7.17 times sqlite-vec 0.1.9 at 10K chunks, 7.60 times at 25K, and 7.29 times at 50K; for filtered queries, 10.38, 9.08, and 8.43 times, all on Apple M1 Max. On HotpotQA, graph scoping raised NDCG@10 from 0.858 to 0.928, Recall@10 from 0.872 to 0.958, and complete-evidence Recall@10 from 0.743 to 0.922.
Made for private data inside your app.
RetrievalKit is strongest when one user owns a focused local corpus: notes, transcripts, personal knowledge bases, document assistants, or enterprise data that can’t leave the device.
You choose the embedding model. RetrievalKit indexes and searches inside your application process; native targets can persist the index locally.
Index size
1K to fewer than 50K chunks
Vector shape
384 or 768 dimensions
Query shape
Exact top 5–10 results
This is a deliberate exact-search envelope. For million-scale corpora or approximate nearest-neighbor indexing, choose a general vector database; HNSW and ANN are not part of this preview.
Available where local apps run
SwiftSwiftPMmacOS 14+ arm64 and iOS 15+ arm64
PythonPyPImacOS arm64, CPython 3.10–3.14
TypeScriptnpmmacOS arm64, Node.js 22.13+ or 24 LTS
KotlinMaven CentralJVM macOS arm64 · Android API 24+ arm64-v8a: packaging-qualified preview, no live-device pass
Every package ships under Apache-2.0. Registry publication is not device support: no Linux or Windows until a release manifest lists them. A physical iPhone 17 Pro Max passed the supported 10K, 25K, and 50K F32/I8 qualification workloads, with embedding excluded. Review the full evidence. Check Swift and Apple integration, or inspect the browser Worker boundary. If your app calls a remote embedding service, that step isn’t local; privacy is a property of the whole pipeline you assemble.
v0.1.0, published and signed.
Available from a signed tag through SwiftPM, PyPI, npm, and Maven Central. This is a 0.x preview: minor releases may refine APIs, with changelog entries and migration guidance. The downloadable Python source preview contains the released wrapper source.