import type { RagChunk } from '../hallucination/rag.js'; export { MemoryVectorStore, createHashEmbeddings, cosineSimilarity, matchesMetadata, normalizeVector, type EmbeddingProvider, type VectorDocument, type VectorSearchOptions, type VectorSearchResult, type VectorStore, } from '../hallucination/retrieval.js'; export type { RagChunk } from '../hallucination/rag.js'; /** A document to split into chunks. */ export interface DocumentSource { /** Its id, used in chunk ids. Defaults to `doc-1`, `doc-2`, and so on. */ id?: string; /** Its text. */ text: string; /** Where it came from, carried on each chunk. */ source?: string; /** Application data carried on each chunk. */ metadata?: Record; } /** How documents are split. */ export interface IngestionOptions { /** Most characters per chunk. Defaults to 1,200. */ chunkSize?: number; /** Characters repeated between neighbouring chunks. Defaults to 150. */ overlap?: number; /** Splits at Markdown headings first, so no chunk spans two sections. Off by default. */ splitOnMarkdownHeadings?: boolean; } /** The chunks produced from a set of documents. */ export interface IngestionResult { /** The chunks, ready for a vector store. */ chunks: RagChunk[]; /** Documents read. */ documents: number; /** Characters across every document. */ totalCharacters: number; } /** Splits documents into overlapping chunks for retrieval. */ export declare function ingestDocuments(documents: DocumentSource[], options?: IngestionOptions): IngestionResult; /** Splits one text into overlapping chunks for retrieval. */ export declare function ingestText(text: string, options?: IngestionOptions & { source?: string; }): IngestionResult;