Core API
This section documents the core components of AIECS.
Core Interfaces
- class aiecs.core.interface.execution_interface.IToolProvider[source]
Bases:
ABCTool provider interface - Domain layer abstraction
- class aiecs.core.interface.execution_interface.IToolExecutor[source]
Bases:
ABCTool executor interface - Domain layer abstraction
- class aiecs.core.interface.execution_interface.ICacheProvider[source]
Bases:
ABCCache provider interface - Domain layer abstraction
- abstract generate_cache_key(operation_type, user_id, task_id, args, kwargs)[source]
Generate cache key
- class aiecs.core.interface.execution_interface.IOperationExecutor[source]
Bases:
ABCOperation executor interface - Domain layer abstraction
- class aiecs.core.interface.execution_interface.ExecutionInterface[source]
Bases:
ABCUnified execution interface that defines standard methods for service and tool execution. Supports plugin-based execution engines, allowing future introduction of new executors without modifying upper-level code.
- abstract async execute_operation(operation_spec, params)[source]
Execute a single operation (e.g., tool operation or service subtask).
- abstract async execute_task(task_name, input_data, context)[source]
Execute a single task (e.g., service task).
- abstract async batch_execute_operations(operations)[source]
Batch execute multiple operations.
- Parameters:
operations (List[Dict[str, Any]]) – List of operations, each containing ‘operation’ and ‘params’
- Returns:
List of operation results
- Return type:
List[Any]
Storage interfaces for the middleware architecture.
This module defines the core storage abstractions following the same pattern as other core interfaces, enabling dependency inversion and clean architecture.
- class aiecs.core.interface.storage_interface.ISessionStorage[source]
Bases:
ABCSession storage interface - Domain layer abstraction
- class aiecs.core.interface.storage_interface.IConversationStorage[source]
Bases:
ABCConversation storage interface - Domain layer abstraction
- class aiecs.core.interface.storage_interface.ICheckpointStorage[source]
Bases:
ABCCheckpoint storage interface - Domain layer abstraction
- abstract async store_checkpoint(thread_id, checkpoint_id, checkpoint_data, metadata=None)[source]
Store checkpoint data.
- class aiecs.core.interface.storage_interface.ITaskContextStorage[source]
Bases:
ABCTask context storage interface - Domain layer abstraction
- class aiecs.core.interface.storage_interface.IStorageBackend[source]
Bases:
ISessionStorage,IConversationStorage,ICheckpointStorage,ITaskContextStorageUnified storage backend interface - Domain layer abstraction
This interface combines all storage capabilities and follows the same pattern as other core interfaces in the middleware architecture.
- class aiecs.core.interface.storage_interface.IPermanentStorageBackend[source]
Bases:
ABCPermanent storage backend interface for disk-based cold archive.
Used for dual-write alongside Redis (hot cache). Append-only semantics, optimized for analytics and long-term retention. Typical implementation: ClickHouse, PostgreSQL, etc.
All methods are fire-and-forget: failures should not block the primary Redis write path. Implementations should handle errors internally.
- abstract async append_session_event(session_id, user_id, event_type, payload, created_at=None)[source]
Append session create/update/end event for audit/analytics.
- abstract async append_conversation_message(session_id, role, content, metadata=None, created_at=None)[source]
Append conversation message (append-only).
- abstract async append_checkpoint(thread_id, checkpoint_id, checkpoint_data, metadata=None, created_at=None)[source]
Append checkpoint data.
- abstract async append_checkpoint_writes(thread_id, checkpoint_id, task_id, writes_data, created_at=None)[source]
Append checkpoint writes.
- abstract async append_conversation_session(session_key, session_data, created_at=None)[source]
Append conversation session metadata.
- class aiecs.core.interface.storage_interface.ICheckpointerBackend[source]
Bases:
ABCCheckpointer backend interface for LangGraph integration.
This interface defines the minimal contract needed by BaseServiceCheckpointer to work with any storage backend, following dependency inversion principle.
- abstract async put_checkpoint(thread_id, checkpoint_id, checkpoint_data, metadata=None)[source]
Store a checkpoint for LangGraph workflows.
- abstract async get_checkpoint(thread_id, checkpoint_id=None)[source]
Retrieve a checkpoint for LangGraph workflows.
- abstract async list_checkpoints(thread_id, limit=10)[source]
List checkpoints for LangGraph workflows.