-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LanceDB vectorstore #1597
Add LanceDB vectorstore #1597
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution and sorry for the delay! Just minor nitpicks here and there, but lgtm otherwise :)
"ts-jest": "^29.1.0", | ||
"typeorm": "^0.3.12", | ||
"typescript": "^5.0.0", | ||
"vectordb": "^0.1.4", | ||
"typesense": "^1.5.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem like Yarn reorders the dependencies and creates a new lockfile, would it be possible to run yarn
once again?
@@ -57,6 +57,7 @@ const entrypoints = { | |||
"vectorstores/hnswlib": "vectorstores/hnswlib", | |||
"vectorstores/faiss": "vectorstores/faiss", | |||
"vectorstores/weaviate": "vectorstores/weaviate", | |||
"vectorstores/lancedb": "vectorstores/lancedb", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem like node langchain/scripts/create-entrypoints.js
has not been executed yet. Would it be possible to run these commands?
const data: Array<Record<string, unknown>> = []; | ||
for (let i = 0; i < documents.length; i += 1) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const record: Record<string, any> = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: preferably use Record<string, unknown>
instead.
const docsAndScore: [Document, number][] = []; | ||
results.forEach((item) => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const metadata: Record<string, any> = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: preferably, use unknown
instead of any
whenever possible.
test("constructor works", async () => { | ||
const lancedb = new LanceDB(new FakeEmbeddings(), { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
table: new Table(null as any, "vectors"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: afaict first argument of Table is already any
?
|
||
test("should add vectors to the table", async () => { | ||
const embeddings = new FakeEmbeddings(); | ||
const dir = await track().mkdir("lancedb"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to import track
as an another dev-dependency? Could we just remove the temp directory after the test completes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did not pass our CI, build seemed to fail on old Macs and Windows. It's all good to have it as an integration test IMO.
Thanks @gsilvestrin and @dqbd - I've made a few fixes and taken the comments into account. Will aim to have the extended PR #1787 merged as part of tomorrow's release! |
Merged in #1787 |
Adds support to LanceDB, an embedded vector database.
It should behave as the Python Integration
I believe the Vercel failure is unrelated to my change, is caused by langchainplus: