agents.memory.core.classifierΒΆ
Memory classification system using LLM-based analysis.
This module provides intelligent classification of memories into types, importance scoring, and metadata extraction using language models.
ClassesΒΆ
LLM-based memory classifier for automatic memory type detection and metadata extraction. |
|
Configuration for memory classification system. |
Module ContentsΒΆ
- class agents.memory.core.classifier.MemoryClassifier(config=None)ΒΆ
LLM-based memory classifier for automatic memory type detection and metadata extraction.
This classifier analyzes memory content to: - Determine memory types (semantic, episodic, procedural, etc.) - Calculate importance scores - Extract entities, topics, and sentiment - Provide classification reasoning
Initialize memory classifier with configuration.
- Parameters:
config (MemoryClassifierConfig)
- batch_classify(contents, contexts=None)ΒΆ
Classify multiple memories in batch for efficiency.
- classify_memory(content, user_context=None, conversation_context=None)ΒΆ
Classify a single memory content into types and extract metadata.
- Parameters:
- Returns:
MemoryClassificationResult with types, importance, and metadata
- Return type:
haive.agents.memory.core.types.MemoryClassificationResult
- classify_query_intent(query)ΒΆ
Analyze user query to determine memory retrieval intent.
- Parameters:
query (str) β User query to analyze
- Returns:
MemoryQueryIntent with retrieval strategy and parameters
- Return type:
haive.agents.memory.core.types.MemoryQueryIntent
- create_memory_entry(content, user_context=None, conversation_context=None, namespace=None)ΒΆ
Create a complete memory entry with automatic classification.
- Parameters:
- Returns:
MemoryEntry with full classification and metadata
- Return type:
haive.agents.memory.core.types.MemoryEntry
- class agents.memory.core.classifier.MemoryClassifierConfig(/, **data)ΒΆ
Bases:
pydantic.BaseModel
Configuration for memory classification system.
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)