MemoryManager
High-level memory management for agents.
MemoryManager provides semantic operations on top of the raw MemoryStore, including entity extraction, memory consolidation, and intelligent retrieval strategies.
This is the primary interface for agent memory integration.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class SimpleMemoryManager
Members list
Value members
Abstract 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
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
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
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
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
Get facts known about the user.
Get facts known about the user.
Value parameters
- userId
-
Optional user identifier
Attributes
- Returns
-
Formatted user knowledge
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
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
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
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
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
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
Get memory statistics.
Get memory statistics.
Attributes
The underlying memory store.
The underlying memory store.