mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 14:40:22 +00:00
Memory: add configurable FTS5 tokenizer for CJK text support (openclaw#56707)
Verified: - pnpm build - pnpm check - pnpm test -- extensions/memory-core/src/memory/manager-search.test.ts packages/memory-host-sdk/src/host/query-expansion.test.ts - pnpm test -- extensions/memory-core/src/memory/index.test.ts -t "reindexes when extraPaths change" - pnpm test -- src/config/schema.base.generated.test.ts - pnpm test -- src/media-understanding/image.test.ts - pnpm test Co-authored-by: Mitsuyuki Osabe <24588751+carrotRakko@users.noreply.github.com>
This commit is contained in:
@@ -2033,6 +2033,24 @@ export const GENERATED_BASE_CONFIG_SCHEMA = {
|
||||
path: {
|
||||
type: "string",
|
||||
},
|
||||
fts: {
|
||||
type: "object",
|
||||
properties: {
|
||||
tokenizer: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "string",
|
||||
const: "unicode61",
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
const: "trigram",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
vector: {
|
||||
type: "object",
|
||||
properties: {
|
||||
@@ -3596,6 +3614,24 @@ export const GENERATED_BASE_CONFIG_SCHEMA = {
|
||||
path: {
|
||||
type: "string",
|
||||
},
|
||||
fts: {
|
||||
type: "object",
|
||||
properties: {
|
||||
tokenizer: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "string",
|
||||
const: "unicode61",
|
||||
},
|
||||
{
|
||||
type: "string",
|
||||
const: "trigram",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
vector: {
|
||||
type: "object",
|
||||
properties: {
|
||||
|
||||
@@ -379,6 +379,10 @@ export type MemorySearchConfig = {
|
||||
store?: {
|
||||
driver?: "sqlite";
|
||||
path?: string;
|
||||
fts?: {
|
||||
/** FTS5 tokenizer (default: "unicode61"). Use "trigram" for CJK text support. */
|
||||
tokenizer?: "unicode61" | "trigram";
|
||||
};
|
||||
vector?: {
|
||||
/** Enable sqlite-vec extension for vector search (default: true). */
|
||||
enabled?: boolean;
|
||||
|
||||
@@ -653,6 +653,12 @@ export const MemorySearchSchema = z
|
||||
.object({
|
||||
driver: z.literal("sqlite").optional(),
|
||||
path: z.string().optional(),
|
||||
fts: z
|
||||
.object({
|
||||
tokenizer: z.union([z.literal("unicode61"), z.literal("trigram")]).optional(),
|
||||
})
|
||||
.strict()
|
||||
.optional(),
|
||||
vector: z
|
||||
.object({
|
||||
enabled: z.boolean().optional(),
|
||||
|
||||
Reference in New Issue
Block a user