Skip to main content

AgentConfig

Struct AgentConfig 

Source
pub struct AgentConfig {
Show 15 fields pub agent_id: String, pub agent_type: AgentType, pub capabilities: AgentCapabilities, pub registration_endpoint: String, pub sensory_endpoint: String, pub motor_endpoint: String, pub visualization_endpoint: String, pub control_endpoint: String, pub heartbeat_interval: f64, pub connection_timeout_ms: u64, pub registration_retries: u32, pub retry_backoff_ms: u64, pub sensory_send_hwm: i32, pub sensory_linger_ms: i32, pub sensory_immediate: bool,
}
Expand description

Agent configuration builder

Fields§

§agent_id: String

Unique agent identifier

§agent_type: AgentType

Agent type (sensory, motor, both, visualization, or infrastructure)

§capabilities: AgentCapabilities

Agent capabilities

§registration_endpoint: String

FEAGI registration endpoint (ZMQ REQ)

§sensory_endpoint: String

FEAGI sensory input endpoint (ZMQ PUSH)

§motor_endpoint: String

FEAGI motor output endpoint (ZMQ SUB)

§visualization_endpoint: String

FEAGI visualization stream endpoint (ZMQ SUB)

§control_endpoint: String

FEAGI control/API endpoint (ZMQ REQ - REST over ZMQ)

§heartbeat_interval: f64

Heartbeat interval in seconds (0 = disabled)

§connection_timeout_ms: u64

Connection timeout in milliseconds

§registration_retries: u32

Registration retry attempts

§retry_backoff_ms: u64

Retry backoff base in milliseconds

§sensory_send_hwm: i32

ZMQ PUSH socket high-water-mark for sensory data

§sensory_linger_ms: i32

ZMQ PUSH socket linger period when disconnecting

§sensory_immediate: bool

Whether to enable ZMQ immediate mode on the sensory socket

Implementations§

Source§

impl AgentConfig

Source

pub fn new(agent_id: impl Into<String>, agent_type: AgentType) -> Self

Create a new agent configuration

§Arguments
  • agent_id - Unique identifier for this agent
  • agent_type - Type of agent (Sensory, Motor, or Both)
§Example
use feagi_agent::{AgentConfig, AgentType};

let config = AgentConfig::new("my_camera", AgentType::Sensory);
Source

pub fn with_feagi_host(self, host: impl Into<String>) -> Self

👎Deprecated since 0.1.0: Use with_feagi_endpoints() instead to explicitly specify all ports

Set FEAGI host and ports to derive all endpoints

Note: This method requires explicit port numbers. NO DEFAULTS are provided. Ports must match those configured in FEAGI’s feagi_configuration.toml

§Example
let config = AgentConfig::new("camera", AgentType::Sensory)
    .with_feagi_endpoints("192.168.1.100", 30001, 5558, 5564, 5562, 5563);
Source

pub fn with_feagi_endpoints( self, host: impl Into<String>, registration_port: u16, sensory_port: u16, motor_port: u16, visualization_port: u16, control_port: u16, ) -> Self

Set FEAGI endpoints with explicit ports (RECOMMENDED)

All ports must be provided explicitly to match FEAGI’s configuration. No default values are used.

§Example
let config = AgentConfig::new("camera", AgentType::Sensory)
    .with_feagi_endpoints(
        "192.168.1.100",
        30001,  // registration_port
        5558,   // sensory_port
        5564,   // motor_port
        5562,   // visualization_port
        5563    // control_port
    );
Source

pub fn with_registration_endpoint(self, endpoint: impl Into<String>) -> Self

Set registration endpoint

Source

pub fn with_sensory_endpoint(self, endpoint: impl Into<String>) -> Self

Set sensory input endpoint

Source

pub fn with_motor_endpoint(self, endpoint: impl Into<String>) -> Self

Set motor output endpoint

Source

pub fn with_visualization_endpoint(self, endpoint: impl Into<String>) -> Self

Set visualization stream endpoint

Source

pub fn with_control_endpoint(self, endpoint: impl Into<String>) -> Self

Set control/API endpoint

Source

pub fn with_heartbeat_interval(self, interval: f64) -> Self

Set heartbeat interval in seconds (0 to disable)

Source

pub fn with_connection_timeout_ms(self, timeout_ms: u64) -> Self

Set connection timeout in milliseconds

Source

pub fn with_registration_retries(self, retries: u32) -> Self

Set registration retry attempts

Source

pub fn with_sensory_socket_config( self, send_hwm: i32, linger_ms: i32, immediate: bool, ) -> Self

Configure sensory socket behaviour (ZMQ PUSH)

Source

pub fn with_vision_capability( self, modality: impl Into<String>, dimensions: (usize, usize), channels: usize, target_cortical_area: impl Into<String>, ) -> Self

Add vision capability

§Example
let config = AgentConfig::new("camera", AgentType::Sensory)
    .with_vision_capability("camera", (640, 480), 3, "i_vision");
Source

pub fn with_motor_capability( self, modality: impl Into<String>, output_count: usize, source_cortical_areas: Vec<String>, ) -> Self

Add motor capability

§Example
let config = AgentConfig::new("arm", AgentType::Motor)
    .with_motor_capability("servo", 4, vec!["o_motor".to_string()]);
Source

pub fn with_vision_unit( self, modality: impl Into<String>, dimensions: (usize, usize), channels: usize, unit: SensoryUnit, group: u8, ) -> Self

Add vision capability using semantic unit + group (Option B contract).

This avoids requiring SDK users to know FEAGI’s internal cortical ID encoding.

Source

pub fn with_motor_unit( self, modality: impl Into<String>, output_count: usize, unit: MotorUnit, group: u8, ) -> Self

Add motor capability using semantic unit + group (Option B contract).

Source

pub fn with_motor_units( self, modality: impl Into<String>, output_count: usize, source_units: Vec<MotorUnitSpec>, ) -> Self

Add multiple motor units using semantic unit + group pairs (Option B contract).

Source

pub fn with_visualization_capability( self, visualization_type: impl Into<String>, resolution: Option<(usize, usize)>, refresh_rate: Option<f64>, bridge_proxy: bool, ) -> Self

Add visualization capability

§Example
let config = AgentConfig::new("brain_viz", AgentType::Visualization)
    .with_visualization_capability("3d_brain", Some((1920, 1080)), Some(30.0), false);
Source

pub fn with_sensory_capability( self, rate_hz: f64, shm_path: Option<String>, ) -> Self

Add sensory capability (generic)

This is used for non-vision sensory modalities (text, audio, etc.)

Device registrations are handled separately via ConnectorAgent and device_registrations in capabilities.

§Arguments
  • rate_hz - Sensory data rate in Hz
  • shm_path - Optional shared memory path
§Example
let config = AgentConfig::new("text_input", AgentType::Sensory)
    .with_sensory_capability(20.0, None);
Source

pub fn with_custom_capability( self, key: impl Into<String>, value: Value, ) -> Self

Add custom capability

§Example
use serde_json::json;

let config = AgentConfig::new("audio", AgentType::Sensory)
    .with_custom_capability("audio", json!({
        "sample_rate": 44100,
        "channels": 2
    }));
Source

pub fn validate(&self) -> Result<()>

Validate configuration

Trait Implementations§

Source§

impl Clone for AgentConfig

Source§

fn clone(&self) -> AgentConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgentConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more