openhands.memory.memory
LongTermMemory Objects
class LongTermMemory()
Handles storing information for the agent to access later, using chromadb.
__init__
def __init__(llm_config: LLMConfig, agent_config: AgentConfig,
event_stream: EventStream)
Initialize the chromadb and set up ChromaVectorStore for later use.
add_event
def add_event(event: Event)
Adds a new event to the long term memory with a unique id.
Arguments:
- event: The new event to be added to memory
search
def search(query: str, k: int = 10) -> list[str]
Searches through the current memory using VectorIndexRetriever.
Arguments:
- query (str): A query to match search results to
- k (int): Number of top results to return
Returns:
- list[str]: List of top k results found in current memory
create_nodes
def create_nodes(documents: list['Document']) -> list['TextNode']
Create nodes from a list of documents.