feagi-agent (Rust)
Rust client library for building FEAGI agents.
This crate is designed to remain runtime-agnostic and compatible with future targets such as WASM and Embassy/RTOS environments.
What this crate provides
- Poll-based client primitives (registration/control + data channels) built on
feagi-io. - A runtime-agnostic session orchestration state machine (
clients::SessionStateMachine). - Optional Tokio adapter layer (
clients::async_helpers::tokio_generic_implementations) behind theagent-client-asynchelper-tokiofeature.
Quick Start
use ;
use SessionTimingConfig;
use ;
use FeagiZmqClientRequesterProperties;
use Duration;
// Registration endpoint (example uses ZMQ; WebSocket is also supported).
let registration_endpoint = "<transport endpoint string>";
let registration_properties = Boxnew;
let agent_descriptor = new?;
let auth_token = new;
let driver = TokioDriverConfig ;
let requested = vec!;
let mut agent = new_connect_and_register.await?;
// Drive maintenance explicitly.
agent.tick?;
Installation
Add to your Cargo.toml:
[]
= { = "../feagi-agent" }
Examples
This crate includes examples under examples/. Some examples require enabling feature flags.
Architecture
Session orchestration
The preferred orchestration abstraction is clients::SessionStateMachine:
- It is pure logic (no I/O, no sleeps).
- A driver (Tokio/WASM/Embassy/RTOS) feeds events and executes actions.
- ZMQ and WebSocket are both supported via
TransportProtocolEndpoint.
Error Handling
Errors use feagi_agent::FeagiAgentError and feagi_io::FeagiNetworkError (via From conversions).
Testing
Run unit tests:
License
Apache-2.0
Contributing
See CONTRIBUTING.md for guidelines.