mirror of
https://github.com/Mintplex-Labs/langchainjs.git
synced 2026-07-01 12:17:38 -04:00
8035633874
* Add CI job * Add ci script * Run format in examples package * Format docs * Fix eslint config in langchain * Add ci command * Separate unit and integration tests * Fix ci command * Make path relative, adjust node version * Add os matrix * Set eol to lf * Do not cache CI command * Try to fix loadFromHub on windows * Update CONTRIBUTING for unit/int tests
554 B
554 B
Vectorstores
A vectorstore is a particular type of database optimized for storing documents, embeddings, and then allowing for fetching of the most relevant documents for a particular query.
import { HNSWLib } from "langchain/vectorstores";
import { OpenAIEmbeddings } from "langchain/embeddings";
const vectorStore = await HNSWLib.fromTexts(
["Hello world", "Bye bye", "hello nice world"],
[{ id: 2 }, { id: 1 }, { id: 3 }],
new OpenAIEmbeddings()
);
const resultOne = await vectorStore.similaritySearch("hello world", 1);