Defines data structures, search modes, options, and score normalizers for the memory system. Use when configuring similarity searches and retrieval.
# Source: https://github.com/TokenRhythm/opensquilla | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Core data types for the memory system."""
from __future__ import annotations
import math
from dataclasses import dataclass, field
from enum import StrEnum
DEFAULT_MEMORY_SEARCH_RESULTS = 6
DEFAULT_MEMORY_SEARCH_MIN_SCORE = 0.35
RELAXED_KEYWORD_MATCH_METADATA_KEY = "relaxed_keyword_match"
RELAXED_KEYWORD_MATCH_METADATA_VALUE = "true"
LEXICAL_GUARANTEE_METADATA_KEY = "lexical_guarantee"
LEXICAL_GUARANTEE_METADATA_VALUE = "true"
def normalize_memory_search_min_score(
value: object,
*,
default: float = DEFAULT_MEMORY_SEARCH_MIN_SCORE,
strict: bool = False,
) -> f
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key