Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/memory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -223,18 +225,20 @@ export class KnowledgeGraphManager {

let knowledgeGraphManager: KnowledgeGraphManager;

// Zod schemas for entities and relations
// Zod schemas for entities and relations - Patched for Gemini CLI compatibility
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({
Expand Down