Forked from brdcastro/maestro
"use strict";
/**
* @file constants.ts
* Single source of truth for every tunable parameter.
* Grouped by subsystem for easy discovery.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.MEMORY_SEPARATOR = exports.MAX_INJECTED_CONTEXT_CHARS = exports.VALID_CATEGORIES = exports.MAX_SESSION_MEMORIES = exports.MAX_PROJECT_NAME_LENGTH = exports.VALID_SCOPES = exports.AI_CONFLICT_TEMPERATURE = exports.AI_CONFLICT_MAX_TOKENS = exports.AI_CALL_TIMEOUT_MS = exports.AI_EXTRACT_TEMPERATURE = exports.AI_EXTRACT_MAX_TOKENS = exports.L1_ESSENTIAL_COUNT = exports.L1_MAX_CHARS = exports.L0_MAX_CHARS = exports.KEYWORD_BOOST_WEIGHT = exports.CONFIDENCE_WEIGHT = exports.SIMILARITY_WEIGHT = exports.FREQUENCY_WEIGHT = exports.DECAY_WEIGHT = exports.DECAY_HALF_LIFE_DAYS = exports.MAX_TERMS_PER_DOC = exports.MAX_VOCAB_SIZE = exports.MIN_TERM_LENGTH = exports.STOP_WORDS = exports.MIN_QUERY_LENGTH = exports.MIN_RELEVANCE_THRESHOLD = exports.MAX_SEARCH_RESULTS = exports.DEFAULT_SEARCH_RESULTS = exports.MAX_CONTEXT_MEMORIES = exports.DEFAULT_CONTEXT_MEMORIES = exports.MAX_CATEGORY_LENGTH = exports.MAX_TAG_LENGTH = exports.MAX_TAGS_PER_MEMORY = exports.MAX_MEMORY_CONTENT_LENGTH = exports.MAX_MEMORIES_TOTAL = exports.DB_FILENAME = void 0;
exports.DB_FILENAME = "memory.db";
exports.MAX_MEMORIES_TOTAL = 10_000;
exports.MAX_MEMORY_CONTENT_LENGTH = 4_000;
exports.MAX_TAGS_PER_MEMORY = 10;
exports.MAX_TAG_LENGTH = 50;
exports.MAX_CATEGORY_LENGTH = 30;
/** Default number of memories injected into prompt context. */
exports.DEFAULT_CONTEXT_MEMORIES = 5;
/** Maximum memories that can be injected per prompt. */
exports.MAX_CONTEXT_MEMORIES = 15;
/** Default number returned by explicit Recall/Search tools. */
exports.DEFAULT_SEARCH_RESULTS = 8;
/** Maximum results from a single search/recall. */
exports.MAX_SEARCH_RESULTS = 25;
/** Minimum TF-IDF similarity score to surface a memory (0–1). */
exports.MIN_RELEVANCE_THRESHOLD = 0.05;
/** Minimum query length (chars) for semantic search. */
exports.MIN_QUERY_LENGTH = 2;
/** Stop words excluded from TF-IDF indexing (English + Portuguese). */
exports.STOP_WORDS = new Set([
// English
"the", "a", "an", "is", "in", "of", "and", "or", "for", "to",
"how", "what", "why", "when", "does", "with", "from", "its",
"that", "this", "are", "was", "were", "be", "been", "being",
"have", "has", "had", "do", "did", "will", "would", "could",
"should", "may", "might", "shall", "can", "it", "he", "she",
"they", "we", "you", "i", "me", "my", "your", "our", "his",
"her", "their", "not", "no", "but", "if", "so", "at", "by",
"on", "up", "out", "about", "into", "over", "after", "before",
"between", "under", "again", "then", "here", "there", "all",
"each", "every", "both", "few", "more", "most", "other", "some",
"such", "than", "too", "very", "just", "also", "now",
// Portuguese
"que", "de", "do", "da", "dos", "das", "um", "uma", "uns", "umas",
"para", "com", "como", "por", "mais", "mas", "se", "na", "no",
"nos", "nas", "ao", "aos", "esse", "essa", "esses", "essas",
"este", "esta", "estes", "estas", "isso", "isto", "aquilo",
"ele", "ela", "eles", "elas", "eu", "tu", "nós", "vós",
"meu", "minha", "meus", "minhas", "seu", "sua", "seus", "suas",
"nosso", "nossa", "nossos", "nossas", "tem", "ter", "tinha",
"foi", "ser", "está", "estar", "são", "era", "eram", "será",
"seria", "pode", "poder", "vai", "vou", "vamos", "foram",
"quando", "onde", "quem", "qual", "quais", "porque", "porquê",
"muito", "muita", "muitos", "muitas", "bem", "mal", "sim",
"não", "já", "ainda", "aqui", "ali", "lá", "entre", "sobre",
"até", "sem", "depois", "antes", "então", "nem", "ou", "pois",
"assim", "mesmo", "só", "também", "cada", "todo", "toda",
"todos", "todas", "outro", "outra", "outros", "outras",
"voce", "você", "vocês", "gente", "coisa", "coisas",
]);
/** Minimum term length for TF-IDF indexing. */
exports.MIN_TERM_LENGTH = 2;
/** Maximum vocabulary size for the TF-IDF index. */
exports.MAX_VOCAB_SIZE = 50_000;
/** How many top terms per document to keep for scoring. */
exports.MAX_TERMS_PER_DOC = 200;
/** Half-life of memory relevance decay in days. */
exports.DECAY_HALF_LIFE_DAYS = 45;
/** Weight of recency in the composite retrieval score (0–1). */
exports.DECAY_WEIGHT = 0.2;
/** Weight of access frequency in the composite retrieval score (0–1). */
exports.FREQUENCY_WEIGHT = 0.1;
/** Weight of TF-IDF similarity in the composite retrieval score (0–1). */
exports.SIMILARITY_WEIGHT = 0.55;
/** Weight of stored confidence score in the composite retrieval score (0–1). */
exports.CONFIDENCE_WEIGHT = 0.10;
/** Weight of keyword overlap boost in the composite retrieval score (0–1). */
exports.KEYWORD_BOOST_WEIGHT = 0.05;
/** Max tokens for L0 identity layer (always injected). */
exports.L0_MAX_CHARS = 400;
/** Max tokens for L1 essential memories layer (always injected). */
exports.L1_MAX_CHARS = 1600;
/** Number of top essential memories for L1 layer. */
exports.L1_ESSENTIAL_COUNT = 5;
/** Max tokens for AI fact extraction calls. */
exports.AI_EXTRACT_MAX_TOKENS = 800;
/** Temperature for AI fact extraction (low = factual). */
exports.AI_EXTRACT_TEMPERATURE = 0.1;
/** Timeout for AI calls in ms. */
exports.AI_CALL_TIMEOUT_MS = 12_000;
/** Max tokens for AI conflict detection. */
exports.AI_CONFLICT_MAX_TOKENS = 400;
/** Temperature for conflict detection. */
exports.AI_CONFLICT_TEMPERATURE = 0.1;
exports.VALID_SCOPES = ["global", "project", "session"];
/** Max project name length. */
exports.MAX_PROJECT_NAME_LENGTH = 60;
/** Max session memories (in-memory only, never persisted). */
exports.MAX_SESSION_MEMORIES = 200;
exports.VALID_CATEGORIES = [
"fact",
"preference",
"project",
"note",
"instruction",
"relationship",
"context",
"correction",
"reference",
"identity",
];
/** Max chars of injected memory context (to avoid blowing up prompts). */
exports.MAX_INJECTED_CONTEXT_CHARS = 5_000;
/** Separator between injected memories. */
exports.MEMORY_SEPARATOR = "\n• ";
//# sourceMappingURL=constants.js.map