/**
 * Loop-engine RAG backend — routes RagBackend through the engine daemon's
 * JSON-RPC API (memory.search + memory.create) via the T.4 UDS singleton.
 *
 * Quality: `mode: 'hybrid'` invokes engine-side RRF fusion (K=60, Cormack
 * et al. 2009) — drop-in equivalent to opensquid's `src/rag/rrf.ts:65`
 * per T.1.JJ. No TS-side fusion needed; engine does it server-side over a
 * larger native vector index than libsql's DiskANN.
 *
 * Critical design locks (T.1.B + T.1.#6):
 *
 *  1. **storeLesson → memory.create is INTENTIONAL, not a bug.** Routing
 *     here through `lesson.create` would force every recall-pool write
 *     through the wedge gate's 24h + applied_count=3 + external_signal
 *     promotion requirements (per T.1.F — unsatisfiable in a single
 *     write call, breaks unit tests). RagBackend.storeLesson semantically
 *     stores a recallable memory, NOT a wedge-gated lesson; lesson
 *     lifecycle is a separate surface added in T.6.
 *
 *  2. **Description synthesis is mandatory.** `memory.create` rejects
 *     empty `description` (T.1.B INVALID_PARAMS -32602). Synthesized
 *     from first sentence → first 80 chars → ultimate fallback. Lesson
 *     shape doesn't carry a description field today, so we derive it.
 *
 *  3. **`include_body: true` on every recall.** memory.search's default
 *     `body_preview` is truncated to 240 chars (engine serve.rs); without
 *     this flag RecallHit.lesson.content gets cut mid-sentence.
 *
 *  4. **Source vocab mapping at the boundary.** Engine speaks
 *     `'semantic' | 'text' | 'both'`; RagBackend's RecallHit speaks
 *     `'semantic' | 'lexical' | 'fused'`. The adapter table is the
 *     single point of translation — DO NOT leak engine vocab past it.
 *
 *  5. **Engine schema gap.** `memory.create` doesn't preserve tags /
 *     source / author / createdAt today (T.8 follow-up filed). For v1
 *     we send `description` + `content` only; lesson metadata round-trips
 *     via the Lesson defaults applied by `src/functions/rag.ts:122-145`.
 *
 *  6. **No daemon lifecycle here.** `EngineClient` connects via the T.4
 *     `acquireOrSpawnEngine()` singleton transparently — zero per-call
 *     subprocess cost, cross-session shared engine.
 *
 * Imports from: ../../engine/client.js, ../ollama_client.js, ../types.js.
 * Imported by: src/rag/backend_factory.ts.
 */
import { EngineClient } from '../../engine/client.js';
import type { RagBackend } from '../types.js';
export interface LoopEngineBackendOpts {
    /** Injected client for tests; production uses the singleton-backed default. */
    client?: EngineClient;
    /** Recall mode. 'hybrid' = engine semantic+text+RRF (default, matches
     *  libsql-qwen3 quality per T.1.JJ). 'semantic' = vector only. 'text' =
     *  pure text-match. */
    mode?: 'semantic' | 'text' | 'hybrid';
    /** Ollama URL for embed() — only used when a rule asks for a raw vector
     *  via the `embed` primitive. Engine handles embedding internally for
     *  memory.create + memory.search. */
    ollamaUrl?: string;
}
export declare function loopEngineBackend(opts?: LoopEngineBackendOpts): RagBackend;
//# sourceMappingURL=loop_engine.d.ts.map