Skip to main content

somatize_agent/
lib.rs

1// The crate is fully documented and clippy runs with -D warnings in CI,
2// so this makes "public API without docs" a build error from here on.
3#![warn(missing_docs)]
4
5//! Autonomous research over Soma pipelines.
6//!
7//! One thing lives here: [`ResearchStep`], a [`Step`](somatize_core::step::Step)
8//! that proposes an experiment, runs it as an
9//! [`Effect::Graph`](somatize_core::effect::Effect), reads the metrics, and
10//! decides whether to keep going.
11//!
12//! Everything else it needs already exists elsewhere and is not
13//! reimplemented here: the loop is the effect driver's, the durability is
14//! the journal's, the record is `somatize-memory`'s, and running a pipeline
15//! is `GraphHandler`'s. What is left is the reasoning, and the reasoning is
16//! the model's.
17//!
18//! This replaces a rule-based planner that varied one parameter through a
19//! fixed list of values, with a comment in it saying an LLM would go here.
20//!
21//! ```ignore
22//! let agent = ResearchStep::new("ollama/qwen2.5", "beat 0.8 F1", pipeline)
23//!     .with_history(kb.all()?)      // start from what is already known
24//!     .with_max_iterations(10);
25//!
26//! let mut catalog = NodeCatalog::new();
27//! catalog.register_step("researcher", Box::new(agent));
28//! ```
29
30pub mod action;
31pub mod research;
32
33pub use action::Action;
34pub use research::ResearchStep;