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

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangChain
UniversalHubNodeLoadSerializableEncoder BackedFile SystemIn Memory
LangChain Core
AgentsCachesBaseDispatchWebManagerPromisesChat HistoryContextBaseLangsmithDocumentsEmbeddingsErrorsExample SelectorsIndexingBaseChat ModelsLlmsProfileLoadSerializableMemoryMessagesToolOutput ParsersOpenai FunctionsOpenai ToolsOutputsPrompt ValuesPromptsRetrieversDocument CompressorsRunnablesGraphSingletonsStoresStructured QueryToolsBaseConsoleLog StreamRun CollectorTracer LangchainStreamAsync CallerChunk ArrayContextEnvEvent Source ParseFormatFunction CallingHashJson PatchJson SchemaMathSsrfStreamTestingTiktokenTypesVectorstores
Text Splitters
MCP Adapters
Language
Theme
JavaScript@langchain/coreretrieversBaseRetrieverInterface
Interface●Since v1.0

BaseRetrieverInterface

Interface for a base retriever that defines core functionality for retrieving relevant documents from a source based on a query.

The BaseRetrieverInterface standardizes the getRelevantDocuments method, enabling retrieval of documents that match the query criteria.

Copy
interface BaseRetrieverInterface

Bases

RunnableInterface<string, DocumentInterface<Metadata>[]>

Properties

property
lc_serializable: boolean
property
lc_id: string[]

Methods

method
batch→ Promise<RunOutput[]>

Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can batch more efficiently.

method
getName→ string
method
invoke→ Promise<RunOutput>

Method to invoke the document transformation. This method calls the transformDocuments method with the provided input.

method
stream→ Promise<IterableReadableStream<RunOutput>>

Stream output in chunks.

method
transform→ AsyncGenerator<RunOutput>

Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated.

Inherited fromRunnableInterface

Properties

Plc_serializable: booleanPlc_id: string[]

Methods

Mbatch→ Promise<RunOutput[]>
—

Default implementation of batch, which calls invoke N times.

MgetName→ stringMinvoke→ Promise<RunOutput>
—

Method to invoke the document transformation. This method calls the

Mstream→ Promise<IterableReadableStream<RunOutput>>
—

Stream output in chunks.

Mtransform→ AsyncGenerator<RunOutput>
—

Default implementation of transform, which buffers input and then calls stream.

Inherited fromSerializableInterface

Properties

Plc_id: string[]
View source on GitHub