agents.memory_v2.react_memory_agentยถ

ReactAgent with memory tools for dynamic memory management.

This implementation follows LangChainโ€™s long-term memory patterns but uses ReactAgent with tools for flexible memory operations.

Classesยถ

ReactMemoryAgent

ReactAgent with memory management tools.

Functionsยถ

example_basic_usage()

Example of basic ReactMemoryAgent usage.

example_with_custom_tools()

Example with custom tools added.

Module Contentsยถ

class agents.memory_v2.react_memory_agent.ReactMemoryAgent(name='react_memory_agent', engine=None, user_id=None, memory_store_path=None, k=5, decay_rate=0.01, use_time_weighting=True)ยถ

ReactAgent with memory management tools.

This agent uses tools to: - Load relevant memories before responding - Store new memories from conversations - Update existing memories - Delete outdated memories - Search memories by semantic similarity - Search memories by time range

Init .

Parameters:
  • name (str) โ€“ [TODO: Add description]

  • engine (haive.core.engine.aug_llm.AugLLMConfig | None) โ€“ [TODO: Add description]

  • user_id (str | None) โ€“ [TODO: Add description]

  • memory_store_path (str | None) โ€“ [TODO: Add description]

  • k (int) โ€“ [TODO: Add description]

  • decay_rate (float) โ€“ [TODO: Add description]

  • use_time_weighting (bool) โ€“ [TODO: Add description]

async arun(query, auto_save=True, include_metadata=False)ยถ

Run the ReactAgent with memory tools.

Parameters:
  • query (str) โ€“ User query

  • auto_save (bool) โ€“ Automatically save conversation to memory

  • include_metadata (bool) โ€“ Include metadata in response

Returns:

Agent response with optional metadata

Return type:

dict[str, Any]

classmethod create_with_custom_tools(name='custom_memory_agent', engine=None, custom_tools=None, **kwargs)ยถ

Create ReactMemoryAgent with additional custom tools.

Parameters:
  • name (str) โ€“ Agent name

  • engine (haive.core.engine.aug_llm.AugLLMConfig | None) โ€“ LLM configuration

  • custom_tools (list[Any] | None) โ€“ Additional tools to include

  • **kwargs โ€“ Other ReactMemoryAgent parameters

Returns:

ReactMemoryAgent with custom tools

Return type:

ReactMemoryAgent

save_vector_store(path)ยถ

Save the vector store to disk.

Parameters:

path (str)

async agents.memory_v2.react_memory_agent.example_basic_usage()ยถ

Example of basic ReactMemoryAgent usage.

async agents.memory_v2.react_memory_agent.example_with_custom_tools()ยถ

Example with custom tools added.