rag.core.backends.protocol¶

Backend protocol for ingest + query over a strategy-scoped index.

Exceptions¶

IngestNotSupportedError

Raised when a strategy cannot ingest via papers-ingest.

Classes¶

RagBackend

Ingest and query one local (or remote) RAG strategy.

Module Contents¶

exception rag.core.backends.protocol.IngestNotSupportedError[source]¶

Bases: RuntimeError

Raised when a strategy cannot ingest via papers-ingest.

class rag.core.backends.protocol.RagBackend[source]¶

Bases: Protocol

Ingest and query one local (or remote) RAG strategy.

ingest(*, config: rag.core.config.RagConfig, rebuild: bool = True, embed_model: object | None = None) rag.core.ingest.IngestResult[source]¶

Write the PDF corpus into this strategy’s index.

ask(*, question: str, config: rag.core.config.RagConfig) rag.core.query.QueryResult[source]¶

Answer a paper-level question from this strategy’s index.

is_ready(*, config: rag.core.config.RagConfig) bool[source]¶

Return True when the local index can answer questions.