VectorStoreMemory class

Memory backed by a vector store.

Implemented types

Constructors

VectorStoreMemory({required VectorStore vectorStore, VectorStoreSearchType searchType = const VectorStoreSimilaritySearch(), String memoryKey = defaultMemoryKey, String? inputKey, Set<String> excludeInputKeys = const {}, bool returnDocs = false})
Memory backed by a vector store.

Properties

excludeInputKeys Set<String>
Input keys to exclude in addition to memory key when constructing the document.
final
hashCode int
The hash code for this object.
no setterinherited
inputKey String?
The input key to use for the query to the vector store.
final
memoryKey String
Name of the key where the memories are in the map returned by loadMemoryVariables.
final
memoryKeys Set<String>
Input keys this memory class will load dynamically to the prompt.
no setteroverride
returnDocs bool
Whether or not to return the result of querying the database directly. If false, the page content of all the documents is returned as a single string.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchType VectorStoreSearchType
The type of search to perform.
final
vectorStore VectorStore
VectorStoreRetriever object to connect to.
final

Methods

clear() Future<void>
Clear memory contents.
override
loadMemoryVariables([MemoryInputValues values = const {}]) Future<MemoryVariables>
Returns key-value pairs given the MemoryInputValues.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveContext({required MemoryInputValues inputValues, required MemoryOutputValues outputValues}) Future<void>
Save the context of this model run to memory.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

defaultMemoryKey → const String
Default key for memoryKey.