
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@tigrisdata/vector
Advanced tools
Tigris makes it easy to build AI applications with vector embeddings. It is a fully managed cloud-native database that allows you store and index documents and vector embeddings for fast and scalable vector search.
npm install @tigrisdata/vector
You can sign up for a free Tigris account here.
Once you have signed up for the Tigris account, create a new project called vectordemo
.
Next, make a note of the clientId
and clientSecret
, which you can get from the
Application Keys section of the project.
import { VectorDocumentStore } from "@tigrisdata/vector";
const vectorDocStore = new VectorDocumentStore({
connection: {
serverUrl: "api.preview.tigrisdata.cloud",
projectName: "vectordemo",
clientId: "clientId_here",
clientSecret: "clientSecret_here",
},
indexName: "my_index",
numDimensions: 3,
});
Here, we have created a new VectorDocumentStore
instance that connects to the
Tigris Vector Database. The indexName
is the name of the index that will store
your embeddings, documents, and any additional metadata. You can use any name
you like for the index. The numDimensions
is the number of dimensions of the
vector embeddings.
await vectorDocStore.addDocumentsWithVectors({
ids: ["id1", "id2"],
embeddings: [
[1.2, 2.3, 4.5],
[6.7, 8.2, 9.2],
],
documents: [
{
content: "This is a document",
metadata: {
title: "Document 1",
},
},
{
content: "This is another document",
metadata: {
title: "Document 2",
},
},
],
});
Here, we have added two documents to the index. The ids
are the unique
identifiers for the documents. The embeddings
are the vector embeddings for
the documents. The documents
are the actual documents that you want to store
in the index. The content
is the text content of the document. The metadata
is any additional metadata that you want to store for the document.
You can query the index for the top k
most similar documents to a given
vector. It's that simple!
const results = await vectorDocStore.similaritySearchVectorWithScore({
query: [1.0, 2.1, 3.2],
k: 10,
});
console.log(JSON.stringify(results, null, 2));
You can enhance the query with attribute filtering. For example, you can filter the results by a given metadata field.
const results2 = await vectorDocStore.similaritySearchVectorWithScore({
query: [1.0, 2.1, 3.2],
k: 10,
filter: {
"metadata.title": "Document 1",
},
});
console.log(JSON.stringify(results2, null, 2));
Tigris Vector Database is simple enough to get started with, but powerful enough to build real-world applications.
Tigris provides the following features:
# clean the dev env
npm run clean
# build
npm run build
# test
npm run test
# lint
npm run lint
The coding style rules are defined by Prettier and enforced by Eslint
We use pre-commit to automatically setup and run git hooks.
Install the pre-commit hooks as follows:
pre-commit install
On every git commit
we check the code quality using prettier and eslint.
This software is licensed under the Apache 2.0.
Thanks to all the people who contributed!
FAQs
Tigris Vector Database client for TypeScript
We found that @tigrisdata/vector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.