rag.core.strategy¶

RAG orchestration strategies (one persist dir per strategy).

Attributes¶

Classes¶

RagStrategy

In-process orchestration library used to ingest and query the PDF corpus.

Functions¶

index_dir_for(→ pathlib.Path)

Return the default persist directory for a strategy.

Module Contents¶

rag.core.strategy.RAG_STRATEGY_ENV: Final = 'RAG_STRATEGY'[source]¶
rag.core.strategy.INDEXES_DIR_NAME: Final = 'indexes'[source]¶
rag.core.strategy.INGEST_ALL: Final = 'all'[source]¶
class rag.core.strategy.RagStrategy[source]¶

Bases: enum.StrEnum

In-process orchestration library used to ingest and query the PDF corpus.

LLAMAINDEX = 'llamaindex'[source]¶
LANGCHAIN = 'langchain'[source]¶
classmethod ingestible() tuple[RagStrategy, Ellipsis][source]¶

Return strategies that write a local index via papers-ingest.

Returns:

Every in-process backend (LlamaIndex and LangChain).

Return type:

tuple of RagStrategy

rag.core.strategy.index_dir_for(*, repo_root: pathlib.Path, strategy: RagStrategy) pathlib.Path[source]¶

Return the default persist directory for a strategy.

Parameters:
  • repo_root (Path) – Monorepo root.

  • strategy (RagStrategy) – Orchestration backend.

Returns:

{repo_root}/.data/indexes/{strategy}.

Return type:

Path