Native Vector Search for SQLite

No extensions needed.

Jokull Solberg

Jökull Sólberg, CTO

TripToJapan

"Forget vector databases. It's just a column type.

It's great being able to index and query Vector distances alongside other data in the same table as opposed to dealing with sync and drift between databases."

Jokull Solberg

Dhananjoy Biswas (DJ), Founder

Retune

"Being able to put Vectors in SQL comes with a ton of extra benefits.

Powerful filtering, joining tables, doing Vector Search over multiple columns - makes Turso way more versatile over using just a Vector DB!"

Intuitive SQL
For AI applications

  • Embeddings are just a column.
  • Zero setup, no extensions - it just works.
  • When you insert a new row the index is updated automatically. You can query the table and embeddings using SQL.
  • You can efficiently do approximate nearest neighbor search with SQL functions.
  • You can also do exact neighbor search without needing an index.


import { createClient } from '@libsql/client';

const db = createClient({
  url: 'file:local.db',
});

await db.batch([
  "CREATE TABLE movies (title, year, emb F32_BLOB(3))",
  "CREATE INDEX movies_idx ON movies (
     libsql_vector_idx(emb, 'metric=cosine')
   )",
  "INSERT INTO movies
   VALUES ('Napoleon', 2023, vector('[1,2,3]'))"
]);

await db.execute(
  "SELECT title, year
   FROM vector_top_k('movies_idx', vector('[4,5,6]'), 3)
   JOIN movies
   ON movies.rowid = id;"
);
  • It’s just a file, and vectors are now just another column type.
  • Works on all platforms: mobile, desktop, web, embedded systems, servers, etc.
  • RAG now available using only SQLite.
  • Efficient resource usage with low memory footprint.
  • No need for separate vector databases.
  • Combine relational and vector data for richer more powerful queries.
Talk to us
  • It works everywhere, via a local file or over http
  • Extremely cost efficient
  • Natively serverless
  • Built for low latency
  • Read from local embedded replicas
  • Effortless multi region edge replication
Talk to us

Are you ready?

Get Started

Sign up and start building your next SQLite app in production with Turso.

Get Started

Let's talk

Talk to us

Schedule a demo and discuss your project's requirements.

Schedule a call
scarf