From 454467ec5084825970464a8fa17d6edb34b920b1 Mon Sep 17 00:00:00 2001 From: Hande <159312713+hande-k@users.noreply.github.com> Date: Fri, 30 Jan 2026 14:58:31 +0100 Subject: [PATCH] add fixes --- src/agents/memory-search.ts | 3 ++- src/config/types.tools.ts | 4 ++-- src/memory/cognee-client.ts | 6 +++--- src/memory/cognee-provider.ts | 12 ++++++------ src/memory/search-manager.ts | 1 + 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/agents/memory-search.ts b/src/agents/memory-search.ts index 5659c8571..8cd1fdb73 100644 --- a/src/agents/memory-search.ts +++ b/src/agents/memory-search.ts @@ -9,6 +9,7 @@ import { resolveAgentConfig } from "./agent-scope.js"; export type ResolvedMemorySearchConfig = { enabled: boolean; sources: Array<"memory" | "sessions">; + extraPaths: string[]; provider: "openai" | "local" | "gemini" | "auto" | "cognee"; remote?: { baseUrl?: string; @@ -35,7 +36,7 @@ export type ResolvedMemorySearchConfig = { baseUrl?: string; apiKey?: string; datasetName?: string; - searchType?: "GRAPH_COMPLETION" | "chunks" | "summaries"; + searchType?: "GRAPH_COMPLETION" | "CHUNKS" | "SUMMARIES"; maxResults?: number; timeoutSeconds?: number; autoCognify?: boolean; diff --git a/src/config/types.tools.ts b/src/config/types.tools.ts index 8ee3552b5..fcf93d976 100644 --- a/src/config/types.tools.ts +++ b/src/config/types.tools.ts @@ -271,8 +271,8 @@ export type MemorySearchConfig = { apiKey?: string; /** Dataset name for organizing memories (default: "clawdbot"). */ datasetName?: string; - /** Search type: "GRAPH_COMPLETION", "chunks", or "summaries" (default: "GRAPH_COMPLETION"). */ - searchType?: "GRAPH_COMPLETION" | "chunks" | "summaries"; + /** Search type: "GRAPH_COMPLETION", "CHUNKS", or "SUMMARIES" (default: "GRAPH_COMPLETION"). */ + searchType?: "GRAPH_COMPLETION" | "CHUNKS" | "SUMMARIES"; /** Max results per search query (default: 6). */ maxResults?: number; /** Timeout for API requests in seconds (default: 30). */ diff --git a/src/memory/cognee-client.ts b/src/memory/cognee-client.ts index 6ed294e26..0b351ca2e 100644 --- a/src/memory/cognee-client.ts +++ b/src/memory/cognee-client.ts @@ -52,7 +52,7 @@ export type CogneeCognifyResponse = { export type CogneeSearchRequest = { queryText: string; - searchType?: "GRAPH_COMPLETION" | "chunks" | "summaries"; + searchType?: "GRAPH_COMPLETION" | "CHUNKS" | "SUMMARIES"; datasetIds?: string[]; }; @@ -367,9 +367,9 @@ export class CogneeClient { private mapSearchType(type?: CogneeSearchRequest["searchType"]): CogneeSearchApiType { switch (type) { - case "chunks": + case "CHUNKS": return "CHUNKS"; - case "summaries": + case "SUMMARIES": return "SUMMARIES"; case "GRAPH_COMPLETION": default: diff --git a/src/memory/cognee-provider.ts b/src/memory/cognee-provider.ts index 2ec6015ab..56b70adb6 100644 --- a/src/memory/cognee-provider.ts +++ b/src/memory/cognee-provider.ts @@ -1,7 +1,7 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; -import type { MoltbotConfig } from "../config/config.js"; +import type { OpenClawConfig } from "../config/config.js"; import { resolveAgentWorkspaceDir } from "../agents/agent-scope.js"; import { resolveStateDir } from "../config/paths.js"; import { resolveSessionTranscriptsDirForAgent } from "../config/sessions/paths.js"; @@ -37,7 +37,7 @@ export type CogneeProviderConfig = { baseUrl?: string; apiKey?: string; datasetName?: string; - searchType?: "GRAPH_COMPLETION" | "chunks" | "summaries"; + searchType?: "GRAPH_COMPLETION" | "CHUNKS" | "SUMMARIES"; maxResults?: number; timeoutSeconds?: number; autoCognify?: boolean; @@ -48,11 +48,11 @@ export type CogneeMemorySource = "memory" | "sessions"; export class CogneeMemoryProvider { private readonly client: CogneeClient; - private readonly cfg: MoltbotConfig; + private readonly cfg: OpenClawConfig; private readonly agentId: string; private readonly workspaceDir: string; private readonly datasetName: string; - private readonly searchType: "GRAPH_COMPLETION" | "chunks" | "summaries"; + private readonly searchType: "GRAPH_COMPLETION" | "CHUNKS" | "SUMMARIES"; private readonly maxResults: number; private readonly autoCognify: boolean; private readonly cognifyBatchSize: number; @@ -65,7 +65,7 @@ export class CogneeMemoryProvider { private syncIndexDirty = false; constructor( - cfg: MoltbotConfig, + cfg: OpenClawConfig, agentId: string, sources: Array, config: CogneeProviderConfig = {}, @@ -535,7 +535,7 @@ export class CogneeMemoryProvider { } export async function createCogneeProvider( - cfg: MoltbotConfig, + cfg: OpenClawConfig, agentId: string, sources: Array, config: CogneeProviderConfig = {}, diff --git a/src/memory/search-manager.ts b/src/memory/search-manager.ts index c442d11e9..77801292e 100644 --- a/src/memory/search-manager.ts +++ b/src/memory/search-manager.ts @@ -1,6 +1,7 @@ import type { OpenClawConfig } from "../config/config.js"; import type { MemoryIndexManager } from "./manager.js"; import type { CogneeMemoryProvider } from "./cognee-provider.js"; +import { resolveMemorySearchConfig } from "../agents/memory-search.js"; export type MemorySearchManagerResult = { manager: MemoryIndexManager | CogneeMemoryProvider | null;