/**
 * Anchor Search Service
 * 검색 관련 로직 담당
 * Phase 1.1: anchor-manager.ts 리팩토링
 */
import type Database from 'better-sqlite3';
import type { HybridSearchEngine } from '../../../search/algorithms/hybrid-search-engine.js';
import type { VectorSearchEngine } from '../../../search/algorithms/vector-search-engine.js';
import type { IAnchorCacheService, IAnchorSearchService, IAnchorManager, SearchOptions, SearchResult, AnchorSlot } from './anchor-interfaces.js';
import { RelationGraph } from '../../../relation/services/relation-graph.js';
import { ErrorLoggingService } from '../../../../domains/monitoring/services/error-logging-service.js';
/**
 * Anchor Search Service 구현
 */
export declare class AnchorSearchService implements IAnchorSearchService {
    private db;
    private cacheService;
    private hybridSearchEngine;
    private vectorSearchEngine;
    private queryEmbeddingService;
    private relationGraph;
    private errorLoggingService;
    private nHopSearchService;
    private queryFilterService;
    private fallbackSearchService;
    private localSearchService;
    /**
     * 생성자 (옵션으로 db·검색 엔진 주입 시 일괄 설정, 미전달 시 setDatabase/setHybridSearchEngine/setVectorSearchEngine 호출 필요)
     */
    constructor(cacheService: IAnchorCacheService, options?: {
        db?: Database.Database;
        hybridSearchEngine?: HybridSearchEngine;
        vectorSearchEngine?: VectorSearchEngine;
    });
    /**
     * ErrorLoggingService 설정 (Phase 8.3)
     * 에러 로깅 서비스를 주입하여 구조화된 에러 로깅 활성화
     */
    setErrorLoggingService(errorLoggingService: ErrorLoggingService): void;
    /**
     * RelationGraph 설정 (선택적)
     */
    setRelationGraph(relationGraph: RelationGraph): void;
    /**
     * 데이터베이스 설정
     */
    setDatabase(db: Database.Database): void;
    /**
     * 하이브리드 검색 엔진 설정
     */
    setHybridSearchEngine(hybridSearchEngine: HybridSearchEngine): void;
    /**
     * 벡터 검색 엔진 설정
     */
    setVectorSearchEngine(vectorSearchEngine: VectorSearchEngine): void;
    /**
     * 국소 검색
     * 앵커 메모리를 기준으로 N-hop 제한 검색 수행
     * Phase 3.7: LocalSearchService를 사용하도록 리팩토링
     */
    searchLocal(agentId: string, slot: AnchorSlot, query: string | undefined, hopLimit: number | undefined, options: SearchOptions | undefined, anchorMemoryId: string, anchorEmbedding: {
        embedding: number[];
        provider: string;
    }, startTime: number): Promise<SearchResult>;
    /**
     * 슬롯별 설정 조회
     */
    private getSlotConfig;
    /**
     * 코사인 유사도 계산
     * Phase 2.7.3: calculateReanchorScore에서 사용하므로 유지
     */
    private cosineSimilarity;
    /**
     * 전역 검색으로 Fallback
     * Phase 2.5: FallbackSearchService 위임
     */
    fallbackToGlobalSearch(query: string, options: SearchOptions | undefined, startTime: number | undefined): Promise<SearchResult>;
    /**
     * 자동 앵커 이동 점수 계산
     */
    calculateReanchorScore(memoryId: string, queryEmbedding?: number[], anchorEmbedding?: number[]): Promise<number>;
    /**
     * 앵커 주변 메모리 사용 패턴 분석
     */
    analyzeAnchorUsage(agentId: string, slot: AnchorSlot, anchorMemoryId: string, anchorEmbedding: {
        embedding: number[];
        provider: string;
    }, queryEmbedding?: number[]): Promise<Array<{
        memory_id: string;
        score: number;
        reason: string;
    }>>;
    /**
     * 앵커 이동 이유 생성
     */
    private generateReanchorReason;
    /**
     * 자동 앵커 이동 실행
     */
    autoReanchor(agentId: string, slot: AnchorSlot, anchorManager: IAnchorManager, queryEmbedding?: number[], threshold?: number, strategy?: 'gradual' | 'immediate'): Promise<{
        moved: boolean;
        old_anchor: string | null;
        new_anchor: string | null;
        score: number;
        reason: string;
    }>;
    /**
     * 검색 후 자동 앵커 이동 체크
     */
    checkAndAutoReanchor(agentId: string, slot: AnchorSlot, anchorManager: IAnchorManager, queryEmbedding?: number[], autoMoveEnabled?: boolean): Promise<{
        moved: boolean;
        old_anchor: string | null;
        new_anchor: string | null;
        score: number;
        reason: string;
    } | null>;
}
//# sourceMappingURL=anchor-search-service.d.ts.map