diff --git a/src/memory/index.ts b/src/memory/index.ts index 600a7edcc8..26d91ab664 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -48,12 +48,14 @@ let MEMORY_FILE_PATH: string; // We are storing our memory using entities, relations, and observations in a graph structure export interface Entity { + type?: string; name: string; entityType: string; observations: string[]; } export interface Relation { + type?: string; from: string; to: string; relationType: string; @@ -237,16 +239,18 @@ let knowledgeGraphManager: KnowledgeGraphManager; // Zod schemas for entities and relations const EntitySchema = z.object({ + type: z.string().optional().describe("Internal type discriminator (entity)"), name: z.string().describe("The name of the entity"), entityType: z.string().describe("The type of the entity"), observations: z.array(z.string()).describe("An array of observation contents associated with the entity") -}); +}).passthrough(); const RelationSchema = z.object({ + type: z.string().optional().describe("Internal type discriminator (relation)"), from: z.string().describe("The name of the entity where the relation starts"), to: z.string().describe("The name of the entity where the relation ends"), relationType: z.string().describe("The type of the relation") -}); +}).passthrough(); // The server instance and tools exposed to Claude const server = new McpServer({