add fixes
This commit is contained in:
parent
38b11caf83
commit
454467ec50
@ -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;
|
||||
|
||||
@ -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). */
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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<CogneeMemorySource>,
|
||||
config: CogneeProviderConfig = {},
|
||||
@ -535,7 +535,7 @@ export class CogneeMemoryProvider {
|
||||
}
|
||||
|
||||
export async function createCogneeProvider(
|
||||
cfg: MoltbotConfig,
|
||||
cfg: OpenClawConfig,
|
||||
agentId: string,
|
||||
sources: Array<CogneeMemorySource>,
|
||||
config: CogneeProviderConfig = {},
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user