Skip to main content

Module core

Module core 

Source
Expand description

Core tool execution handlers.

Contains handlers for subcog’s core memory operations: capture, recall, status, namespaces, prompt understanding, consolidate, enrich, reindex.

StructsΒ§

ComponentHealth πŸ”’
Health status for a backend component.

ConstantsΒ§

MAX_CONTENT_LENGTH πŸ”’
Maximum allowed input length for content fields (SEC-M5).
MAX_QUERY_LENGTH πŸ”’
Maximum allowed input length for query fields (SEC-M5).
NAMESPACE_DEFS πŸ”’
Namespace definitions with descriptions for XML output.

FunctionsΒ§

build_delete_result_output πŸ”’
Builds the deletion result output message.
build_dry_run_output πŸ”’
Builds the dry-run output message.
build_llm_provider_from_config πŸ”’
Builds an LLM provider from configuration.
build_xml_domains πŸ”’
Builds the domains XML section (single-line).
build_xml_namespaces πŸ”’
Builds the namespaces XML section with counts from the service (single-line).
build_xml_status πŸ”’
Builds the status XML element (single-line).
build_xml_tools πŸ”’
Builds the tools XML section with essential parameters (single-line).
check_capture_health πŸ”’
Checks health of the capture service.
check_index_health πŸ”’
Checks health of the index layer.
check_persistence_health πŸ”’
Checks health of the persistence layer by attempting a simple operation.
check_vector_health πŸ”’
Checks health of the vector layer (embedding search).
delete_memory_hard πŸ”’
Performs hard (permanent) deletion of a memory.
delete_memory_soft πŸ”’
Performs soft deletion (tombstone) of a memory.
escape_xml πŸ”’
Escapes special XML characters for safe embedding in XML output.
execute_bulk_delete πŸ”’
Executes bulk deletion and returns (deleted_count, failed_count).
execute_capture
Executes the capture tool.
execute_consolidate
Executes the consolidate tool. Triggers memory consolidation and returns statistics.
execute_delete
Executes the delete tool - soft or hard deletes a memory.
execute_delete_all
Executes the delete_all tool - bulk deletes memories matching filter criteria.
execute_enrich
Executes the enrich tool. Returns a sampling request for the LLM to enrich a memory.
execute_gdpr_export
Executes the GDPR data export tool.
execute_get
Executes the get tool - retrieves a memory by ID.
execute_get_summary
Executes the get summary tool. Retrieves a summary memory and its linked source memories.
execute_history
Executes the history tool - retrieves change history for a memory.
execute_init
Executes the init tool for session initialization.
execute_list
Executes the list tool - lists memories with optional filtering and pagination.
execute_namespaces
Executes the namespaces tool.
execute_prompt_understanding
Executes the prompt_understanding tool.
execute_recall
Executes the recall tool.
execute_reindex
Executes the reindex tool.
execute_restore
Executes the restore tool - restores a tombstoned (soft-deleted) memory.
execute_status
Executes the status tool with comprehensive health checks (CHAOS-HIGH-006).
execute_update
Executes the update tool - modifies an existing memory’s content and/or tags.
format_init_recall_xml πŸ”’
Formats the recall section as XML for init output (single-line).
format_source_memory_entry πŸ”’
Formats a single source memory entry for display.
has_any_filter_criteria πŸ”’
Checks if the filter has any criteria set.
run_mcp_consolidation πŸ”’
Helper function to run consolidation and format results for MCP tool response.
validate_input_length πŸ”’
Validates that a string input does not exceed the maximum allowed length.