ChatHistoryMemory
ChatHistoryBlock.
Parameters:
- context_creator (BaseContextCreator): A model context creator.
- storage (BaseKeyValueStorage, optional): A storage backend for storing chat history. If
None, an :obj:InMemoryKeyValueStoragewill be used. (default: :obj:None) - window_size (int, optional): The number of recent chat messages to retrieve. If not provided, the entire chat history will be retrieved. (default: :obj:
None) - agent_id (str, optional): The ID of the agent associated with the chat history.
init
agent_id
agent_id
retrieve
write_records
get_context_creator
clear
clean_tool_calls
VectorDBMemory
VectorDBBlock. This memory queries
messages stored in the vector database. Notice that the most recent
messages will not be added to the context.
Parameters:
- context_creator (BaseContextCreator): A model context creator.
- storage (BaseVectorStorage, optional): A vector storage storage. If
None, an :obj:QdrantStoragewill be used. (default: :obj:None) - retrieve_limit (int, optional): The maximum number of messages to be added into the context. (default: :obj:
3) - agent_id (str, optional): The ID of the agent associated with the messages stored in the vector database.
init
agent_id
agent_id
retrieve
write_records
get_context_creator
clear
LongtermAgentMemory
AgentMemory abstract base class for
augmenting ChatHistoryMemory with VectorDBMemory.
Parameters:
- context_creator (BaseContextCreator): A model context creator.
- chat_history_block (Optional[ChatHistoryBlock], optional): A chat history block. If
None, a :obj:ChatHistoryBlockwill be used. (default: :obj:None) - vector_db_block (Optional[VectorDBBlock], optional): A vector database block. If
None, a :obj:VectorDBBlockwill be used. (default: :obj:None) - retrieve_limit (int, optional): The maximum number of messages to be added into the context. (default: :obj:
3) - agent_id (str, optional): The ID of the agent associated with the chat history and the messages stored in the vector database.
init
agent_id
agent_id
get_context_creator
retrieve
write_records
- records (List[MemoryRecord]): Messages to be added to the vector database.