retrieval
Composable retrieval APIs for Rago.
Modules:
-
base–Base classes for retrieval steps.
-
dummy–In-memory retrieval implementations.
-
file–File-based retrieval implementations.
-
text_splitter–Package for classes about text splitter.
-
tools–Tools for support retrieval classes.
Classes:
-
Retrieval–Public retrieval wrapper that resolves a concrete backend lazily.
-
RetrievalBase–Base retrieval class.
-
RetrievalParameters–Parameters for configuring retrieval steps.
Retrieval
Retrieval(
source: Any = None,
backend: str = 'string',
api_key: str = '',
api_params: dict[str, Any] | None = None,
splitter: Any = None,
cache: Any = None,
logs: dict[str, Any] | None = None,
)
Bases: StepBase
Public retrieval wrapper that resolves a concrete backend lazily.
Methods:
-
apply–Apply declarative configuration to the retrieval wrapper.
-
get–Backward-compatible alias for
retrieve. -
process–Process the current pipeline source with retrieval.
-
retrieve–Resolve the concrete retriever and fetch content.
Source code in src/rago/retrieval/__init__.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
apply
apply(parameters: Any) -> None
Apply declarative configuration to the retrieval wrapper.
Source code in src/rago/retrieval/__init__.py
63 64 65 66 67 68 69 70 71 72 | |
get
get(query: str = '', source: Any = None) -> list[str]
Backward-compatible alias for retrieve.
Source code in src/rago/retrieval/__init__.py
99 100 101 | |
process
Process the current pipeline source with retrieval.
Source code in src/rago/retrieval/__init__.py
103 104 105 106 107 108 109 110 111 112 113 | |
retrieve
retrieve(query: str = '', source: Any = None) -> list[str]
Resolve the concrete retriever and fetch content.
Source code in src/rago/retrieval/__init__.py
94 95 96 97 | |
RetrievalBase
RetrievalBase(
source: Any = None,
splitter: TextSplitterBase | None = None,
api_key: str = '',
api_params: dict[str, Any] | None = None,
cache: Cache | None = None,
logs: dict[str, Any] | None = None,
)
Bases: StepBase
Base retrieval class.
Methods:
-
apply–Apply attached configuration to the step.
-
get–Backward-compatible alias for
retrieve. -
process–Resolve the content for downstream steps.
-
retrieve–Get the data from the source.
Source code in src/rago/retrieval/base.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
apply
apply(parameters: Any) -> None
Apply attached configuration to the step.
Source code in src/rago/base.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
get
get(query: str = '', source: Any = None) -> list[str]
Backward-compatible alias for retrieve.
Source code in src/rago/retrieval/base.py
100 101 102 | |
process
Resolve the content for downstream steps.
Source code in src/rago/retrieval/base.py
104 105 106 107 108 109 110 111 112 113 114 | |
retrieve
abstractmethod
retrieve(query: str = '', source: Any = None) -> list[str]
Get the data from the source.
Source code in src/rago/retrieval/base.py
96 97 98 | |
RetrievalParameters
RetrievalParameters(**kwargs: Any)
Bases: ParametersBase
Parameters for configuring retrieval steps.
Methods:
-
apply–Merge additional configuration into this object.
-
process–Return the input unchanged for configuration-only objects.
Attributes:
-
params(dict[str, Any]) –Expose the underlying parameter mapping.
Source code in src/rago/base.py
62 63 | |
params
property
params: dict[str, Any]
Expose the underlying parameter mapping.
apply
apply(parameters: Any) -> None
Merge additional configuration into this object.
Source code in src/rago/base.py
86 87 88 | |