langchain_experimental.tot.memory.ToTDFSMemory¶
- class langchain_experimental.tot.memory.ToTDFSMemory(stack: Optional[List[Thought]] = None)[source]¶
Memory for the Tree of Thought (ToT) chain. Implemented as a stack of thoughts. This allows for a depth first search (DFS) of the ToT.
Attributes
levelReturn the current level of the stack.
Methods
__init__([stack])Return the thoughts path.
pop([n])Pop the top n elements of the stack and return the last one.
store(node)Add a node on the top of the stack.
top()Get the top of the stack without popping it.
Get the parent of the top of the stack without popping it.