Skip to main content

Module validation

Module validation 

Source
Expand description

Input validation for enterprise security Prevents injection attacks, ensures data integrity, protects against ReDoS

Constants§

MAX_CONTENT_LENGTH
MAX_ENTITIES_PER_MEMORY
MAX_ENTITY_LENGTH
MAX_METADATA_SIZE
MAX_PATTERN_LENGTH
MAX_USER_ID_LENGTH
Maximum lengths for security

Functions§

validate_and_compile_pattern
Validate and compile a regex pattern with ReDoS protection
validate_content
Validate content
validate_embeddings
Validate embeddings vector
validate_entities
Validate entities list
validate_entity
Validate entity name
validate_importance_threshold
Validate importance threshold
validate_max_results
Validate max_results
validate_memory_id
Validate memory_id (UUID format)
validate_memory_id_or_prefix
Validate memory_id as either a full UUID or a hex prefix (8+ chars).
validate_metadata
Validate metadata JSON size
validate_relationship_strength
Validate relationship strength
validate_reminder_timestamp
Validate a reminder timestamp is not unreasonably far in the past or future
validate_user_id
Validate user_id
validate_weight
Validate a scoring weight (0.0 to 1.0 inclusive, must be finite)