pub struct Agent {
pub id: AgentId,
pub config: AgentConfig,
pub generation: u32,
pub depth: u8,
pub context: ContextPacket,
pub merkle_root: Option<Hash>,
pub created_at: DateTime<Utc>,
pub children: Vec<AgentId>,
pub shadow_id: Option<AgentId>,
pub parent_id: Option<AgentId>,
pub fitness: f64,
pub genome: Genome,
}Expand description
A fractal agent in the VEX hierarchy
Fields§
§id: AgentIdUnique identifier
config: AgentConfigConfiguration
generation: u32Generation number (0 = root, increases with each fork)
depth: u8Current depth in the hierarchy
context: ContextPacketThe agent’s current context/memory
merkle_root: Option<Hash>Merkle root of all child context hashes
created_at: DateTime<Utc>When this agent was created
children: Vec<AgentId>IDs of child agents (not serialized, reconstructed at runtime)
shadow_id: Option<AgentId>ID of shadow (adversarial) agent if spawned
parent_id: Option<AgentId>ID of parent agent (None for root)
fitness: f64Fitness score from last evaluation
genome: GenomeGenome encoding agent traits (evolved over generations)
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn new(config: AgentConfig) -> Self
pub fn new(config: AgentConfig) -> Self
Create a new root agent with the given configuration
Sourcepub fn spawn_child(&self, config: AgentConfig) -> Self
pub fn spawn_child(&self, config: AgentConfig) -> Self
Create a child agent from this agent (inherits parent’s genome)
Sourcepub fn llm_params(&self) -> LlmParams
pub fn llm_params(&self) -> LlmParams
Get LLM parameters derived from this agent’s genome
Sourcepub fn apply_evolved_genome(&mut self, evolved: Genome)
pub fn apply_evolved_genome(&mut self, evolved: Genome)
Update genome from an evolved offspring
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Agent
impl<'de> Deserialize<'de> for Agent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnwindSafe for Agent
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)