Multi Agent Context Manager • Rust AI Agent SDK
MultiAgentContextManager: Context manager for multi-agent scenarios.
MultiAgentContextManager
Defined in the context module.
Rust AI Agent SDK
Context manager for multi-agent scenarios.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
input["Input Data"] --> agent["Agent: MultiAgentContextManager"]
agent --> output["Output Result"]
style agent fill:#8B0000,color:#fff
style input fill:#8B0000,color:#fff
style output fill:#8B0000,color:#fffFields
| Name | Type | Description |
|---|---|---|
managers | HashMap<String | Per-agent managers |
shared_segments | Vec<ContextSegment> | Shared context segments |
Methods
new
fn new() -> SelfCreate a new multi-agent context manager
register_agent
fn register_agent(&mut self, agent_id: impl Into<String>, config: ContextConfig) -> ()Register an agent
Parameters:
| Name | Type |
|---|---|
agent_id | impl Into<String> |
config | ContextConfig |
get
fn get(&self, agent_id: &str) -> Option<&ContextManager>Get manager for an agent
Parameters:
| Name | Type |
|---|---|
agent_id | &str |
get_mut
fn get_mut(&mut self, agent_id: &str) -> Option<&mut ContextManager>Get mutable manager for an agent
Parameters:
| Name | Type |
|---|---|
agent_id | &str |
add_shared
fn add_shared(&mut self, segment: ContextSegment) -> ()Add shared segment
Parameters:
| Name | Type |
|---|---|
segment | ContextSegment |
agent_ids
fn agent_ids(&self) -> Vec<&String>Get all agent IDs
Source
View on GitHubpraisonai/src/context/mod.rs at line 505