import { Rag, RagConfig } from "./contracts/rag-config.type.mjs"; //#region ../ai/src/rag/rag.d.ts /** * Create a RAG pipeline: **chunk → embed → vector store → retrieve → * rerank → cite**, reusing the app's `ai.embedder` for embedding, a * `@warlock.js/cache` `CacheDriver` as the vector store, and the * composite-as-tool engine to expose retrieval as a tool. * * Resolution is loud at construction (mirroring `memory()`): * - `embedder` is required — a provider with no embedder must be caught * here, not at first index. * - `store` falls back to `ai.config({ defaultStore })`; if neither * resolves, construction throws. * * `retrieve()` is return-only — it never auto-injects into a prompt; the * caller formats the cited chunks (or uses `asTool()` for the agent loop). * The reranker is OFF by default (cosine-only) unless `config.reranker` * is set. * * @example * import { ai } from "@warlock.js/ai"; * import { MemoryCacheDriver } from "@warlock.js/cache"; * * const kb = ai.rag({ * name: "docs", * embedder: openai.embedder({ name: "text-embedding-3-small" }), * store: new MemoryCacheDriver(), * chunk: { type: "markdown", size: 800, overlap: 120 }, * }); * * await kb.index([{ id: "guide", text: longMarkdown, metadata: { url: "/guide" } }]); * const { chunks } = await kb.retrieve("how do I configure caching?", { topK: 4 }); */ declare function rag(config: RagConfig): Rag; //#endregion export { rag }; //# sourceMappingURL=rag.d.mts.map