Elffuss BraidHub

kikocis/lancedb public

b5f7336ae52e 路 3.6 KiBRenderedRawPermalink
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[![Blog](https://img.shields.io/badge/Blog-12100E?style=for-the-badge&logoColor=white)](https://blog.lancedb.com/)
11[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/zMM32dvNtd)
12[![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white)](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
23LanceDB is an open-source database for vector-search built with persistent storage, which greatly simplifies retrieval, filtering and management of embeddings.
24
25The 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
41LanceDB'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
47npm install @lancedb/lancedb
48```
49
50```javascript
51import * as lancedb from "@lancedb/lancedb";
52
53const db = await lancedb.connect("data/sample-lancedb");
54const 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
60const query = table.vectorSearch([0.1, 0.3]).limit(2);
61const results = await query.toArray();
62
63// You can also search for rows by specific criteria without involving a vector search.
64const rowsByCriteria = await table.query().where("price >= 10").toArray();
65```
66
67**Python**
68```shell
69pip install lancedb
70```
71
72```python
73import lancedb
74
75uri = "data/sample-lancedb"
76db = lancedb.connect(uri)
77table = 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}])
80result = 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>