/** * 관계 그래프 서비스 * 기억 간의 관계를 저장하고 관리하는 서비스 * * 주요 기능: * - 관계 추가/삭제/조회 * - 순환 참조 감지 (DFS) * - N-hop 관계 탐색 (BFS) * - 신뢰도 갱신 * - 캐싱 계층 (L1: MemoryCache 10분, L2: PersistentCache 7일) * - 배치 삽입 최적화 */ import Database from 'better-sqlite3'; import type { ICacheService } from '../../../shared/interfaces/cache.interface.js'; import type { AddRelationOptions, GetRelatedMemoriesOptions, GetRelationsOptions, IRelationGraph, MemoryRelation, RelationMetadata } from '../../../shared/types/relation-graph.js'; import type { RelationType } from '../../../shared/types/relation.js'; import type { RelatedMemoryResult } from './relation-graph-traversal.js'; export type { RelatedMemoryResult }; /** * 관계 그래프 서비스 (composition 오케스트레이터) */ export declare class RelationGraph implements IRelationGraph { private cache; private cycleDetector; private query; private traversal; private mutations; constructor(db: Database.Database, l1Cache: ICacheService, l2Cache: ICacheService); addRelation(sourceId: string, targetId: string, relationType: RelationType, options?: AddRelationOptions): Promise; getRelations(memoryId: string, options?: GetRelationsOptions): Promise; getRelationsBatch(memoryIds: string[], options?: GetRelationsOptions): Promise>; getRelatedMemories(memoryId: string, options?: GetRelatedMemoriesOptions): Promise; removeRelation(sourceId: string, targetId: string, relationType: RelationType): Promise; updateConfidence(sourceId: string, targetId: string, relationType: RelationType, newConfidence: number, reason?: string): Promise; detectCycle(sourceId: string, targetId: string, relationType: RelationType, maxDepth?: number): Promise; addRelationsBatch(relations: Array<{ source_id: string; target_id: string; relation_type: RelationType; confidence?: number; metadata?: RelationMetadata; }>): Promise<{ insertedIds: number[]; failed: Array<{ source_id: string; target_id: string; relation_type: RelationType; error: string; }>; total: number; success: number; failedCount: number; }>; } //# sourceMappingURL=relation-graph.d.ts.map