Expand description
Context Provider Extension Point
This module provides the extension point for integrating context databases like OpenViking into the agent loop. Context providers can supply memory, resources, and skills to augment the LLM’s context.
§Usage
Implement the ContextProvider trait and register it with a session:
ⓘ
use a3s_code::context::{ContextProvider, ContextQuery, ContextResult};
struct MyProvider { /* ... */ }
#[async_trait::async_trait]
impl ContextProvider for MyProvider {
fn name(&self) -> &str { "my-provider" }
async fn query(&self, query: &ContextQuery) -> anyhow::Result<ContextResult> {
// Retrieve relevant context...
}
}Structs§
- Context
Item - A single piece of retrieved context
- Context
Query - Query to a context provider
- Context
Result - Result from a context provider query
Enums§
- Context
Depth - Retrieval depth for tiered context (L0/L1/L2 pattern)
- Context
Type - Type of context being queried
Traits§
- Context
Provider - Context provider trait - implement this for OpenViking, RAG systems, etc.