{"id":31478924,"url":"https://github.com/sqliteai/sqlite-vector","last_synced_at":"2026-02-09T09:09:20.994Z","repository":{"id":308157357,"uuid":"961916425","full_name":"sqliteai/sqlite-vector","owner":"sqliteai","description":"SQLite-Vector is a cross-platform, ultra-efficient SQLite extension that brings vector search capabilities to your embedded database.","archived":false,"fork":false,"pushed_at":"2026-01-21T13:47:13.000Z","size":2859,"stargazers_count":546,"open_issues_count":3,"forks_count":20,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-01-21T18:38:11.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sqlite.ai/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sqliteai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-07T11:17:59.000Z","updated_at":"2026-01-21T13:47:52.000Z","dependencies_parsed_at":"2025-08-27T18:23:39.503Z","dependency_job_id":"4addda3f-3c44-4038-89d3-cdd4563c57fd","html_url":"https://github.com/sqliteai/sqlite-vector","commit_stats":null,"previous_names":["sqliteai/sqlite-vector"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/sqliteai/sqlite-vector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqliteai%2Fsqlite-vector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqliteai%2Fsqlite-vector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqliteai%2Fsqlite-vector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqliteai%2Fsqlite-vector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqliteai","download_url":"https://codeload.github.com/sqliteai/sqlite-vector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqliteai%2Fsqlite-vector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29260426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-02T04:01:38.370Z","updated_at":"2026-02-09T09:09:20.981Z","avatar_url":"https://github.com/sqliteai.png","language":"C","readme":"# SQLite Vector\n\n**SQLite Vector** is a cross-platform, ultra-efficient SQLite extension that brings vector search capabilities to your embedded database. It works seamlessly on **iOS, Android, Windows, Linux, and macOS**, using just **30MB of memory** by default. With support for **Float32, Float16, BFloat16, Int8, UInt8 and 1Bit**, and **highly optimized distance functions**, it's the ideal solution for **Edge AI** applications.\n\n## Highlights\n\n* **No virtual tables required** – store vectors directly as `BLOB`s in ordinary tables\n* **Blazing fast** – optimized C implementation with SIMD acceleration\n* **Low memory footprint** – defaults to just 30MB of RAM usage\n* **Zero preindexing needed** – no long preprocessing or index-building phases\n* **Works offline** – perfect for on-device, privacy-preserving AI workloads\n* **Plug-and-play** – drop into existing SQLite workflows with minimal effort\n* **Cross-platform** – works out of the box on all major OSes\n\n\n## Why Use SQLite-Vector?\n\n| Feature                      | SQLite-Vector | Traditional Solutions                      |\n| ---------------------------- | ------------- | ------------------------------------------ |\n| Works with ordinary tables   | ✅             | ❌ (usually require special virtual tables) |\n| Doesn't need preindexing     | ✅             | ❌ (can take hours for large datasets)      |\n| Doesn't need external server | ✅             | ❌ (often needs Redis/FAISS/Weaviate/etc.)  |\n| Memory-efficient             | ✅             | ❌                                          |\n| Easy to use SQL              | ✅             | ❌ (often complex JOINs, subqueries)        |\n| Offline/Edge ready           | ✅             | ❌                                          |\n| Cross-platform               | ✅             | ❌                                          |\n\nUnlike other vector databases or extensions that require complex setup, SQLite-Vector **just works** with your existing database schema and tools.\n\n\n## Installation\n\n### Pre-built Binaries\n\nDownload the appropriate pre-built binary for your platform from the official [Releases](https://github.com/sqliteai/sqlite-vector/releases) page:\n\n- Linux: x86 and ARM\n- macOS: x86 and ARM\n- Windows: x86\n- Android\n- iOS\n\n### Loading the Extension\n\n```sql\n-- In SQLite CLI\n.load ./vector\n\n-- In SQL\nSELECT load_extension('./vector');\n```\n\nOr embed it directly into your application.\n\n### WASM Version\n\nYou can download the WebAssembly (WASM) version of SQLite with the SQLite Vector extension enabled from: https://www.npmjs.com/package/@sqliteai/sqlite-wasm\n\n## Example Usage\n\n```sql\n-- Create a regular SQLite table\nCREATE TABLE images (\n  id INTEGER PRIMARY KEY,\n  embedding BLOB, -- store Float32/UInt8/etc.\n  label TEXT\n);\n\n-- Insert a BLOB vector (Float32, 384 dimensions) using bindings\nINSERT INTO images (embedding, label) VALUES (?, 'cat');\n\n-- Insert a JSON vector (Float32, 384 dimensions)\nINSERT INTO images (embedding, label) VALUES (vector_as_f32('[0.3, 1.0, 0.9, 3.2, 1.4,...]'), 'dog');\n\n-- Initialize the vector. By default, the distance function is L2.\n-- To use a different metric, specify one of the following options:\n-- distance=L1, distance=COSINE, distance=DOT, distance=SQUARED_L2, or distance=HAMMING.\nSELECT vector_init('images', 'embedding', 'type=FLOAT32,dimension=384');\n\n-- Quantize vector\nSELECT vector_quantize('images', 'embedding');\n\n-- Optional preload quantized version in memory (for a 4x/5x speedup) \nSELECT vector_quantize_preload('images', 'embedding');\n\n-- Run a nearest neighbor query on the quantized version (returns top 20 closest vectors)\nSELECT e.id, v.distance FROM images AS e\n   JOIN vector_quantize_scan('images', 'embedding', ?, 20) AS v\n   ON e.id = v.rowid;\n\n-- Streaming mode: omit k to get rows progressively, use SQL to filter and limit\nSELECT e.id, v.distance FROM images AS e\n   JOIN vector_quantize_scan('images', 'embedding', ?) AS v\n   ON e.id = v.rowid\n   WHERE e.label = 'cat'\n   LIMIT 10;\n```\n\n### Swift Package\n\nYou can [add this repository as a package dependency to your Swift project](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app#Add-a-package-dependency). After adding the package, you'll need to set up SQLite with extension loading by following steps 4 and 5 of [this guide](https://github.com/sqliteai/sqlite-extensions-guide/blob/main/platforms/ios.md#4-set-up-sqlite-with-extension-loading).\n\nHere's an example of how to use the package:\n```swift\nimport vector\n\n...\n\nvar db: OpaquePointer?\nsqlite3_open(\":memory:\", \u0026db)\nsqlite3_enable_load_extension(db, 1)\nvar errMsg: UnsafeMutablePointer\u003cInt8\u003e? = nil\nsqlite3_load_extension(db, vector.path, nil, \u0026errMsg)\nvar stmt: OpaquePointer?\nsqlite3_prepare_v2(db, \"SELECT vector_version()\", -1, \u0026stmt, nil)\ndefer { sqlite3_finalize(stmt) }\nsqlite3_step(stmt)\nlog(\"vector_version(): \\(String(cString: sqlite3_column_text(stmt, 0)))\")\nsqlite3_close(db)\n```\n\n### Android Package\n\nAdd the [following](https://central.sonatype.com/artifact/ai.sqlite/vector) to your Gradle dependencies:\n\n```gradle\nimplementation 'ai.sqlite:vector:0.9.80'\n```\n\nHere's an example of how to use the package:\n```java\nSQLiteCustomExtension vectorExtension = new SQLiteCustomExtension(getApplicationInfo().nativeLibraryDir + \"/vector\", null);\nSQLiteDatabaseConfiguration config = new SQLiteDatabaseConfiguration(\n    getCacheDir().getPath() + \"/vector_test.db\",\n    SQLiteDatabase.CREATE_IF_NECESSARY | SQLiteDatabase.OPEN_READWRITE,\n    Collections.emptyList(),\n    Collections.emptyList(),\n    Collections.singletonList(vectorExtension)\n);\nSQLiteDatabase db = SQLiteDatabase.openDatabase(config, null, null);\n```\n\n**Note:** Additional settings and configuration are required for a complete setup. For full implementation details, see the [complete Android example](https://github.com/sqliteai/sqlite-extensions-guide/blob/main/examples/android/README.md).\n\n### Python Package\n\nPython developers can quickly get started using the ready-to-use `sqlite-vector` package available on PyPI:\n\n```bash\npip install sqliteai-vector\n```\n\nFor usage details and examples, see the [Python package documentation](./packages/python/README.md).\n\n## Documentation\n\nExtensive API documentation can be found in the [API page](https://github.com/sqliteai/sqlite-vector/blob/main/API.md).\n\nMore information about the quantization process can be found in the [QUANTIZATION document](https://github.com/sqliteai/sqlite-vector/blob/main/QUANTIZATION.md).\n\n## Features\n\n### Instant Vector Search – No Preindexing Required\n\nUnlike other SQLite vector extensions that rely on complex indexing algorithms such as DiskANN, HNSW, or IVF, which often require **preprocessing steps that can take hours or even days**, `sqlite-vector` works out of the box with your existing data. There’s **no need to preindex your vectors**—you can start performing fast, approximate or exact vector searches **immediately**.\n\nThis means:\n\n* **No waiting time** before your app or service is usable\n* **Zero-cost updates** – you can add, remove, or modify vectors on the fly without rebuilding any index\n* **Works directly with BLOB columns** in ordinary SQLite tables – no special schema or virtual table required\n* **Ideal for edge and mobile use cases**, where preprocessing large datasets is not practical or possible\n\nBy eliminating the need for heavyweight indexing, `sqlite-vector` offers a **simpler, faster, and more developer-friendly** approach to embedding vector search in your applications.\n\n### Supported Vector Types\n\nYou can store your vectors as `BLOB` columns in ordinary tables. Supported formats include:\n\n* `float32` (4 bytes per element)\n* `float16` (2 bytes per element)\n* `bfloat16` (2 bytes per element)\n* `int8` (1 byte per element)\n* `uint8` (1 byte per element)\n* `1bit` (1 bit per element)\n\nSimply insert a vector as a binary blob into your table. No special table types or schemas are required.\n\n\n### Supported Distance Metrics\n\nOptimized implementations available:\n\n* **L2 Distance (Euclidean)**\n* **Squared L2**\n* **L1 Distance (Manhattan)**\n* **Cosine Distance**\n* **Dot Product**\n* **Hamming Distance** (available only with 1bit vectors)\n\nThese are implemented in pure C and optimized for SIMD when available, ensuring maximum performance on modern CPUs and mobile devices.\n\n---\n\n# What Is Vector Search?\n\nVector search is the process of finding the closest match(es) to a given vector (a point in high-dimensional space) based on a similarity or distance metric. It is essential for AI and machine learning applications where data is often encoded into vector embeddings.\n\n### Common Use Cases\n\n* **Semantic Search**: find documents, emails, or messages similar to a query\n* **Image Retrieval**: search for visually similar images\n* **Recommendation Systems**: match users with products, videos, or music\n* **Voice and Audio Search**: match voice queries or environmental sounds\n* **Anomaly Detection**: find outliers in real-time sensor data\n* **Robotics**: localize spatial features or behaviors using embedded observations\n\nIn the AI era, embeddings are everywhere – from language models like GPT to vision transformers. Storing and searching them efficiently is the foundation of intelligent applications.\n\n## Perfect for Edge AI\n\nSQLite-Vector is designed with the **Edge AI** use case in mind:\n\n* Runs offline – no internet required\n* Works on mobile devices – iOS/Android friendly\n* Keeps data local – ideal for privacy-focused apps\n* Extremely fast – real-time performance on device\n\nYou can deploy powerful similarity search capabilities right inside your app or embedded system – **no cloud needed**.\n\n## Integrations\n\nUse SQLite-AI alongside:\n\n* **[SQLite-AI](https://github.com/sqliteai/sqlite-ai)** – on-device inference, embedding generation, and model interaction directly into your database\n* **[SQLite-Sync](https://github.com/sqliteai/sqlite-sync)** – sync on-device databases with the cloud\n* **[SQLite-JS](https://github.com/sqliteai/sqlite-js)** – define SQLite functions in JavaScript\n\n## License\n\nThis project is licensed under the [Elastic License 2.0](./LICENSE.md). You can use, copy, modify, and distribute it under the terms of the license for non-production use. For production or managed service use, please [contact SQLite Cloud, Inc](mailto:info@sqlitecloud.io) for a commercial license.\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqliteai%2Fsqlite-vector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqliteai%2Fsqlite-vector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqliteai%2Fsqlite-vector/lists"}