| 1 | <div align="center"> |
| 2 | <p align="center"> |
| 3 | |
| 4 | <img width="275" alt="LanceDB Logo" src="https://github.com/lancedb/lancedb/assets/5846846/37d7c7ad-c2fd-4f56-9f16-fffb0d17c73a"> |
| 5 | |
| 6 | **Developer-friendly, database for multimodal AI** |
| 7 | |
| 8 | <a href='https://github.com/lancedb/vectordb-recipes/tree/main' target="_blank"><img alt='LanceDB' src='https://img.shields.io/badge/VectorDB_Recipes-100000?style=for-the-badge&logo=LanceDB&logoColor=white&labelColor=645cfb&color=645cfb'/></a> |
| 9 | <a href='https://lancedb.github.io/lancedb/' target="_blank"><img alt='lancdb' src='https://img.shields.io/badge/DOCS-100000?style=for-the-badge&logo=lancdb&logoColor=white&labelColor=645cfb&color=645cfb'/></a> |
| 10 | [](https://blog.lancedb.com/) |
| 11 | [](https://discord.gg/zMM32dvNtd) |
| 12 | [](https://twitter.com/lancedb) |
| 13 | |
| 14 | </p> |
| 15 | |
| 16 | <img max-width="750px" alt="LanceDB Multimodal Search" src="https://github.com/lancedb/lancedb/assets/917119/09c5afc5-7816-4687-bae4-f2ca194426ec"> |
| 17 | |
| 18 | </p> |
| 19 | </div> |
| 20 | |
| 21 | <hr /> |
| 22 | |
| 23 | LanceDB is an open-source database for vector-search built with persistent storage, which greatly simplifies retrieval, filtering and management of embeddings. |
| 24 | |
| 25 | The key features of LanceDB include: |
| 26 | |
| 27 | * Production-scale vector search with no servers to manage. |
| 28 | |
| 29 | * Store, query and filter vectors, metadata and multi-modal data (text, images, videos, point clouds, and more). |
| 30 | |
| 31 | * Support for vector similarity search, full-text search and SQL. |
| 32 | |
| 33 | * Native Python and Javascript/Typescript support. |
| 34 | |
| 35 | * Zero-copy, automatic versioning, manage versions of your data without needing extra infrastructure. |
| 36 | |
| 37 | * GPU support in building vector index(*). |
| 38 | |
| 39 | * Ecosystem integrations with [LangChain 馃锔忦煍梋(https://python.langchain.com/docs/integrations/vectorstores/lancedb/), [LlamaIndex 馃](https://gpt-index.readthedocs.io/en/latest/examples/vector_stores/LanceDBIndexDemo.html), Apache-Arrow, Pandas, Polars, DuckDB and more on the way. |
| 40 | |
| 41 | LanceDB's core is written in Rust 馃 and is built using <a href="https://github.com/lancedb/lance">Lance</a>, an open-source columnar format designed for performant ML workloads. |
| 42 | |
| 43 | ## Quick Start |
| 44 | |
| 45 | **Javascript** |
| 46 | ```shell |
| 47 | npm install @lancedb/lancedb |
| 48 | ``` |
| 49 | |
| 50 | ```javascript |
| 51 | import * as lancedb from "@lancedb/lancedb"; |
| 52 | |
| 53 | const db = await lancedb.connect("data/sample-lancedb"); |
| 54 | const table = await db.createTable("vectors", [ |
| 55 | { id: 1, vector: [0.1, 0.2], item: "foo", price: 10 }, |
| 56 | { id: 2, vector: [1.1, 1.2], item: "bar", price: 50 }, |
| 57 | ], {mode: 'overwrite'}); |
| 58 | |
| 59 | |
| 60 | const query = table.vectorSearch([0.1, 0.3]).limit(2); |
| 61 | const results = await query.toArray(); |
| 62 | |
| 63 | // You can also search for rows by specific criteria without involving a vector search. |
| 64 | const rowsByCriteria = await table.query().where("price >= 10").toArray(); |
| 65 | ``` |
| 66 | |
| 67 | **Python** |
| 68 | ```shell |
| 69 | pip install lancedb |
| 70 | ``` |
| 71 | |
| 72 | ```python |
| 73 | import lancedb |
| 74 | |
| 75 | uri = "data/sample-lancedb" |
| 76 | db = lancedb.connect(uri) |
| 77 | table = db.create_table("my_table", |
| 78 | data=[{"vector": [3.1, 4.1], "item": "foo", "price": 10.0}, |
| 79 | {"vector": [5.9, 26.5], "item": "bar", "price": 20.0}]) |
| 80 | result = table.search([100, 100]).limit(2).to_pandas() |
| 81 | ``` |
| 82 | |
| 83 | ## Blogs, Tutorials & Videos |
| 84 | * 馃搱 <a href="https://blog.lancedb.com/benchmarking-random-access-in-lance/">2000x better performance with Lance over Parquet</a> |
| 85 | * 馃 <a href="https://github.com/lancedb/vectordb-recipes/tree/main/examples/Youtube-Search-QA-Bot">Build a question and answer bot with LanceDB</a> |