Skip to main content

KnowledgeProvider

Trait KnowledgeProvider 

Source
pub trait KnowledgeProvider: Send + Sync {
    // Required methods
    fn context<'life0, 'life1, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
    ) -> Pin<Box<dyn Future<Output = Result<KnowledgeContext, KnowledgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn grant<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        run: &'life2 RunInfo<'life3>,
    ) -> Pin<Box<dyn Future<Output = Result<RunGrant, KnowledgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn excerpts<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        who: &'life1 Requester,
        query: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, KnowledgeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

The bot’s knowledge and memory (design §5).

Required Methods§

Source

fn context<'life0, 'life1, 'async_trait>( &'life0 self, who: &'life1 Requester, ) -> Pin<Box<dyn Future<Output = Result<KnowledgeContext, KnowledgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persona, catalog and profile for the system prompt.

Source

fn grant<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, who: &'life1 Requester, run: &'life2 RunInfo<'life3>, ) -> Pin<Box<dyn Future<Output = Result<RunGrant, KnowledgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Issues tool access for one run, scoped to who.

Source

fn excerpts<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, who: &'life1 Requester, query: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String, KnowledgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Text search for backends without MCP: the most relevant excerpts for query, or an empty string when nothing matches.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§