zilliz-mcp-server
Version:
Universal memory layer MCP server for Zilliz Cloud - enables continuous conversations across all LLMs and agents
57 lines • 1.81 kB
JavaScript
import { z } from 'zod';
// Memory Types
export var MemoryType;
(function (MemoryType) {
MemoryType["SHORT_TERM"] = "short_term";
MemoryType["LONG_TERM"] = "long_term";
MemoryType["PROCEDURAL"] = "procedural";
MemoryType["EPISODIC"] = "episodic";
MemoryType["SEMANTIC"] = "semantic";
MemoryType["SHARED"] = "shared"; // Memory shared between agents/LLMs
})(MemoryType || (MemoryType = {}));
// Validation Schemas
export const ConversationSchema = z.object({
id: z.string(),
userId: z.string(),
sessionId: z.string(),
participants: z.array(z.string()),
messages: z.array(z.object({
id: z.string(),
role: z.enum(['user', 'assistant', 'agent', 'system']),
content: z.string(),
timestamp: z.date(),
importance: z.number().min(0).max(1)
})),
context: z.object({
userId: z.string(),
tags: z.array(z.string()),
summary: z.string()
})
});
export const MemorySearchSchema = z.object({
query: z.string().min(1),
type: z.nativeEnum(MemoryType).optional(),
limit: z.number().int().positive().max(100).default(10),
minSimilarity: z.number().min(0).max(1).default(0.7),
includeShared: z.boolean().default(true)
});
export const ContextStoreSchema = z.object({
content: z.string().min(1),
type: z.nativeEnum(MemoryType),
importance: z.number().min(0).max(1).default(0.5),
tags: z.array(z.string()).default([]),
source: z.string().min(1),
expiresAt: z.date().optional()
});
// Error Types
export class MemoryError extends Error {
code;
details;
constructor(code, message, details) {
super(message);
this.code = code;
this.details = details;
this.name = 'MemoryError';
}
}
//# sourceMappingURL=memory-layer.js.map