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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just change this to the const "entity" and relation to "relation"?

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Zod schemas for entities and relations - Patched for Gemini CLI compatibility
// Zod schemas for entities and relations

no need to add these kind of comments

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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced we should have this passthrough() declaration - if we already have type declared does this sort out the schema situation? I worry that passthrough could lead to silent errors & schema drift


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