CINXE.COM

Using sqlite-vec in rqlite | sqlite-vec

<!DOCTYPE html> <html lang="en-US" dir="ltr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Using sqlite-vec in rqlite | sqlite-vec</title> <meta name="description" content="A vector search SQLite extension that runs anywhere!"> <meta name="generator" content="VitePress v1.1.4"> <link rel="preload stylesheet" href="/sqlite-vec/assets/style.DVGWhOrg.css" as="style"> <script type="module" src="/sqlite-vec/assets/app.DkhtMD9F.js"></script> <link rel="preload" href="/sqlite-vec/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin=""> <link rel="modulepreload" href="/sqlite-vec/assets/chunks/theme.BG92KUbS.js"> <link rel="modulepreload" href="/sqlite-vec/assets/chunks/framework.KM5qjeae.js"> <link rel="modulepreload" href="/sqlite-vec/assets/rqlite.md.DA1Jby5X.lean.js"> <link rel="shortcut icon" type="image/svg+xml" href="./logo.light.svg"> <script defer data-domain="alexgarcia.xyz/sqlite-vec" src="https://plausible.io/js/script.js"></script> <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script> <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script> </head> <body> <div id="app"><div class="Layout" data-v-d8b57b2d><!--[--><marquee class="banner" scrollamount="10">🚧🚧🚧 This documentation is a work-in-progress! 🚧🚧🚧</marquee><!--]--><!--[--><span tabindex="-1" data-v-c8291ffa></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-c8291ffa> Skip to content </a><!--]--><!----><header class="VPNav" data-v-d8b57b2d data-v-7ad780c2><div class="VPNavBar has-sidebar top" data-v-7ad780c2 data-v-844edcde><div class="wrapper" data-v-844edcde><div class="container" data-v-844edcde><div class="title" data-v-844edcde><div class="VPNavBarTitle has-sidebar" data-v-844edcde data-v-0ad69264><a class="title" href="/sqlite-vec/" data-v-0ad69264><!--[--><!--]--><!--[--><!--[--><!--[--><img class="VPImage dark logo" src="/sqlite-vec/logo.light.svg" alt="sqlite-vec logo" data-v-ab19afbb><!--]--><!--[--><img class="VPImage light logo" src="/sqlite-vec/logo.dark.svg" alt="sqlite-vec logo" data-v-ab19afbb><!--]--><!--]--><!--]--><span data-v-0ad69264>sqlite-vec</span><!--[--><!--]--></a></div></div><div class="content" data-v-844edcde><div class="content-body" data-v-844edcde><!--[--><!--]--><div class="VPNavBarSearch search" data-v-844edcde><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-844edcde data-v-f732b5d0><span id="main-nav-aria-label" class="visually-hidden" data-v-f732b5d0>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/sqlite-vec/api-reference.html" tabindex="0" data-v-f732b5d0 data-v-08fbf4b6><!--[--><span data-v-08fbf4b6>API Reference</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://github.com/sponsors/asg017" target="_blank" rel="noreferrer" tabindex="0" data-v-f732b5d0 data-v-08fbf4b6><!--[--><span data-v-08fbf4b6>♥ Sponsor</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-f732b5d0 data-v-af5898d3><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-af5898d3><span class="text" data-v-af5898d3><!----><span data-v-af5898d3>v0.1.6</span><span class="vpi-chevron-down text-icon" data-v-af5898d3></span></span></button><div class="menu" data-v-af5898d3><div class="VPMenu" data-v-af5898d3 data-v-e42ed9b3><div class="items" data-v-e42ed9b3><!--[--><!--[--><div class="VPMenuLink" data-v-e42ed9b3 data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://github.com/asg017/sqlite-vec/releases/0.1.6" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Github Release<!--]--></a></div><!--]--><!--[--><div class="VPMenuGroup" data-v-e42ed9b3 data-v-a6b0397c><p class="title" data-v-a6b0397c>Bindings</p><!--[--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://pypi.org/project/sqlite-vec" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Python: PyPi package<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://www.npmjs.com/package/sqlite-vec" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Node.js: NPM package<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://rubygems.org/gems/sqlite-vec" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Ruby: Ruby gem<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://crates.io/crates/sqlite-vec" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Rust: Cargo crate<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://pkg.go.dev/github.com/asg017/sqlite-vec-go-bindings/cgo" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Golang: Go module (CGO)<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://pkg.go.dev/github.com/asg017/sqlite-vec-go-bindings/ncruces" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Golang: Go module (WASM ncruces)<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://datasette.io/plugins/datasette-sqlite-vec" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->Datasette: Plugin<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-a6b0397c data-v-f51f088d><a class="VPLink link vp-external-link-icon" href="https://datasette.io/plugins/datasette-sqlite-vec" target="_blank" rel="noreferrer" data-v-f51f088d><!--[-->sqlite-utils: Plugin<!--]--></a></div><!--]--><!--]--></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-844edcde data-v-283b26e9><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-283b26e9 data-v-7df97737 data-v-b4ccac88><span class="check" data-v-b4ccac88><span class="icon" data-v-b4ccac88><!--[--><span class="vpi-sun sun" data-v-7df97737></span><span class="vpi-moon moon" data-v-7df97737></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-844edcde data-v-ef6192dc data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://github.com/asg017/sqlite-vec" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://discord.gg/Ve7WeCJFXk" aria-label="discord" target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><span class="vpi-social-discord" /></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-844edcde data-v-8e87c032 data-v-af5898d3><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-af5898d3><span class="vpi-more-horizontal icon" data-v-af5898d3></span></button><div class="menu" data-v-af5898d3><div class="VPMenu" data-v-af5898d3 data-v-e42ed9b3><!----><!--[--><!--[--><!----><div class="group" data-v-8e87c032><div class="item appearance" data-v-8e87c032><p class="label" data-v-8e87c032>Appearance</p><div class="appearance-action" data-v-8e87c032><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title="Switch to dark theme" aria-checked="false" data-v-8e87c032 data-v-7df97737 data-v-b4ccac88><span class="check" data-v-b4ccac88><span class="icon" data-v-b4ccac88><!--[--><span class="vpi-sun sun" data-v-7df97737></span><span class="vpi-moon moon" data-v-7df97737></span><!--]--></span></span></button></div></div></div><div class="group" data-v-8e87c032><div class="item social-links" data-v-8e87c032><div class="VPSocialLinks social-links-list" data-v-8e87c032 data-v-e71e869c><!--[--><a class="VPSocialLink no-icon" href="https://github.com/asg017/sqlite-vec" aria-label="github" target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://discord.gg/Ve7WeCJFXk" aria-label="discord" target="_blank" rel="noopener" data-v-e71e869c data-v-358b6670><span class="vpi-social-discord" /></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-844edcde data-v-6bee1efd><span class="container" data-v-6bee1efd><span class="top" data-v-6bee1efd></span><span class="middle" data-v-6bee1efd></span><span class="bottom" data-v-6bee1efd></span></span></button></div></div></div></div><div class="divider" data-v-844edcde><div class="divider-line" data-v-844edcde></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-d8b57b2d data-v-2488c25a><div class="container" data-v-2488c25a><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-2488c25a><span class="vpi-align-left menu-icon" data-v-2488c25a></span><span class="menu-text" data-v-2488c25a>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-2488c25a data-v-883964e0><button data-v-883964e0>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-d8b57b2d data-v-4871f9f5><div class="curtain" data-v-4871f9f5></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-4871f9f5><span class="visually-hidden" id="sidebar-aria-label" data-v-4871f9f5> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="group" data-v-4871f9f5><section class="VPSidebarItem level-0 collapsible collapsed" data-v-4871f9f5 data-v-c24f735a><div class="item" role="button" tabindex="0" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><h2 class="text" data-v-c24f735a>Getting Started</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-c24f735a><span class="vpi-chevron-right caret-icon" data-v-c24f735a></span></div></div><div class="items" data-v-c24f735a><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/introduction.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Introduction</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/installation.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Installation</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-4871f9f5><section class="VPSidebarItem level-0 collapsible has-active" data-v-4871f9f5 data-v-c24f735a><div class="item" role="button" tabindex="0" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><h2 class="text" data-v-c24f735a>Using with...</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-c24f735a><span class="vpi-chevron-right caret-icon" data-v-c24f735a></span></div></div><div class="items" data-v-c24f735a><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/python.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Python</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/js.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>JavaScript</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/ruby.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Ruby</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/rust.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Rust</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/go.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Go</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/c.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>C/C++</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/wasm.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Browser (WASM)</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/datasette.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Datasette</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/sqlite-utils.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>sqlite-utils</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/rqlite.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>rqlite</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/android-ios.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Android+iOS</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-4871f9f5><section class="VPSidebarItem level-0 collapsible collapsed" data-v-4871f9f5 data-v-c24f735a><div class="item" role="button" tabindex="0" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><h2 class="text" data-v-c24f735a>Features</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-c24f735a><span class="vpi-chevron-right caret-icon" data-v-c24f735a></span></div></div><div class="items" data-v-c24f735a><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/features/vector-formats.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Vector formats</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/features/knn.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>KNN queries</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/features/vec0.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>vec0 Virtual Tables</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-4871f9f5><section class="VPSidebarItem level-0 collapsible collapsed" data-v-4871f9f5 data-v-c24f735a><div class="item" role="button" tabindex="0" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><h2 class="text" data-v-c24f735a>Guides</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-c24f735a><span class="vpi-chevron-right caret-icon" data-v-c24f735a></span></div></div><div class="items" data-v-c24f735a><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/guides/performance.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Performance</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1" data-v-c24f735a data-v-c24f735a><div class="item" role="button" tabindex="0" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><h3 class="text" data-v-c24f735a>Vector operations</h3><!----></div><div class="items" data-v-c24f735a><!--[--><div class="VPSidebarItem level-2 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/guides/arithmetic.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Vector Arithmetic</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/guides/binary-quant.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Binary Quantization</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/guides/scalar-quant.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Scalar Quantization</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/guides/matryoshka.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Matryoshka Embeddings</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="group" data-v-4871f9f5><section class="VPSidebarItem level-0" data-v-4871f9f5 data-v-c24f735a><div class="item" role="button" tabindex="0" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><h2 class="text" data-v-c24f735a>Documentation</h2><!----></div><div class="items" data-v-c24f735a><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/compiling.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>Compiling</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link link" href="/sqlite-vec/api-reference.html" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>API Reference</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="group" data-v-4871f9f5><section class="VPSidebarItem level-0" data-v-4871f9f5 data-v-c24f735a><div class="item" role="button" tabindex="0" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><h2 class="text" data-v-c24f735a>See also</h2><!----></div><div class="items" data-v-c24f735a><!--[--><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link vp-external-link-icon link" href="https://github.com/asg017/sqlite-ecosystem" target="_blank" rel="noreferrer" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>sqlite-ecosystem</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link vp-external-link-icon link" href="https://github.com/asg017/sqlite-lembed" target="_blank" rel="noreferrer" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>sqlite-lembed</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-c24f735a data-v-c24f735a><div class="item" data-v-c24f735a><div class="indicator" data-v-c24f735a></div><a class="VPLink link vp-external-link-icon link" href="https://github.com/asg017/sqlite-rembed" target="_blank" rel="noreferrer" data-v-c24f735a><!--[--><p class="text" data-v-c24f735a>sqlite-rembed</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-d8b57b2d data-v-9a6c75ad><div class="VPDoc has-sidebar has-aside" data-v-9a6c75ad data-v-e6f2a212><!--[--><!--]--><div class="container" data-v-e6f2a212><div class="aside" data-v-e6f2a212><div class="aside-curtain" data-v-e6f2a212></div><div class="aside-container" data-v-e6f2a212><div class="aside-content" data-v-e6f2a212><div class="VPDocAside" data-v-e6f2a212 data-v-cb998dce><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" role="navigation" data-v-cb998dce data-v-269d7ea7><div class="content" data-v-269d7ea7><div class="outline-marker" data-v-269d7ea7></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-269d7ea7>On this page</div><ul class="VPDocOutlineItem root" data-v-269d7ea7 data-v-53c99d69><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-cb998dce></div><!--[--><!--[--><!--[--><!--[--><div><div class="VPDocAsideSponsors"><div class="VPSponsors vp-sponsor aside"><!--[--><section class="vp-sponsor-section"><!----><div class="VPSponsorsGrid vp-sponsor-grid big"><!--[--><div class="vp-sponsor-grid-item"><a class="vp-sponsor-grid-link" href="" target="_blank" rel="sponsored noopener"><article class="vp-sponsor-grid-box"><h4 class="visually-hidden">Mozilla Builders</h4><img class="vp-sponsor-grid-image" src="/sqlite-vec/mozilla.svg" alt="Mozilla Builders"></article></a></div><!--]--></div></section><section class="vp-sponsor-section"><!----><div class="VPSponsorsGrid vp-sponsor-grid medium"><!--[--><div class="vp-sponsor-grid-item"><a class="vp-sponsor-grid-link" href="https://fly.io" target="_blank" rel="sponsored noopener"><article class="vp-sponsor-grid-box"><h4 class="visually-hidden">Fly.io</h4><img class="vp-sponsor-grid-image" src="/sqlite-vec/flyio.svg" alt="Fly.io"></article></a></div><!--]--></div></section><section class="vp-sponsor-section"><!----><div class="VPSponsorsGrid vp-sponsor-grid medium"><!--[--><div class="vp-sponsor-grid-item"><a class="vp-sponsor-grid-link" href="https://turso.tech" target="_blank" rel="sponsored noopener"><article class="vp-sponsor-grid-box"><h4 class="visually-hidden">Turso</h4><img class="vp-sponsor-grid-image" src="/sqlite-vec/turso.svg" alt="Turso"></article></a></div><!--]--></div></section><section class="vp-sponsor-section"><!----><div class="VPSponsorsGrid vp-sponsor-grid medium"><!--[--><div class="vp-sponsor-grid-item"><a class="vp-sponsor-grid-link" href="https://sqlitecloud.io" target="_blank" rel="sponsored noopener"><article class="vp-sponsor-grid-box"><h4 class="visually-hidden">SQLite Cloud</h4><img class="vp-sponsor-grid-image" src="/sqlite-vec/sqlitecloud.svg" alt="SQLite Cloud"></article></a></div><!--]--></div></section><!--]--></div></div><div style="font-size:14px;text-align:center;font-style:italic;margin-top:4px;"><a href="https://github.com/asg017/sqlite-vec#sponsors">Become a sponsor! ↗</a></div></div><!--]--><!--]--><!--]--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-e6f2a212><div class="content-container" data-v-e6f2a212><!--[--><!--]--><main class="main" data-v-e6f2a212><div style="position:relative;" class="vp-doc _sqlite-vec_rqlite" data-v-e6f2a212><div><h1 id="using-sqlite-vec-in-rqlite" tabindex="-1">Using <code>sqlite-vec</code> in rqlite <a class="header-anchor" href="#using-sqlite-vec-in-rqlite" aria-label="Permalink to &quot;Using `sqlite-vec` in rqlite&quot;">​</a></h1><p><a href="https://rqlite.io/" target="_blank" rel="noreferrer">rqlite</a> users can use <code>sqlite-vec</code> with rqlite by loading the extension when they launch their rqlite node:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Download a sqlite-vec release.</span></span> <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/asg017/sqlite-vec/releases/download/v0.1.1/sqlite-vec-0.1.1-loadable-linux-x86_64.tar.gz</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> sqlite-vec.tar.gz</span></span> <span class="line"></span> <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Tell rqlite to load sqlite-vec at launch time.</span></span> <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">rqlited</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -extensions-path=sqlite-vec.tar.gz</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> data</span></span></code></pre></div><p>Once loaded you can use <code>sqlite-vec</code> functionality within rqlite. For example, you can perform searches via the <a href="https://rqlite.io/docs/cli/" target="_blank" rel="noreferrer">rqlite shell</a>:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>$ rqlite</span></span> <span class="line"><span>Welcome to the rqlite CLI.</span></span> <span class="line"><span>Enter &quot;.help&quot; for usage hints.</span></span> <span class="line"><span>Connected to http://127.0.0.1:4001 running version 8</span></span> <span class="line"><span>127.0.0.1:4001&gt; create virtual table vec_examples using vec0(sample_embedding float[8]);</span></span> <span class="line"><span>1 row affected</span></span> <span class="line"><span>127.0.0.1:4001&gt; insert into vec_examples(rowid, sample_embedding) values (1, &#39;[-0.200, 0.250, 0.341, -0.211, 0.645, 0.935, -0.316, -0.924]&#39;), (2, &#39;[0.443, -0.501, 0.355, -0.771, 0.707, -0.708, -0.185, 0.362]&#39;), (3, &#39;[0.716, -0.927, 0.134, 0.052, -0.669, 0.793, -0.634, -0.162]&#39;), (4, &#39;[-0.710, 0.330, 0.656, 0.041, -0.990, 0.726, 0.385, -0.958]&#39;)</span></span> <span class="line"><span>4 rows affected</span></span> <span class="line"><span>127.0.0.1:4001&gt; select rowid, distance from vec_examples where sample_embedding match &#39;[0.890, 0.544, 0.825, 0.961, 0.358, 0.0196, 0.521, 0.175]&#39; order by distance limit 2</span></span> <span class="line"><span>+-------+-------------------+</span></span> <span class="line"><span>| rowid | distance |</span></span> <span class="line"><span>+-------+-------------------+</span></span> <span class="line"><span>| 2 | 2.386873722076416 |</span></span> <span class="line"><span>+-------+-------------------+</span></span> <span class="line"><span>| 1 | 2.389785051345825 |</span></span> <span class="line"><span>+-------+-------------------+</span></span></code></pre></div><p>You can learn more from the <a href="https://rqlite.io/docs/guides/extensions/" target="_blank" rel="noreferrer">rqlite website</a>.</p></div></div></main><footer class="VPDocFooter" data-v-e6f2a212 data-v-5941af80><!--[--><!--]--><div class="edit-info" data-v-5941af80><div class="edit-link" data-v-5941af80><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/asg017/sqlite-vec/edit/main/site/using/rqlite.md" target="_blank" rel="noreferrer" data-v-5941af80><!--[--><span class="vpi-square-pen edit-link-icon" data-v-5941af80></span> Edit this page<!--]--></a></div><div class="last-updated" data-v-5941af80><p class="VPLastUpdated" data-v-5941af80 data-v-19a7ae4e>Last updated: <time datetime="2024-11-26T19:29:15.000Z" data-v-19a7ae4e></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-5941af80><span class="visually-hidden" id="doc-footer-aria-label" data-v-5941af80>Pager</span><div class="pager" data-v-5941af80><a class="VPLink link pager-link prev" href="/sqlite-vec/sqlite-utils.html" data-v-5941af80><!--[--><span class="desc" data-v-5941af80>Previous page</span><span class="title" data-v-5941af80>sqlite-utils</span><!--]--></a></div><div class="pager" data-v-5941af80><a class="VPLink link pager-link next" href="/sqlite-vec/android-ios.html" data-v-5941af80><!--[--><span class="desc" data-v-5941af80>Next page</span><span class="title" data-v-5941af80>Android+iOS</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-d8b57b2d data-v-566314d4><div class="container" data-v-566314d4><p class="message" data-v-566314d4>MIT/Apache-2 License</p><p class="copyright" data-v-566314d4>Copyright © 2024 <a href="https://alexgarcia.xyz/">Alex Garcia</a></p></div></footer><!--[--><!--]--></div></div> <script>window.__VP_HASH_MAP__=JSON.parse("{\"guides_classifiers.md\":\"CqSREbk-\",\"features_knn.md\":\"BFfeYkCK\",\"ruby.md\":\"Dncvz6bb\",\"guides_arithmetic.md\":\"vAo3iQ9o\",\"guides_binary-quant.md\":\"ClviDYWo\",\"datasette.md\":\"Ot-kEnIM\",\"rqlite.md\":\"DA1Jby5X\",\"index.md\":\"BPczX5no\",\"versioning.md\":\"Bc6cwuTl\",\"sqlite-utils.md\":\"BGhqY_Sk\",\"android-ios.md\":\"CTuM5D-W\",\"features_vec0.md\":\"kNxJcy_p\",\"introduction.md\":\"DlRfDyPj\",\"compiling.md\":\"CqDbgdeb\",\"wasm.md\":\"DwwNUgl2\",\"js.md\":\"BznrQsKW\",\"c.md\":\"DNh7ej4f\",\"python.md\":\"DloH2NcC\",\"guides_scalar-quant.md\":\"C69bHgLr\",\"guides_matryoshka.md\":\"BlM5ewiI\",\"guides_semantic-search.md\":\"RWprlEyw\",\"installation.md\":\"CJSVVyqp\",\"guides_hybrid-search.md\":\"CRC7kJ1X\",\"guides_rag.md\":\"Bawr2NsM\",\"api-reference.md\":\"CJS8J4Um\",\"rust.md\":\"jMswWKHH\",\"go.md\":\"C52SeydV\",\"guides_performance.md\":\"CMsrf7HE\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"sqlite-vec\",\"description\":\"A vector search SQLite extension that runs anywhere!\",\"base\":\"/sqlite-vec/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":{\"light\":\"/logo.dark.svg\",\"dark\":\"/logo.light.svg\",\"alt\":\"sqlite-vec logo\"},\"nav\":[{\"text\":\"API Reference\",\"link\":\"/api-reference\"},{\"text\":\"♥ Sponsor\",\"link\":\"https://github.com/sponsors/asg017\"},{\"text\":\"v0.1.6\",\"items\":[{\"text\":\"Github Release\",\"link\":\"https://github.com/asg017/sqlite-vec/releases/0.1.6\"},{\"text\":\"Bindings\",\"items\":[{\"text\":\"Python: PyPi package\",\"link\":\"https://pypi.org/project/sqlite-vec\"},{\"text\":\"Node.js: NPM package\",\"link\":\"https://www.npmjs.com/package/sqlite-vec\"},{\"text\":\"Ruby: Ruby gem\",\"link\":\"https://rubygems.org/gems/sqlite-vec\"},{\"text\":\"Rust: Cargo crate\",\"link\":\"https://crates.io/crates/sqlite-vec\"},{\"text\":\"Golang: Go module (CGO)\",\"link\":\"https://pkg.go.dev/github.com/asg017/sqlite-vec-go-bindings/cgo\"},{\"text\":\"Golang: Go module (WASM ncruces)\",\"link\":\"https://pkg.go.dev/github.com/asg017/sqlite-vec-go-bindings/ncruces\"},{\"text\":\"Datasette: Plugin\",\"link\":\"https://datasette.io/plugins/datasette-sqlite-vec\"},{\"text\":\"sqlite-utils: Plugin\",\"link\":\"https://datasette.io/plugins/datasette-sqlite-vec\"}]}]}],\"sidebar\":[{\"text\":\"Getting Started\",\"collapsed\":true,\"items\":[{\"text\":\"Introduction\",\"link\":\"/introduction\"},{\"text\":\"Installation\",\"link\":\"/installation\"}]},{\"text\":\"Using with...\",\"collapsed\":true,\"items\":[{\"text\":\"Python\",\"link\":\"/python\"},{\"text\":\"JavaScript\",\"link\":\"/js\"},{\"text\":\"Ruby\",\"link\":\"/ruby\"},{\"text\":\"Rust\",\"link\":\"/rust\"},{\"text\":\"Go\",\"link\":\"/go\"},{\"text\":\"C/C++\",\"link\":\"/c\"},{\"text\":\"Browser (WASM)\",\"link\":\"/wasm\"},{\"text\":\"Datasette\",\"link\":\"/datasette\"},{\"text\":\"sqlite-utils\",\"link\":\"/sqlite-utils\"},{\"text\":\"rqlite\",\"link\":\"/rqlite\"},{\"text\":\"Android+iOS\",\"link\":\"/android-ios\"}]},{\"text\":\"Features\",\"collapsed\":true,\"items\":[{\"text\":\"Vector formats\",\"link\":\"/features/vector-formats\"},{\"text\":\"KNN queries\",\"link\":\"/features/knn\"},{\"text\":\"vec0 Virtual Tables\",\"link\":\"/features/vec0\"}]},{\"text\":\"Guides\",\"collapsed\":true,\"items\":[{\"text\":\"Performance\",\"link\":\"/guides/performance\"},{\"text\":\"Vector operations\",\"items\":[{\"text\":\"Vector Arithmetic\",\"link\":\"/guides/arithmetic\"},{\"text\":\"Binary Quantization\",\"link\":\"/guides/binary-quant\"},{\"text\":\"Scalar Quantization\",\"link\":\"/guides/scalar-quant\"},{\"text\":\"Matryoshka Embeddings\",\"link\":\"/guides/matryoshka\"}]}]},{\"text\":\"Documentation\",\"items\":[{\"text\":\"Compiling\",\"link\":\"/compiling\"},{\"text\":\"API Reference\",\"link\":\"/api-reference\"}]},{\"text\":\"See also\",\"items\":[{\"text\":\"sqlite-ecosystem\",\"link\":\"https://github.com/asg017/sqlite-ecosystem\"},{\"text\":\"sqlite-lembed\",\"link\":\"https://github.com/asg017/sqlite-lembed\"},{\"text\":\"sqlite-rembed\",\"link\":\"https://github.com/asg017/sqlite-rembed\"}]}],\"footer\":{\"message\":\"MIT/Apache-2 License\",\"copyright\":\"Copyright © 2024 <a href=\\\"https://alexgarcia.xyz/\\\">Alex Garcia</a>\"},\"outline\":\"deep\",\"search\":{\"provider\":\"local\"},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/asg017/sqlite-vec\"},{\"icon\":\"discord\",\"link\":\"https://discord.gg/Ve7WeCJFXk\"}],\"editLink\":{\"pattern\":\"https://github.com/asg017/sqlite-vec/edit/main/site/:path\"}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10