agents.memory_v2.multi_memory_agentΒΆ

MultiMemoryAgent - Coordinates different memory strategies.

This agent acts as a meta-coordinator that routes queries to different specialized memory agents based on query type, context, and memory strategy optimization.

ClassesΒΆ

MemoryPriority

Priority levels for memory processing.

MemoryRoutingRule

Rule for routing queries to specific memory strategies.

MemoryStrategy

Types of memory strategies available.

MultiMemoryAgent

Agent that coordinates multiple memory strategies.

MultiMemoryConfig

Configuration for MultiMemoryAgent.

MultiMemoryState

Extended state for MultiMemoryAgent with routing information.

QueryClassifier

Classifies queries to determine appropriate memory strategy.

QueryType

Types of queries that determine memory routing.

ResponseSynthesizer

Synthesizes responses from multiple memory agents.

FunctionsΒΆ

create_multi_memory_agent([name, enable_graph, enable_rag])

Factory function to create a MultiMemoryAgent with sensible defaults.

Module ContentsΒΆ

class agents.memory_v2.multi_memory_agent.MemoryPriorityΒΆ

Bases: str, enum.Enum

Priority levels for memory processing.

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

class agents.memory_v2.multi_memory_agent.MemoryRoutingRuleΒΆ

Rule for routing queries to specific memory strategies.

class agents.memory_v2.multi_memory_agent.MemoryStrategyΒΆ

Bases: str, enum.Enum

Types of memory strategies available.

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

class agents.memory_v2.multi_memory_agent.MultiMemoryAgent(config)ΒΆ

Bases: haive.agents.simple.agent.SimpleAgent

Agent that coordinates multiple memory strategies.

This agent acts as a smart router and coordinator for different memory approaches, automatically selecting the best strategy based on query analysis and combining responses when appropriate.

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:

config (MultiMemoryConfig)

async classify_query(query)ΒΆ

Classify the query to determine appropriate memory strategy.

Parameters:

query (str)

Return type:

dict[str, Any]

async execute_strategy(strategy, query, context=None)ΒΆ

Execute the selected memory strategy.

Parameters:
Return type:

dict[str, Any]

get_comprehensive_status()ΒΆ

Get comprehensive status of the MultiMemoryAgent.

Return type:

dict[str, Any]

get_coordination_stats()ΒΆ

Get statistics about query coordination and routing.

Return type:

dict[str, Any]

async query_memory_agent(agent_key, query, context=None)ΒΆ

Query a specific memory agent.

Parameters:
Return type:

dict[str, Any]

route_query(query_type, confidence, context=None)ΒΆ

Route query to appropriate memory strategy based on classification.

Parameters:
Return type:

dict[str, Any]

async synthesize_responses(responses, query)ΒΆ

Synthesize multiple memory responses into a coherent answer.

Parameters:
Return type:

dict[str, Any]

class agents.memory_v2.multi_memory_agent.MultiMemoryConfig(/, **data)ΒΆ

Bases: pydantic.BaseModel

Configuration for MultiMemoryAgent.

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)

model_configΒΆ

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class agents.memory_v2.multi_memory_agent.MultiMemoryStateΒΆ

Bases: agents.memory_v2.memory_state_with_tokens.MemoryStateWithTokens

Extended state for MultiMemoryAgent with routing information.

class agents.memory_v2.multi_memory_agent.QueryClassifier(llm_config)ΒΆ

Classifies queries to determine appropriate memory strategy.

Parameters:

llm_config (haive.core.engine.aug_llm.AugLLMConfig)

async classify(query)ΒΆ

Classify a query to determine its type and characteristics.

Parameters:

query (str)

Return type:

dict[str, Any]

class agents.memory_v2.multi_memory_agent.QueryTypeΒΆ

Bases: str, enum.Enum

Types of queries that determine memory routing.

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

class agents.memory_v2.multi_memory_agent.ResponseSynthesizer(llm_config)ΒΆ

Synthesizes responses from multiple memory agents.

Parameters:

llm_config (haive.core.engine.aug_llm.AugLLMConfig)

async synthesize(responses, original_query)ΒΆ

Synthesize multiple memory responses into a coherent answer.

Parameters:
Return type:

dict[str, Any]

agents.memory_v2.multi_memory_agent.create_multi_memory_agent(name='multi_memory_coordinator', enable_graph=HAS_GRAPH_MEMORY, enable_rag=HAS_RAG_MEMORY, **kwargs)ΒΆ

Factory function to create a MultiMemoryAgent with sensible defaults.

Parameters:
Return type:

MultiMemoryAgent