pub struct RagSetup {
pub config: RagrigConfig,
pub bibliography: Option<PathBuf>,
pub system_prompt: Option<String>,
pub stream: bool,
pub resolve_citations: bool,
pub hybrid: bool,
pub data_dir: Option<PathBuf>,
}Expand description
Everything needed to build one ragrig::RagAgent.
Fields§
§config: RagrigConfigRagrig’s own configuration tree.
bibliography: Option<PathBuf>Bibliography the worker reads and writes.
None uses the conventional <workspace>/.ragrig/references.bib.
Hosts that keep their library elsewhere set this so @key
citations, the reference rows, and GROBID all agree on one file.
system_prompt: Option<String>Prompt text applied after building; takes precedence over
config.chat.system_prompt_path.
stream: boolWhether answers stream token by token.
resolve_citations: boolWhether @key mentions in a question attach the paper as one-shot
context. On by default.
hybrid: boolWhether hybrid retrieval (BM25 + embeddings) is enabled.
Off builds a no-op embedder: questions still use explicit attachments and the bibliographic library, but no vector search runs and no embedding model is required. On by default.
data_dir: Option<PathBuf>Where the vector store, sessions, and profiles live.
None uses <config.workspace>/.ragrig. A host with a dedicated
project folder (for example .ragrig inside the document workspace)
sets this explicitly.
Implementations§
Source§impl RagSetup
impl RagSetup
Sourcepub fn new(config: RagrigConfig) -> Self
pub fn new(config: RagrigConfig) -> Self
Wrap a config without a prompt override.
Sourcepub fn with_system_prompt(
config: RagrigConfig,
prompt: impl Into<String>,
) -> Self
pub fn with_system_prompt( config: RagrigConfig, prompt: impl Into<String>, ) -> Self
Wrap a config and apply prompt before the agent is built.
Sourcepub fn with_bibliography(self, path: impl Into<PathBuf>) -> Self
pub fn with_bibliography(self, path: impl Into<PathBuf>) -> Self
Use path for the bibliography instead of the conventional file.
Sourcepub fn with_hybrid(self, hybrid: bool) -> Self
pub fn with_hybrid(self, hybrid: bool) -> Self
Turn hybrid retrieval (embeddings) on or off.
Sourcepub fn with_data_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_data_dir(self, dir: impl Into<PathBuf>) -> Self
Use dir for the vector store, sessions, and profiles.
Sourcepub fn memory_enabled(&self) -> bool
pub fn memory_enabled(&self) -> bool
Whether conversation memory is on (false for the Off strategy).
Trait Implementations§
Source§impl From<RagrigConfig> for RagSetup
impl From<RagrigConfig> for RagSetup
Source§fn from(config: RagrigConfig) -> Self
fn from(config: RagrigConfig) -> Self
Auto Trait Implementations§
impl Freeze for RagSetup
impl RefUnwindSafe for RagSetup
impl Send for RagSetup
impl Sync for RagSetup
impl Unpin for RagSetup
impl UnsafeUnpin for RagSetup
impl UnwindSafe for RagSetup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more