@conciergus/chat - v0.3.1
    Preparing search index...

    Interface ConciergusKnowledgeHookReturn

    interface ConciergusKnowledgeHookReturn {
        config: ConciergusKnowledgeConfig;
        updateConfig: (updates: Partial<ConciergusKnowledgeConfig>) => void;
        knowledgeBases: KnowledgeBase[];
        createKnowledgeBase: (
            name: string,
            description: string,
            settings?: Partial<
                {
                    embeddingModel: string;
                    chunkSize: number;
                    chunkOverlap: number;
                    similarityThreshold: number;
                    maxResults: number;
                    enableReranking: boolean;
                },
            >,
        ) => Promise<string>;
        deleteKnowledgeBase: (id: string) => Promise<void>;
        updateKnowledgeBase: (
            id: string,
            updates: Partial<KnowledgeBase>,
        ) => Promise<void>;
        addDocument: (
            knowledgeBaseId: string,
            document: Omit<
                KnowledgeDocument,
                "id"
                | "chunks"
                | "embeddings"
                | "isIndexed",
            >,
        ) => Promise<string>;
        removeDocument: (
            knowledgeBaseId: string,
            documentId: string,
        ) => Promise<void>;
        updateDocument: (
            knowledgeBaseId: string,
            documentId: string,
            updates: Partial<KnowledgeDocument>,
        ) => Promise<void>;
        getDocument: (
            knowledgeBaseId: string,
            documentId: string,
        ) => KnowledgeDocument;
        processDocument: (document: KnowledgeDocument) => Promise<DocumentChunk[]>;
        chunkDocument: (
            content: string,
            options?: { chunkSize?: number; overlap?: number },
        ) => string[];
        indexDocument: (
            knowledgeBaseId: string,
            documentId: string,
        ) => Promise<void>;
        indexKnowledgeBase: (id: string) => Promise<void>;
        reindexAll: () => Promise<void>;
        search: (
            query: string,
            knowledgeBaseId?: string,
        ) => Promise<SearchResult[]>;
        fullTextSearch: (
            query: string,
            knowledgeBaseId?: string,
        ) => Promise<KnowledgeDocument[]>;
        metadataSearch: (
            filters: Record<string, any>,
            knowledgeBaseId?: string,
        ) => Promise<KnowledgeDocument[]>;
        importDocuments: (
            knowledgeBaseId: string,
            documents: string[] | File[],
        ) => Promise<string[]>;
        exportKnowledgeBase: (
            id: string,
            format: "json" | "csv" | "markdown",
        ) => Promise<string | Blob>;
        getKnowledgeAnalytics: (
            knowledgeBaseId?: string,
        ) => {
            totalDocuments: number;
            totalChunks: number;
            averageChunkSize: number;
            indexingProgress: number;
            lastUpdated: Date;
            popularDocuments: { id: string; title: string; accessCount: number }[];
        };
        isIndexing: boolean;
        indexingProgress: number;
        lastOperation: {
            type: string;
            status: "error"
            | "pending"
            | "success";
            message: string;
            timestamp: Date;
        };
    }
    Index

    Properties

    updateConfig: (updates: Partial<ConciergusKnowledgeConfig>) => void
    knowledgeBases: KnowledgeBase[]
    createKnowledgeBase: (
        name: string,
        description: string,
        settings?: Partial<
            {
                embeddingModel: string;
                chunkSize: number;
                chunkOverlap: number;
                similarityThreshold: number;
                maxResults: number;
                enableReranking: boolean;
            },
        >,
    ) => Promise<string>
    deleteKnowledgeBase: (id: string) => Promise<void>
    updateKnowledgeBase: (
        id: string,
        updates: Partial<KnowledgeBase>,
    ) => Promise<void>
    addDocument: (
        knowledgeBaseId: string,
        document: Omit<
            KnowledgeDocument,
            "id"
            | "chunks"
            | "embeddings"
            | "isIndexed",
        >,
    ) => Promise<string>
    removeDocument: (knowledgeBaseId: string, documentId: string) => Promise<void>
    updateDocument: (
        knowledgeBaseId: string,
        documentId: string,
        updates: Partial<KnowledgeDocument>,
    ) => Promise<void>
    getDocument: (knowledgeBaseId: string, documentId: string) => KnowledgeDocument
    processDocument: (document: KnowledgeDocument) => Promise<DocumentChunk[]>
    chunkDocument: (
        content: string,
        options?: { chunkSize?: number; overlap?: number },
    ) => string[]
    indexDocument: (knowledgeBaseId: string, documentId: string) => Promise<void>
    indexKnowledgeBase: (id: string) => Promise<void>
    reindexAll: () => Promise<void>
    search: (query: string, knowledgeBaseId?: string) => Promise<SearchResult[]>
    fullTextSearch: (
        query: string,
        knowledgeBaseId?: string,
    ) => Promise<KnowledgeDocument[]>
    metadataSearch: (
        filters: Record<string, any>,
        knowledgeBaseId?: string,
    ) => Promise<KnowledgeDocument[]>
    importDocuments: (
        knowledgeBaseId: string,
        documents: string[] | File[],
    ) => Promise<string[]>
    exportKnowledgeBase: (
        id: string,
        format: "json" | "csv" | "markdown",
    ) => Promise<string | Blob>
    getKnowledgeAnalytics: (
        knowledgeBaseId?: string,
    ) => {
        totalDocuments: number;
        totalChunks: number;
        averageChunkSize: number;
        indexingProgress: number;
        lastUpdated: Date;
        popularDocuments: { id: string; title: string; accessCount: number }[];
    }
    isIndexing: boolean
    indexingProgress: number
    lastOperation: {
        type: string;
        status: "error" | "pending" | "success";
        message: string;
        timestamp: Date;
    }