memory_settings
Memory settings resource module
Classes
MemorySettings
Bases: BaseDataModel
Agent memory configuration settings
Attributes:
-
conversation_insights_count
(int
) –Number of conversation insights to generate when the conversation_insight_freshness interval is stale.
-
conversation_insights_freshness
(int
) –Controls the number of chat turns before new conversation insights is generated.
-
conversation_insights_msg_history
(int
) –When building conversation insights, this value controls the number of conversation message history are included in the context.
-
recall_include_insights
(bool
) –Controls whether current conversation insights are included during memory recall operations. When set to true, conversation insights are generated and stored. When true, a more general set of memories will be recalled, which may be better for creating. When false, memories that are more specific to the visible conversation content, which may be better for targeted Q&A. Use in conjunction with recall_conversation_turns to control the context used when retrieving memories during chat.
-
recall_conversation_turns
(int
) –Number of conversation turns to include in the context for memory recall operation.
-
get_top_k_vectors
(int
) –When performing a lookup in the vector database, this setting determines the maximum number of results to return. Note that this is applicable at the collection level - meaning if an agent has multiple collections bound, this settings applies to each collection.
-
get_relevance_alpha
(float
) –Weight multiplied to the calculated relevance score, used to control how important ‘relevance’ is to the overall final score of an individual memory.
-
get_importance_alpha
(float
) –Weight multiplied to the calculated importance score, used to control how important ‘importance’ is to the overall final score of an individual memory.
-
get_recency_alpha
(float
) –Weight multiplied to the calculated recency score, used to control how important ‘recency’ is to the overall final score of an individual memory.
-
get_min_score
(float
) –After memories are scored this value is used to filter out any memories that don’t meet a minimum score. Setting this to 0.0 will effectively disable the minimum score filter.
-
max_memory_strategy
(str
) –Controls how the ‘get_max_memories’ setting is applied. A value of ‘COLLECTION_LIMIT’ causes ‘get_max_memories’ to be applied per collection, for example if the agent has 3 collections bound and ‘get_max_memories’ is 10, then up to 30 memories will be returned. A value of ‘HARD_LIMIT’ is the maximum number of memories returned across all collections.
-
get_max_memories
(int
) –Controls the maximum number of memories returned on a get request. This is applied last and represents an absolute maximum.
-
relevance_statement_count
(int
) –Number of relevance statements to generate.
-
integration_enabled
(bool
) –When set to true, integration operations are enabled.
-
manual_integration
(bool
) –When set to true, the automatic agent integration job will exclude memories in this session
-
integration_operation_threshold
(int
) –When determining whether an integration operation is needed for an agent+session, this setting controls how many turns need to take place since the last integration operation. For example, if ‘integration_operation_threshold’ is 10, the turn count is 12, and the last integration was performed at turn 10, then there would be 8 more turns needed to trigger the next integration operation.
-
integration_question_count
(int
) –As part of the memory integration process, questions are generated from recent memories. This field controls the number of questions generated.
-
integration_insight_count
(int
) –During an integration operation, this is the number of new insights generated per reflective question
Attributes
conversation_insights_count
class-attribute
instance-attribute
conversation_insights_count: int = Field(
default=5,
gt=0,
title="Conversation Insight Count",
description="Number of conversation insights to generate when the conversation_insight_freshness interval is stale.",
)
conversation_insights_freshness
class-attribute
instance-attribute
conversation_insights_freshness: int = Field(
default=1,
ge=1,
title="Conversation Insight Freshness",
description="Controls the number of chat turns before new conversation insights is generated.",
)
conversation_insights_msg_history
class-attribute
instance-attribute
conversation_insights_msg_history: int = Field(
default=5,
ge=0,
title="Conversation Insight Message History",
description="When building conversation insights, this value controls the number of conversation message history are included in the context.",
)
get_importance_alpha
class-attribute
instance-attribute
get_importance_alpha: float = Field(
default=1.0,
ge=0.0,
le=1.0,
title="Importance Alpha (Get)",
description="Weight multiplied to the calculated importance score, used to control how important 'importance' is to the overall final score of an individual memory.",
)
get_max_memories
class-attribute
instance-attribute
get_max_memories: int = Field(
default=10,
gt=0,
title="Maximum Memories (Get)",
description="Controls the maximum number of memories returned on a get request. This is applied last and represents an absolute maximum.",
)
get_min_score
class-attribute
instance-attribute
get_min_score: float = Field(
default=0.0,
ge=0.0,
title="Minimum Score (Get)",
description="After memories are scored this value is used to filter out any memories that don't meet a minimum score. Setting this to 0.0 will effectively disable the minimum score filter.",
)
get_recency_alpha
class-attribute
instance-attribute
get_recency_alpha: float = Field(
default=1.0,
ge=0.0,
le=1.0,
title="Recency Alpha (Get)",
description="Weight multiplied to the calculated recency score, used to control how important 'recency' is to the overall final score of an individual memory.",
)
get_relevance_alpha
class-attribute
instance-attribute
get_relevance_alpha: float = Field(
default=1.0,
ge=0.0,
le=1.0,
title="Relevance Alpha (Get)",
description="Weight multiplied to the calculated relevance score, used to control how important 'relevance' is to the overall final score of an individual memory.",
)
get_top_k_vectors
class-attribute
instance-attribute
get_top_k_vectors: int = Field(
default=10,
gt=0,
title="Top K Vectors (Get)",
description="When performing a lookup in the vector database, this setting determines the maximum number of results to return. Note that this is applicable at the collection level - meaning if an agent has multiple collections bound, this settings applies to each collection.",
)
integration_enabled
class-attribute
instance-attribute
integration_enabled: bool = Field(
default=True,
title="Integration Enabled",
description="When set to true, integration operations are enabled.",
)
integration_insight_count
class-attribute
instance-attribute
integration_insight_count: int = Field(
default=5,
gt=0,
title="Integration Insight Count",
description="During an integration operation, this is the number of new insights generated per reflective question",
)
integration_operation_threshold
class-attribute
instance-attribute
integration_operation_threshold: int = Field(
default=10,
gt=0,
title="Integration Operation Threshold",
description="When determining whether an integration operation is needed for an agent+session, this setting controls how many turns need to take place since the last integration operation. For example, if 'integration_operation_threshold' is 10, the turn count is 12, and the last integration was performed at turn 10, then there would be 8 more turns needed to trigger the next integration operation.",
)
integration_question_count
class-attribute
instance-attribute
integration_question_count: int = Field(
default=5,
gt=0,
title="Integration Question Count",
description="As part of the memory integration process, questions are generated from recent memories. This field controls the number of questions generated.",
)
manual_integration
class-attribute
instance-attribute
manual_integration: bool = Field(
default=False,
title="Manual Integration Flag",
description="When set to true, the automatic agent integration job will exclude memories in this session",
)
max_memory_strategy
class-attribute
instance-attribute
max_memory_strategy: str = Field(
default="HARD_LIMIT",
title="Max Memory Strategy",
description="Controls how the 'get_max_memories' setting is applied. A value of 'COLLECTION_LIMIT' causes 'get_max_memories' to be applied per collection, for example if the agent has 3 collections bound and 'get_max_memories' is 10, then up to 30 memories will be returned. A value of 'HARD_LIMIT' is the maximum number of memories returned across all collections.",
)
model_config
class-attribute
instance-attribute
model_config = ConfigDict(
populate_by_name=True,
use_enum_values=True,
extra="ignore",
strict=False,
)
recall_conversation_turns
class-attribute
instance-attribute
recall_conversation_turns: int = Field(
default=5,
title="Recall Conversation Turns",
description="Number of conversation turns to include in the context for memory recall operation.",
)
recall_include_insights
class-attribute
instance-attribute
recall_include_insights: bool = Field(
default=True,
title="Recall Include Conversation Insights",
description="Controls whether current conversation insights are included during memory recall operations. When set to true, conversation insights are generated and stored. When true, a more general set of memories will be recalled, which may be better for creating. When false, memories that are more specific to the visible conversation content, which may be better for targeted Q&A. Use in conjunction with recall_conversation_turns to control the context used when retrieving memories during chat.",
)
relevance_statement_count
class-attribute
instance-attribute
relevance_statement_count: int = Field(
default=8,
gt=0,
title="Relevance Statement Count",
description="",
)
Functions
validate_max_memory_strategy
classmethod
Validates the ‘max_memory_strategy’ value. Note that this validation strategy was used over an enum or Python Literal since this model needs to be easily interpreted by the OpenAPI schema generator.
Parameters:
-
value
(str
) –The value to be validated.
Returns:
-
str
(str
) –The validated value.
Raises:
-
ValueError
–If the value is not one of the valid values.