
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@themaximalist/embedding.js
Advanced tools
Easy embeddings for LLMs like gpt-3.5-turbo and gpt-4 using OpenAI's text-embedding-ada-002
A simple in-memory embedding database that works with OpenAI's text-embedding-ada-002 text embeddings, built on top of hnswlib-node. Useful for finding relevant documents to include in gpt-3.5-turbo and gpt-4 context windows.
text-embedding-ada-002 model for text embeddings.npm install --save @themaximalist/embedding.js
To use this module, you will need an API key from OpenAI. Set the OPENAI_API_KEY environment variable with your API key:
export OPENAI_API_KEY=<your-openai-api-key>
const embedding = require("@themaximalist/embedding.js");
(async function () {
const embeddings = new embedding.EmbeddingDatabase();
await embeddings.add({
name: "Cat",
attributes: "It's a cat",
sound: "meow",
});
await embeddings.add({
name: "Dog",
attributes: "It's a dog",
sound: "woof",
});
await embeddings.add({
name: "Cow",
attributes: "It's a cow",
sound: "moo",
});
let result;
result = await embeddings.search("moo");
console.log(result[0]); // cow
result = await embeddings.search("woof");
console.log(result[0]); // dog
result = await embeddings.search("bark");
console.log(result[0]); // dog
result = await embeddings.search("roar");
console.log(result[0]); // cat
})();
https://twitter.com/themaximal1st
MIT
FAQs
Easy embeddings for LLMs like gpt-3.5-turbo and gpt-4 using OpenAI's text-embedding-ada-002
We found that @themaximalist/embedding.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.