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.

Your processLocal execution

A query and app-owned data enter RetrievalKit inside your process and return results without a retrieval server.

Inputs
  • Query
  • App-owned data
RetrievalKit
Results
Data stays inside the application boundary0 network calls after model download
Find the right result
Run semantic vector search or blend it with BM25.
Follow the connections
Traverse relationships your application already knows.
Search in context
Use app relationships to scope candidates, then rank them.

1K to fewer than 50K chunksNo account or API keyZero network calls after model download

SwiftPM · PyPI · npm · Maven CentralApache-2.0 · v0.1.0 published preview · github.com/gungorbasa/RetrievalKit

Hybrid ranked results15 passages
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

  1. 02Mission Objective0.851
  2. 03Mission Highlights0.843
  3. 04Mission Highlights0.839
  4. 05Mission Highlights0.826

One real hybrid run over all 15 Apollo 11 passages. Scores combine exact vector similarity and BM25.

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.

One engine. Three query paths.

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.

Swift
let selection = try await graphDatabase.query(
  from: [GraphNodeID(
    nodeType: "Notebook",
    recordID: "product-research"
  )],
  traversing: [GraphTraversal(
    relationship: "references"
  )]
)
03

Graph + vector + BM25

GraphRetrievalDatabase

Select candidates with the graph, then rank only that scope with vector + BM25.

Swift
let selection = try await graphRetrievalDatabase.query(
  from: [GraphNodeID(
    nodeType: "Project",
    recordID: "mobile-app"
  )],
  traversing: [GraphTraversal(
    relationship: "contains"
  )]
)

let hits = try await graphRetrievalDatabase.search(
  text: "Why is cold start slow on Android?",
  embedding: queryEmbedding,
  alpha: 0.6,
  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 mode10K chunks25K chunks50K chunks
Exact search7.17× faster7.60× faster7.29× faster
Filtered search10.38× faster9.08× faster8.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.
CapabilityRetrievalKitLocal retrieval SDKMosssqlite-vecZvecLanceDB OSSQdrant Edge
Follow application relationshipsBuilt inGraph query APINot documentedID + metadata onlyRequires SQLDefine relationshipsNot documentedNot documentedNot documented
Rank only within related recordsBuilt inGraph-scoped retrievalRequires app codeBuild candidate filterRequires SQLBuild candidate setRequires app codeBuild candidate filterRequires app codeBuild candidate filterRequires app codeBuild candidate filter
Explain every hybrid resultDetailed traceRanks + matched termsFinal score onlyRequires SQLSelect each componentFinal score onlyFinal score onlyFinal score only

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
  • Browsernpm WorkersPublished Worker packages; in-memory only, persistence deferred
  • 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.

Build where the data lives.

Three query paths, one engine, in your process — on the device that owns the data.