import { type IAgentRuntime, type Memory, type Metadata, Service, type UUID } from "../../types";
import type { KnowledgeConfig, StoredKnowledgeItem } from "./types";
import type { AddKnowledgeOptions } from "./types.ts";
export declare class KnowledgeService extends Service {
    static readonly serviceType = "knowledge";
    config: Metadata;
    capabilityDescription: string;
    private knowledgeProcessingSemaphore;
    constructor(runtime?: IAgentRuntime, _config?: Partial<KnowledgeConfig>);
    private loadInitialDocuments;
    static start(runtime: IAgentRuntime): Promise<KnowledgeService>;
    static stop(runtime: IAgentRuntime): Promise<void>;
    stop(): Promise<void>;
    addKnowledge(options: AddKnowledgeOptions): Promise<{
        clientDocumentId: string;
        storedDocumentMemoryId: UUID;
        fragmentCount: number;
    }>;
    private processDocument;
    checkExistingKnowledge(knowledgeId: UUID): Promise<boolean>;
    getKnowledge(message: Memory, scope?: {
        roomId?: UUID;
        worldId?: UUID;
        entityId?: UUID;
    }): Promise<StoredKnowledgeItem[]>;
    enrichConversationMemoryWithRAG(memoryId: UUID, ragMetadata: {
        retrievedFragments: Array<{
            fragmentId: UUID;
            documentTitle: string;
            similarityScore?: number;
            contentPreview: string;
        }>;
        queryText: string;
        totalFragments: number;
        retrievalTimestamp: number;
    }): Promise<void>;
    private pendingRAGEnrichment;
    setPendingRAGMetadata(ragMetadata: {
        retrievedFragments: Array<{
            fragmentId: UUID;
            documentTitle: string;
            similarityScore?: number;
            contentPreview: string;
        }>;
        queryText: string;
        totalFragments: number;
        retrievalTimestamp: number;
    }): void;
    enrichRecentMemoriesWithPendingRAG(): Promise<void>;
    processCharacterKnowledge(items: string[]): Promise<void>;
    _internalAddKnowledge(item: StoredKnowledgeItem, options?: {
        targetTokens: number;
        overlap: number;
        modelContextSize: number;
    }, scope?: {
        roomId: string;
        entityId: string;
        worldId: string;
    }): Promise<void>;
    private processDocumentFragment;
    private splitAndCreateFragments;
    getMemories(params: {
        tableName: string;
        roomId?: UUID;
        count?: number;
        offset?: number;
        end?: number;
    }): Promise<Memory[]>;
    countMemories(params: {
        tableName: string;
        roomId?: UUID;
        unique?: boolean;
    }): Promise<number>;
    deleteMemory(memoryId: UUID): Promise<void>;
}
//# sourceMappingURL=service.d.ts.map