-
Notifications
You must be signed in to change notification settings - Fork 356
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
feat: add tidb vector store #656
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.
@Mini256 looking great! Thanks for your contribution. Please have a look at my comments and if you have time it would be great if you could add an example to the /examples
folder
this.tableName = config?.tableName ?? TIDB_VECTOR_TABLE; | ||
this.namespace = config?.namespace ?? ""; | ||
this.dimensions = config?.dimensions ?? 1536; | ||
this.poolOptions = config?.poolOptions ?? {}; |
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.
you can use Object.assign
to copy the config to this (then you don't need to duplicate your default values)
? [refDocId, this.namespace] | ||
: [refDocId]; | ||
await db.query(sql, params); | ||
return Promise.resolve(); |
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.
no-op
/** | ||
* Provides support for writing and querying vector data in TiDB. | ||
*/ | ||
export class TiDBVectorStore implements VectorStore { |
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.
did you check if the data generated is compatible with the python version (see https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/vector_stores/llama-index-vector-stores-tidbvector/llama_index/vector_stores/tidbvector/base.py) ?
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.
OK, I will make some adjustments to be consistent with the Python version.
* @param options Required by VectorStore interface. Currently ignored. | ||
* @returns Zero or more Document instances with data from the vector store. | ||
*/ | ||
async query( |
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.
We're using metadataDictToNode and nodeToMetadata from "./utils.js" to de/serialize the node in the metadata. You can reference the other vector store implementations to have a look into this.
Co-authored-by: Marcus Schiesser <[email protected]>
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.
any update on this?
Closing as stale |
No description provided.