LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangChain
  • Browser
  • Universal
  • Hub
  • Node
  • Load
  • Serializable
  • Encoder Backed
  • File System
  • In Memory
  • Tools
LangChain Core
  • Agents
  • Caches
  • Base
  • Dispatch
  • Web
  • Manager
  • Promises
  • Chat History
  • Context
  • Base
  • Langsmith
  • Documents
  • Embeddings
  • Errors
  • Example Selectors
  • Indexing
  • Base
  • Chat Models
  • Compat
  • Event
  • Llms
  • Openai Completions Stream
  • Profile
  • Stream
  • Structured Output
  • Load
  • Serializable
  • Memory
  • Messages
  • Tool
  • Output Parsers
  • Openai Functions
  • Openai Tools
  • Outputs
  • Prompt Values
  • Prompts
  • Retrievers
  • Document Compressors
  • Runnables
  • Graph
  • Singletons
  • Stores
  • Structured Query
  • Testing
  • Tools
  • Base
  • Console
  • Log Stream
  • Run Collector
  • Tracer Langchain
  • Stream
  • Async Caller
  • Chunk Array
  • Context
  • Env
  • Event Source Parse
  • Format
  • Function Calling
  • Gateway
  • Hash
  • Json Patch
  • Json Schema
  • Math
  • Ssrf
  • Standard Schema
  • Stream
  • Testing
  • Tiktoken
  • Types
  • Uuid
  • Vectorstores
Text Splitters
MCP Adapters
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
BrowserUniversalHubNodeLoadSerializableEncoder BackedFile SystemIn MemoryTools
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsCompatEventLlmsOpenai Completions StreamProfileStreamStructured OutputLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryTestingToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingGatewayHashJson PatchJson SchemaMathSsrfStandard SchemaStreamTestingTiktokenTypesUuidVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/corevectorstoresVectorStoreInterface
Interface●Since v0.3

VectorStoreInterface

Copy
interface VectorStoreInterface

Bases

Serializable

Properties

Methods

Inherited fromSerializable

Properties

Plc_kwargs: SerializedFieldsPlc_namespace: string[]
—

A path to the module that contains the class, eg. ["langchain", "llms"]

Plc_serializable: booleanPlc_aliases
View source on GitHub
: __type | undefined
Plc_attributes: SerializedFields | undefined
Plc_id: string[]
Plc_secrets: __type | undefined
Plc_serializable_keys: string[] | undefined

Methods

MtoJSON→ SerializedMtoJSONNotImplemented→ SerializedNotImplementedMlc_name→ string
—

The name of the serializable. Override to provide an alias or

property
embeddings: EmbeddingsInterface
property
FilterType: string | object
property
lc_kwargs: SerializedFields
property
lc_namespace: string[]
property
lc_serializable: boolean
property
lc_aliases: __type | undefined
property
lc_attributes: SerializedFields | undefined
property
lc_id: string[]
property
lc_secrets: __type | undefined
property
lc_serializable_keys: string[] | undefined
method
_vectorstoreType→ string
method
addDocuments→ Promise<void | string[]>
method
addVectors→ Promise<void | string[]>
method
asRetriever→ VectorStoreRetriever<VectorStoreInterface>
method
delete→ Promise<void>
method
maxMarginalRelevanceSearch→ Promise<DocumentInterface<Record<string, any>>[]>
method
similaritySearch→ Promise<DocumentInterface<Record<string, any>>[]>
method
similaritySearchVectorWithScore→ Promise<[DocumentInterface<Record<string, any>>, number][]>
method
similaritySearchWithScore→ Promise<[DocumentInterface<Record<string, any>>, number][]>
method
toJSON→ Serialized
method
toJSONNotImplemented→ SerializedNotImplemented

Interface defining the structure and operations of a vector store, which facilitates the storage, retrieval, and similarity search of document vectors.

VectorStoreInterface provides methods for adding, deleting, and searching documents based on vector embeddings, including support for similarity search with optional filtering and relevance-based retrieval.

Instance of EmbeddingsInterface used to generate vector embeddings for documents, enabling vector-based search operations.

Defines the filter type used in search and delete operations. Can be an object for structured conditions or a string for simpler filtering.

A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.

Returns a string identifying the type of vector store implementation, useful for distinguishing between different vector storage backends.

Adds an array of documents to the vector store.

Adds precomputed vectors and their corresponding documents to the vector store.

Converts the vector store into a retriever, making it suitable for use in retrieval-based workflows and allowing additional configuration.

Deletes documents from the vector store based on the specified parameters.

Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.

Searches for documents similar to a text query, embedding the query and retrieving documents based on vector similarity.

Searches for documents similar to a given vector query and returns them with similarity scores.

Searches for documents similar to a text query and includes similarity scores in the result.