Package com.tnsai.rag

Interface RetrievalEngineProvider

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RetrievalEngineProvider
SPI for creating agent-scoped RetrievalEngine instances.

The default provider lives in tnsai-intelligence. Callers create one engine for the canonical source set owned by an agent or role, reuse it across chat/action invocations, and close it with that owner. Providers must return a fresh engine for each call; sharing mutable loaders or caches across owners is allowed only when isolation is guaranteed by the backend.

Since:
0.13.0
  • Method Details

    • create

      Creates a fresh engine bound to one owner's canonical source set.
      Parameters:
      sources - immutable source declarations available to the owner
      Returns:
      fresh agent-scoped engine
    • discover

      static Optional<RetrievalEngineProvider> discover()
      Discovers the first installed provider through SpiLoader.
      Returns:
      installed provider, or empty when no retrieval runtime exists