Memory-lancedb: configurable capture limit (#16624) (thanks @ciberponk)

This commit is contained in:
Vignesh Natarajan
2026-02-14 15:54:01 -08:00
committed by Vignesh
parent 3e00460cdc
commit 8cb0373bc1
4 changed files with 28 additions and 8 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ import { Type } from "@sinclair/typebox";
import { randomUUID } from "node:crypto";
import OpenAI from "openai";
import {
DEFAULT_CAPTURE_MAX_CHARS,
MEMORY_CATEGORIES,
type MemoryCategory,
memoryConfigSchema,
@@ -195,7 +196,7 @@ const MEMORY_TRIGGERS = [
];
export function shouldCapture(text: string, options?: { maxChars?: number }): boolean {
const maxChars = options?.maxChars ?? 1500;
const maxChars = options?.maxChars ?? DEFAULT_CAPTURE_MAX_CHARS;
if (text.length < 10 || text.length > maxChars) {
return false;
}