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)