agents.rag.memory_aware.agent

Memory-Aware RAG Agents.

from typing import Any Memory-aware RAG with persistent context and iterative learning. Uses structured output models for memory management.

Classes

MemoryAwareRAGAgent

Complete Memory-Aware RAG agent with persistent learning.

MemoryImportance

Importance levels for memory items.

MemoryItem

Individual memory item with metadata.

MemoryRetrievalAgent

Agent that retrieves relevant memories for context enhancement.

MemoryType

Types of memory in the system.

Functions

create_memory_aware_rag_agent(documents[, llm_config, ...])

Create a Memory-Aware RAG agent.

get_memory_aware_rag_io_schema()

Get I/O schema for Memory-Aware RAG agents.

Module Contents

class agents.rag.memory_aware.agent.MemoryAwareRAGAgent(config)

Bases: haive.agents.multi.base.SequentialAgent

Complete Memory-Aware RAG agent with persistent learning.

Init .

Parameters:

config (SequentialAgentConfig) – [TODO: Add description]

classmethod from_documents(documents, llm_config=None, max_memories=100, **kwargs)

Create Memory-Aware RAG agent from documents.

Parameters:
  • documents (list[langchain_core.documents.Document])

  • llm_config (haive.core.models.llm.base.LLMConfig | None)

  • max_memories (int)

class agents.rag.memory_aware.agent.MemoryImportance

Bases: str, enum.Enum

Importance levels for memory items.

Initialize self. See help(type(self)) for accurate signature.

class agents.rag.memory_aware.agent.MemoryItem(/, **data)

Bases: pydantic.BaseModel

Individual memory item with metadata.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.rag.memory_aware.agent.MemoryRetrievalAgent(llm_config=None, max_memories=10, **kwargs)

Bases: haive.agents.base.agent.Agent

Agent that retrieves relevant memories for context enhancement.

Initialize memory retrieval agent.

Parameters:
  • llm_config (haive.core.models.llm.base.LLMConfig | None)

  • max_memories (int)

build_graph()

Build memory retrieval graph.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

class agents.rag.memory_aware.agent.MemoryType

Bases: str, enum.Enum

Types of memory in the system.

Initialize self. See help(type(self)) for accurate signature.

agents.rag.memory_aware.agent.create_memory_aware_rag_agent(documents, llm_config=None, memory_mode='adaptive', **kwargs)

Create a Memory-Aware RAG agent.

Parameters:
  • documents (list[langchain_core.documents.Document])

  • llm_config (haive.core.models.llm.base.LLMConfig | None)

  • memory_mode (str)

Return type:

MemoryAwareRAGAgent

agents.rag.memory_aware.agent.get_memory_aware_rag_io_schema()

Get I/O schema for Memory-Aware RAG agents.

Return type:

dict[str, list[str]]