postgres-mcp-tools
Version:
PostgreSQL-based memory system with vector search capabilities for AI applications, including MCP integration for Claude
48 lines (47 loc) • 1.75 kB
TypeScript
/**
* Add a memory to the database
*
* @param conversationId - Unique identifier for the conversation
* @param userId - Identifier for the user
* @param content - The content of the memory
* @param metadata - Additional metadata for the memory
* @returns The ID of the created memory
*/
export declare const addMemory: (conversationId: string, userId: string, content: string, metadata?: any) => Promise<number>;
/**
* Search for memories by similarity
*
* @param queryText - The text to search for
* @param limit - Maximum number of results to return
* @param userId - Optional user ID to filter by
* @param conversationId - Optional conversation ID to filter by
* @returns Array of memory objects
*/
export declare const searchMemories: (queryText: string, limit?: number, userId?: string | null, conversationId?: string | null) => Promise<any[]>;
/**
* Get all memories for a specific conversation
*
* @param conversationId - The conversation ID to get memories for
* @returns Array of memory objects
*/
export declare const getConversationMemories: (conversationId: string) => Promise<any[]>;
/**
* Delete a memory by ID
*
* @param id - The ID of the memory to delete
* @returns True if the memory was deleted
*/
export declare const deleteMemory: (id: number) => Promise<boolean>;
/**
* Archive memories older than a certain number of days
*
* @param daysToKeep - Number of days to keep memories before archiving
* @returns Number of memories archived
*/
export declare const archiveOldMemories: (daysToKeep?: number) => Promise<number>;
/**
* Optimize the vector index for better performance
*
* @returns True if optimization was successful
*/
export declare const optimizeVectorIndex: () => Promise<boolean>;