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...
}
}Re-exports§
pub use fs_provider::FileSystemContextConfig;pub use fs_provider::FileSystemContextProvider;pub use vector_provider::VectorContextConfig;pub use vector_provider::VectorContextProvider;pub use vector_store::InMemoryVectorStore;pub use vector_store::VectorStore;
Modules§
- embedding
- Embedding Provider Extension Point
- fs_
provider - File System Context Provider
- vector_
provider - Vector RAG Context Provider
- vector_
store - Vector Store Extension Point
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.