Memory manager with LLM-powered consolidation and entity extraction.
Extends basic memory management with advanced features:
- Automatic memory consolidation using LLM summarization
- Entity extraction from conversation text (TODO: Phase 2)
- Importance scoring based on content analysis (TODO: Phase 2)
This implementation follows the same patterns as SimpleMemoryManager but adds LLM-powered intelligence for memory operations.
Value parameters
- client
-
LLM client for consolidation and extraction
- config
-
Configuration for memory management
- store
-
Underlying memory store
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait MemoryManagerclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Summarize and consolidate old memories.
Summarize and consolidate old memories.
This operation can reduce memory usage by combining related memories into summaries.
Value parameters
- minCount
-
Minimum memories to trigger consolidation
- olderThan
-
Only consolidate memories older than this
Attributes
- Returns
-
Updated manager or error
- Definition Classes
Extract and store entity mentions from text.
Extract and store entity mentions from text.
Uses NLP or LLM to identify entities in the text and create entity memories.
Value parameters
- conversationId
-
Optional conversation context
- text
-
Text to analyze
Attributes
- Returns
-
Updated manager with extracted entities
- Definition Classes
Inherited methods
Format a sequence of memories into a structured context string grouped by memory type.
Format a sequence of memories into a structured context string grouped by memory type.
Sections are emitted in a fixed priority order (Knowledge, Entity, UserFact, Conversation, Task, then any Custom types) and truncated to fit within maxChars.
Value parameters
- maxChars
-
approximate character budget for the output
- memories
-
the memories to format
Attributes
- Returns
-
formatted context string, or empty string if no memories
- Inherited from:
- BaseMemoryManagerOps (hidden)
Get recent conversation context.
Get recent conversation context.
Value parameters
- conversationId
-
The conversation to retrieve
- maxMessages
-
Maximum messages to include
Attributes
- Returns
-
Formatted conversation history
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Get all known facts about an entity.
Get all known facts about an entity.
Value parameters
- entityId
-
The entity to query
Attributes
- Returns
-
Formatted entity knowledge
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Retrieve relevant context for a query.
Retrieve relevant context for a query.
This is the main method for memory-augmented generation. Returns memories most relevant to the given query, formatted as context for the LLM.
Value parameters
- filter
-
Additional filter criteria
- maxTokens
-
Approximate maximum tokens of context
- query
-
The user's query
Attributes
- Returns
-
Formatted context string
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Get facts known about the user.
Get facts known about the user.
Value parameters
- userId
-
Optional user identifier
Attributes
- Returns
-
Formatted user knowledge
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Record a complete conversation.
Record a complete conversation.
Value parameters
- conversationId
-
Identifier for this conversation
- messages
-
The conversation messages
Attributes
- Returns
-
Updated manager or error
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Store a fact about an entity.
Store a fact about an entity.
Value parameters
- entityId
-
The entity this fact is about
- entityName
-
Human-readable entity name
- entityType
-
Type of entity (person, organization, concept, etc.)
- fact
-
The fact to store
- importance
-
Optional importance score
Attributes
- Returns
-
Updated manager or error
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Store knowledge from an external source.
Store knowledge from an external source.
Value parameters
- content
-
The knowledge content
- metadata
-
Additional metadata
- source
-
Source identifier (file path, URL, etc.)
Attributes
- Returns
-
Updated manager or error
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Record a conversation turn.
Record a conversation turn.
Value parameters
- conversationId
-
Identifier for this conversation
- importance
-
Optional importance score
- message
-
The message to record
Attributes
- Returns
-
Updated manager or error
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Record a completed task and its outcome.
Record a completed task and its outcome.
Value parameters
- description
-
Task description
- importance
-
Optional importance score
- outcome
-
What happened
- success
-
Whether the task succeeded
Attributes
- Returns
-
Updated manager or error
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Store a fact about the user.
Store a fact about the user.
Value parameters
- fact
-
The fact about the user
- importance
-
Optional importance score
- userId
-
Optional user identifier
Attributes
- Returns
-
Updated manager or error
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)
Get memory statistics.
Get memory statistics.
Attributes
- Definition Classes
-
BaseMemoryManagerOps -> MemoryManager
- Inherited from:
- BaseMemoryManagerOps (hidden)