forked from cardosofelipe/fast-next-template
## Changes ### New Context Type - Add MEMORY to ContextType enum for agent memory context - Create MemoryContext class with subtypes (working, episodic, semantic, procedural) - Factory methods: from_working_memory, from_episodic_memory, from_semantic_memory, from_procedural_memory ### Memory Context Source - MemoryContextSource service fetches relevant memories for context assembly - Configurable fetch limits per memory type - Parallel fetching from all memory types ### Agent Lifecycle Hooks - AgentLifecycleManager handles spawn, pause, resume, terminate events - spawn: Initialize working memory with optional initial state - pause: Create checkpoint of working memory - resume: Restore from checkpoint - terminate: Consolidate working memory to episodic memory - LifecycleHooks for custom extension points ### Context Engine Integration - Add memory_query parameter to assemble_context() - Add session_id and agent_type_id for memory scoping - Memory budget allocation (15% by default) - set_memory_source() for runtime configuration ### Tests - 48 new tests for MemoryContext, MemoryContextSource, and lifecycle hooks - All 108 memory-related tests passing - mypy and ruff checks passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
20 lines
581 B
Python
20 lines
581 B
Python
# app/services/memory/integration/__init__.py
|
|
"""
|
|
Memory Integration Module.
|
|
|
|
Provides integration between the agent memory system and other Syndarix components:
|
|
- Context Engine: Memory as context source
|
|
- Agent Lifecycle: Spawn, pause, resume, terminate hooks
|
|
"""
|
|
|
|
from .context_source import MemoryContextSource, get_memory_context_source
|
|
from .lifecycle import AgentLifecycleManager, LifecycleHooks, get_lifecycle_manager
|
|
|
|
__all__ = [
|
|
"AgentLifecycleManager",
|
|
"LifecycleHooks",
|
|
"MemoryContextSource",
|
|
"get_lifecycle_manager",
|
|
"get_memory_context_source",
|
|
]
|