/**
 * src/rag/ingest.ts
 * استيعاب المستندات — Document ingestion for RAG pipeline
 */
export type FileType = 'pdf' | 'excel' | 'image' | 'markdown' | 'text';
export interface DocumentChunk {
    content: string;
    index: number;
    metadata: {
        source: string;
        fileType: FileType;
        chunkIndex: number;
        totalChunks: number;
    };
}
export interface IngestResult {
    documentId: string;
    chunksCreated: number;
    fileType: FileType;
    totalCharacters: number;
    /** Full extracted text — included so callers (skill extraction, summarizers)
     * don't need to re-read + re-parse the file. */
    extractedText?: string;
}
export declare function ingestDocument(tenantId: string, filePath: string, fileType: FileType): Promise<IngestResult>;
/**
 * (User-requested) Ingest a document AND extract a skill from its content if
 * the document describes a workflow / lookup / process worth saving.
 *
 * Pipeline: ingestDocument → if extractable → skill_create via the same path
 * the brain uses (so dedup, KG mirror, and cache-invalidation all happen).
 *
 * Supports: pdf, docx (via 'text' for now), images (OCR), markdown, plain text.
 * Returns the ingest result + the names of any skills auto-created.
 */
export declare function learnSkillFromDocument(tenantId: string, filePath: string, fileType: FileType, options?: {
    hint?: string;
}): Promise<{
    ingest: IngestResult;
    skillsCreated: string[];
}>;
/**
 * Split text into chunks respecting Arabic sentence boundaries.
 * - Splits on sentence-ending punctuation (. ! ؟ 。)
 * - Falls back to paragraph boundaries
 * - Never breaks mid-Arabic-word
 */
export declare function chunkText(text: string, maxChunkSize?: number): string[];
/**
 * Generate embeddings for text chunks.
 * Uses OpenAI-compatible embedding API.
 * Placeholder — replace endpoint/model as needed.
 */
export declare function embedChunks(chunks: string[]): Promise<number[][]>;
export declare function storeChunks(tenantId: string, documentId: string, chunks: DocumentChunk[], embeddings: number[][]): Promise<void>;
//# sourceMappingURL=ingest.d.ts.map