augmented
Composable augmentation APIs for Rago.
Modules:
-
base–Base classes for augmentation steps.
-
cohere–Classes for augmentation with Cohere embeddings.
-
db–Rago DB package.
-
fireworks–Classes for augmentation with Fireworks embeddings.
-
openai–Classes for augmentation with OpenAI embeddings.
-
sentence_transformer–Classes for augmentation with hugging face.
-
spacy–Classes for augmentation with SpaCy embeddings.
-
together–Classes for augmentation with Together embeddings.
Classes:
-
Augmented–Public augmentation wrapper that resolves a concrete backend lazily.
-
AugmentedBase–Base class for all augmentation steps.
-
AugmentedParameters–Parameters for configuring augmentation steps.
Augmented
Augmented(
api_key: str = '',
model_name: str = '',
backend: str = '',
engine: str = '',
top_k: int | None = None,
api_params: dict[str, Any] | None = None,
db: Any = None,
cache: Any = None,
logs: dict[str, Any] | None = None,
)
Bases: StepBase
Public augmentation wrapper that resolves a concrete backend lazily.
Methods:
-
apply–Apply declarative configuration to the augmentation wrapper.
-
process–Process the current pipeline content with augmentation.
-
search–Resolve the concrete augmenter and run search.
Source code in src/rago/augmented/__init__.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
apply
apply(parameters: Any) -> None
Apply declarative configuration to the augmentation wrapper.
Source code in src/rago/augmented/__init__.py
68 69 70 71 72 73 74 75 76 77 78 79 | |
process
Process the current pipeline content with augmentation.
Source code in src/rago/augmented/__init__.py
122 123 124 125 126 127 128 129 130 131 132 133 | |
search
search(
query: str, documents: Any, top_k: int = 0
) -> list[str]
Resolve the concrete augmenter and run search.
Source code in src/rago/augmented/__init__.py
117 118 119 120 | |
AugmentedBase
AugmentedBase(
model_name: Optional[str] = None,
db: DBBase | None = None,
top_k: Optional[int] = None,
api_key: str = '',
api_params: dict[str, Any] | None = None,
cache: Cache | None = None,
logs: dict[str, Any] | None = None,
)
Bases: StepBase
Base class for all augmentation steps.
Methods:
-
apply–Apply attached configuration to the step.
-
get_embedding–Retrieve embeddings for the given texts.
-
process–Run augmentation against the current pipeline content.
-
search–Search for the most relevant documents.
Source code in src/rago/augmented/base.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
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_embedding
get_embedding(content: list[str]) -> EmbeddingType
Retrieve embeddings for the given texts.
Source code in src/rago/augmented/base.py
127 128 129 | |
process
Run augmentation against the current pipeline content.
Source code in src/rago/augmented/base.py
154 155 156 157 158 159 160 161 162 | |
search
abstractmethod
search(
query: str, documents: Any, top_k: int = 0
) -> list[str]
Search for the most relevant documents.
Source code in src/rago/augmented/base.py
131 132 133 | |
AugmentedParameters
AugmentedParameters(**kwargs: Any)
Bases: ParametersBase
Parameters for configuring augmentation 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 | |