/**
 * RAG backend factory: maps a `BackendConfig` to a concrete `RagBackend`.
 *
 * Phase 1 supports `libsql-qwen3` (hybrid semantic+lexical default) and
 * `libsql-lexical` (FTS5-only fallback, Task 1.11). Task 1.12 will add
 * `claude-auto-memory`. Each new backend is one switch arm — the rest
 * of the runtime stays unchanged.
 *
 * `kind` is a string-literal discriminant so future additions don't break
 * existing config files: an unknown `kind` throws a clear error instead
 * of silently selecting a default. Pack manifests that depend on a
 * backend that hasn't shipped yet will fail loudly at load time, which
 * is what we want.
 *
 * Also exports `libsqlQwen3WithLexicalFallback` — a thin wrapper that
 * starts as qwen3 and swaps to lexical the first time `embed()` returns
 * `null` (Ollama unreachable). Single-direction transition: once swapped,
 * stays swapped for the session, so we don't retry a dead embedder on
 * every call. Replaces the stderr notification with the Task 1.14
 * notification router once that lands — placeholder for now.
 *
 * Imports from: ./backends/libsql_qwen3.js, ./backends/libsql_lexical.js,
 * ./types.js.
 * Imported by: src/runtime/ (Phase 1 wiring), tests.
 */
import type { RagBackend } from './types.js';
export type BackendConfig = {
    kind: 'libsql-qwen3';
    dbUrl: string;
    ollamaUrl: string;
    embedderModel?: string;
} | {
    kind: 'libsql-lexical';
    dbUrl: string;
} | {
    kind: 'claude-auto-memory';
} | {
    kind: 'libsql-fastembed';
    dbUrl: string;
    sourceDir?: string;
};
export declare function createBackend(config: BackendConfig): RagBackend;
export interface QwenWithFallbackOpts {
    dbUrl: string;
    ollamaUrl: string;
    embedderModel?: string;
}
/**
 * Hybrid wrapper: starts as libsql-qwen3, swaps to libsql-lexical on the
 * first `embed()` that returns `null` (Ollama down). Both backends share
 * the same dbUrl so the lessons table written by the primary remains
 * queryable after the swap.
 *
 * One-way transition by design — retry on every call would burn worst-case
 * latency for the rest of the session if Ollama stays down. If the user
 * restarts Ollama mid-session they can restart the host.
 */
export declare function libsqlQwen3WithLexicalFallback(opts: QwenWithFallbackOpts): RagBackend;
//# sourceMappingURL=backend_factory.d.ts.map