haive.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 haive.agents.rag.memory_aware.agent.MemoryAwareRAGAgent¶

Bases: haive.agents.multi.base.SequentialAgent

Complete Memory-Aware RAG agent with persistent learning.

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 haive.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 haive.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 haive.agents.rag.memory_aware.agent.MemoryRetrievalAgent¶

Bases: haive.agents.base.agent.Agent

Agent that retrieves relevant memories for context enhancement.

build_graph()¶

Build memory retrieval graph.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

class haive.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.

haive.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

haive.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]]