Crate converge_core

Crate converge_core 

Source
Expand description

§Converge Core

A correctness-first, context-driven multi-agent runtime.

Converge is an Agent OS where:

  • Context is the API
  • Agents collaborate through data, not calls
  • Execution proceeds until a fixed point
  • Convergence is explicit and observable

§Quick Start

use converge_core::{Engine, Context, ContextKey};
use converge_core::agents::{SeedAgent, ReactOnceAgent};

// Create engine and register agents
let mut engine = Engine::new();
engine.register(SeedAgent::new("seed-1", "initial data"));
engine.register(ReactOnceAgent::new("hyp-1", "derived insight"));

// Run until convergence
let result = engine.run(Context::new()).expect("should converge");

// Inspect results
assert!(result.converged);
assert!(result.context.has(ContextKey::Seeds));
assert!(result.context.has(ContextKey::Hypotheses));
println!("Converged in {} cycles", result.cycles);

§Core Concepts

  • Context: The shared, typed, evolving state of a job
  • Agent: A capability that reads context and emits effects
  • AgentEffect: Buffered output (facts) from an agent
  • Engine: The convergence loop that coordinates agents

§Guarantees

  • Determinism: Same input → same output
  • Termination: Budgets prevent infinite loops
  • Isolation: Agents never call each other
  • Auditability: All changes are traceable

Re-exports§

pub use invariant::Invariant;
pub use invariant::InvariantClass;
pub use invariant::InvariantError;
pub use invariant::InvariantResult;
pub use invariant::Violation;
pub use model_selection::AgentRequirements;
pub use model_selection::ComplianceLevel;
pub use model_selection::CostClass;
pub use model_selection::DataSovereignty;
pub use model_selection::ModelSelectorTrait;
pub use prompt::AgentPrompt;
pub use prompt::AgentRole;
pub use prompt::Constraint;
pub use prompt::OutputContract;
pub use prompt::PromptContext;
pub use prompt::PromptFormat;
pub use root_intent::Budgets;
pub use root_intent::IntentConstraint;
pub use root_intent::IntentId;
pub use root_intent::IntentKind;
pub use root_intent::IntentValidationError;
pub use root_intent::Objective;
pub use root_intent::RootIntent;
pub use root_intent::Scope;
pub use root_intent::ScopeConstraint;
pub use root_intent::SuccessCriteria;
pub use root_intent::SuccessCriterion;
pub use root_intent::ConstraintSeverity;

Modules§

agents
Example agents for testing and demonstration.
invariant
Invariant system for Converge.
llm
LLM provider abstraction for Converge.
model_selection
Model selection based on agent requirements.
prompt
Converge Prompt DSL — Compact machine-to-machine contract format.
root_intent
Root Intent — The constitution of a Converge job.
validation
LLM output validation for Converge.

Structs§

AgentEffect
The output of an agent’s execution.
AgentId
Unique identifier for a registered agent.
Budget
Budget limits for execution.
Context
The shared context for a Converge job.
ConvergeResult
Result of a converged execution.
Engine
The Converge execution engine.
Fact
A typed assertion added to context.
ProposedFact
A suggested fact from a non-authoritative source (e.g., LLM).
ValidationError
Error when a ProposedFact fails validation.

Enums§

ContextKey
A key identifying a category of facts in context.
ConvergeError
Top-level error type for Converge operations.

Traits§

Agent
A semantic capability that observes context and emits effects.