@codai/memorai-core
Version:
Simplified advanced memory engine - no tiers, just powerful semantic search with persistence
45 lines • 2.53 kB
TypeScript
import { MemoryRelationship, MemoryRelationshipType, MemoryGraphQuery, MemoryGraphResult } from '../types/index.js';
export interface IMemoryRelationshipManager {
createRelationship(relationship: Omit<MemoryRelationship, 'id' | 'createdAt' | 'updatedAt'>): Promise<MemoryRelationship>;
getRelationships(memoryId: string, tenantId: string): Promise<MemoryRelationship[]>;
deleteRelationship(relationshipId: string, tenantId: string): Promise<boolean>;
findRelatedMemories(memoryId: string, relationshipTypes: MemoryRelationshipType[], tenantId: string): Promise<string[]>;
buildMemoryGraph(query: MemoryGraphQuery): Promise<MemoryGraphResult>;
suggestRelationships(memoryId: string, tenantId: string): Promise<MemoryRelationship[]>;
}
export declare class MemoryRelationshipManager implements IMemoryRelationshipManager {
private relationships;
constructor();
createRelationship(relationshipData: Omit<MemoryRelationship, 'id' | 'createdAt' | 'updatedAt'>): Promise<MemoryRelationship>;
getRelationships(memoryId: string, tenantId: string): Promise<MemoryRelationship[]>;
deleteRelationship(relationshipId: string, tenantId: string): Promise<boolean>;
findRelatedMemories(memoryId: string, relationshipTypes: MemoryRelationshipType[], tenantId: string): Promise<string[]>;
buildMemoryGraph(query: MemoryGraphQuery): Promise<MemoryGraphResult>;
private traverseGraph;
suggestRelationships(memoryId: string, tenantId: string): Promise<MemoryRelationship[]>;
/**
* Create hierarchical parent-child relationship
*/
createParentChildRelationship(parentId: string, childId: string, tenantId: string): Promise<[MemoryRelationship, MemoryRelationship]>;
/**
* Create sibling relationship between memories
*/
createSiblingRelationship(memoryId1: string, memoryId2: string, tenantId: string): Promise<[MemoryRelationship, MemoryRelationship]>;
/**
* Get memory hierarchy (parents, children, siblings)
*/
getMemoryHierarchy(memoryId: string, tenantId: string): Promise<{
parents: string[];
children: string[];
siblings: string[];
}>;
/**
* Find memory conflicts (memories that contradict each other)
*/
findMemoryConflicts(tenantId: string): Promise<MemoryRelationship[]>;
/**
* Clean up orphaned relationships
*/
cleanupOrphanedRelationships(validMemoryIds: string[], tenantId: string): Promise<number>;
}
//# sourceMappingURL=MemoryRelationshipManager.d.ts.map