Knowledge Config • Rust AI Agent SDK
KnowledgeConfig: Knowledge configuration.
KnowledgeConfig
Defined in the knowledge module.
Rust AI Agent SDK
Knowledge configuration.
Fields
| Name | Type | Description |
|---|---|---|
chunking | ChunkingConfig | Chunking configuration |
retrieval_strategy | RetrievalStrategy | Retrieval strategy |
default_limit | usize | Default search limit |
enable_reranking | bool | Enable reranking |
user_id | Option<String> | User ID for scoping |
agent_id | Option<String> | Agent ID for scoping |
Methods
new
fn new() -> SelfCreate a new config
chunking
fn chunking(mut self, config: ChunkingConfig) -> SelfSet chunking config
Parameters:
| Name | Type |
|---|---|
config | ChunkingConfig |
retrieval_strategy
fn retrieval_strategy(mut self, strategy: RetrievalStrategy) -> SelfSet retrieval strategy
Parameters:
| Name | Type |
|---|---|
strategy | RetrievalStrategy |
default_limit
fn default_limit(mut self, limit: usize) -> SelfSet default limit
Parameters:
| Name | Type |
|---|---|
limit | usize |
enable_reranking
fn enable_reranking(mut self, enable: bool) -> SelfEnable reranking
Parameters:
| Name | Type |
|---|---|
enable | bool |
user_id
fn user_id(mut self, id: impl Into<String>) -> SelfSet user ID
Parameters:
| Name | Type |
|---|---|
id | impl Into<String> |
agent_id
fn agent_id(mut self, id: impl Into<String>) -> SelfSet agent ID
Parameters:
| Name | Type |
|---|---|
id | impl Into<String> |
Source
View on GitHubpraisonai/src/knowledge/mod.rs at line 633