haive.core.tools.store_manager¶
Store management system for Haive agents.
This module provides a comprehensive store management system similar to LangMem, with tools for storing, retrieving, and managing agent memories using our PostgreSQL store infrastructure.
Classes¶
A single memory entry in the store. |
|
Centralized store management for agent memories. |
Module Contents¶
- class haive.core.tools.store_manager.MemoryEntry(/, **data)[source]¶
Bases:
pydantic.BaseModel
A single memory entry in the store.
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)
- class haive.core.tools.store_manager.StoreManager(store=None, default_namespace=None, store_config=None)[source]¶
Centralized store management for agent memories.
This class provides a high-level interface for managing agent memories using the Haive store infrastructure, similar to LangMem but customized for our architecture.
Features: - Namespace-based memory isolation (user_id, agent_id, session_id) - Semantic search capabilities - Memory categorization and tagging - Importance-based retrieval - Automatic metadata management
Initialize the store manager.
- Parameters:
- create_session_namespace(session_id, agent_id=None, user_id=None)[source]¶
Create a session-specific namespace.
- retrieve_memory(memory_id, namespace=None)[source]¶
Retrieve a specific memory by ID.
- Parameters:
- Returns:
MemoryEntry if found, None otherwise
- Return type:
MemoryEntry | None
- search_memories(query, category=None, min_importance=None, tags=None, limit=10, namespace=None)[source]¶
Search memories using semantic search.
- Parameters:
- Returns:
List of matching memories
- Return type:
- store_memory(content, category='general', importance=0.5, tags=None, metadata=None, namespace=None, memory_id=None)[source]¶
Store a new memory.
- Parameters:
- Returns:
Memory ID
- Return type:
- update_memory(memory_id, content=None, category=None, importance=None, tags=None, metadata=None, namespace=None)[source]¶
Update an existing memory.