Converge Core
Context is the only shared state. The engine decides; agents propose.
A correctness-first, context-driven multi-agent runtime library.
Website: converge.zone | Docs: docs.rs | Crates.io: converge-core
What Is Converge Core?
Converge Core is the foundational semantic engine of the Converge ecosystem. It provides:
- Context — The single source of truth, append-only and typed
- Engine — The convergence loop that orchestrates agents to a fixed point
- Agent Trait — The contract for capabilities that observe and propose
- Invariants — Runtime constraints that guard correctness (Gherkin-style)
- Capability Traits — Interfaces that providers implement
What Converge Core IS
| Aspect | Description |
|---|---|
| The authority | The engine decides what becomes a Fact |
| Context owner | Context is the API; all collaboration happens through it |
| Convergence guarantor | Execution proceeds until a fixed point is reached |
| Invariant enforcer | Constraints are checked continuously and at convergence |
| Trait definer | Defines Agent, LlmProvider, Embedding, etc. |
What Converge Core is NOT
| Anti-pattern | Why Not |
|---|---|
| Not a workflow engine | No predefined steps; agents react to context |
| Not an event bus | No pub/sub; context changes trigger eligibility |
| Not an actor system | Agents never call each other; no message passing |
| Not eventual consistency | Convergence is explicit and observable |
| Not provider implementations | Providers live in converge-provider |
Core Axioms
These are the non-negotiable principles that define Converge.
1. Context Is the Only Shared State
Agents do not call each other. They read Context and emit effects. Context is the API.
2. Agents Propose, Engine Decides
Agents return AgentEffect containing Fact or ProposedFact.
The engine validates, merges, and commits.
3. Convergence Is Mandatory
Execution proceeds until:
Context_{n+1} == Context_n(fixed point), or- Budget exhausted, or
- Invariant failed
4. Correctness Over Availability
Wrong answers are worse than no answers. Invariants block invalid states.
5. Determinism Is Transparent
Same input → same output. All decisions are traceable.
6. LLMs Suggest, Never Decide
LLM outputs become ProposedFact, not Fact.
Validators promote proposals after verification.
Converging Flow Principles
Beyond the core axioms, Converge is built on a systems-level understanding of converging flows.
What Is a Converging Flow?
A converging flow is a goal-directed, multi-agent process where:
- Multiple partial perspectives iteratively reduce uncertainty
- Progress is measured by reduction of ambiguity, not by speed or steps completed
- Execution continues until a stable decision, artifact, or state is reached
Canonical Phases
All flows decompose into six structural phases:
Intent → Framing → Exploration → Tension → Convergence → Commitment
If any phase is missing, the system oscillates, over-optimizes locally, or produces brittle outcomes.
Flow Truths
Intent must be explicit. Without declared intent, convergence must not begin.
Constraints precede exploration. Exploration without surfaced constraints produces invalid outcomes.
Tension is mandatory. If multiple perspectives immediately agree without conflict, force contradiction search.
Commitment freezes state. The system must commit or explicitly defer — no ambiguous endings.
Flow Classification
Flows are classified by dominant uncertainty:
- Epistemic ("What is true?") — high exploration, late commitment
- Pragmatic ("What works?") — bounded exploration, early feasibility pruning
- Normative ("What should be done?") — explicit values, narrative convergence
- Strategic ("What matters most?") — reframing loops, ranking under uncertainty
See converge-business/knowledgebase/core-CONVERGING_FLOWS.md for the complete flow theory.
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ converge-core │
│ The foundational layer. Depends on NOTHING in the ecosystem. │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Engine │ │ Context │ │ Invariant │ │
│ │ (decides) │───▶│ (shared) │◀───│ (guards) │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ ▲ │
│ │ │ │
│ ▼ │ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Agent │───▶│ AgentEffect │ │
│ │ (proposes) │ │ (buffered) │ │
│ └─────────────┘ └─────────────┘ │
│ │
│ Trait Definitions: │
│ • Agent • LlmProvider • Embedding │
│ • Invariant • VectorRecall • GraphRecall │
│ • Reranking • ModelSelector │
│ │
└─────────────────────────────────────────────────────────────────┘
│
│ implements traits
▼
┌─────────────────────────────────────────────────────────────────┐
│ converge-provider │
│ Capability adapters (Anthropic, OpenAI, Gemini, etc.) │
└─────────────────────────────────────────────────────────────────┘
│
│ uses providers in agents
▼
┌─────────────────────────────────────────────────────────────────┐
│ converge-domain │
│ Domain agents, use cases, business logic │
└─────────────────────────────────────────────────────────────────┘
Dependency Rules
| Crate | May Depend On | Must NOT Depend On |
|---|---|---|
converge-core |
(nothing) | converge-provider, converge-domain |
converge-provider |
converge-core |
converge-domain |
converge-domain |
converge-core, converge-provider |
— |
Installation
[]
= "0.6"
Related Crates
| Crate | Version | Description |
|---|---|---|
| converge-core | 0.6.2 | Runtime engine, agent traits, capabilities |
| converge-provider | 0.2.4 | 14+ LLM providers, model selection |
| converge-domain | 0.2.4 | 12 business use cases |
Quick Start
use ;
// Define a simple agent
;
Core Types
Context
The shared, typed, evolving state of a job.
Agent
A capability that reads context and emits effects.
AgentEffect
Buffered output from an agent. Never mutates context directly.
Fact vs ProposedFact
┌─────────────────────────────────────────────────────────────────┐
│ TRUST LEVELS │
├─────────────────────────────────────────────────────────────────┤
│ Fact (authoritative) │ ProposedFact (tentative) │
│ ───────────────────────── │ ───────────────────────────── │
│ Emitted by deterministic │ Emitted by LLM agents │
│ agents or promoted from │ Requires validation before │
│ validated proposals │ becoming a Fact │
│ Added directly to Context │ Held in Proposals key │
└─────────────────────────────────────────────────────────────────┘
Engine
The convergence loop that orchestrates agents.
Agent Idempotency Contract
All agents must follow this rule:
An agent has contributed if any artifact it emitted exists in the context — regardless of acceptance or validation.
Invariants
Runtime constraints that guard correctness.
Capability Traits
Traits for providers to implement.
// LLM completion
// Embeddings
// Vector similarity search
// Graph pattern matching
// Re-ranking
Guarantees
| Guarantee | Mechanism |
|---|---|
| Determinism | Agents sorted by name; effects merged in order |
| Termination | Budget limits cycles, facts, and wall-clock time |
| Isolation | Agents read-only context; effects buffered |
| Auditability | Every fact has provenance |
| Correctness | Invariants block invalid states |
Execution Model
repeat
1. Determine eligible agents (accepts() == true)
2. Execute eligible agents in parallel (read-only context)
3. Collect AgentEffects (buffered)
4. Merge effects into context (serialized, deterministic order)
5. Check structural invariants (immediate)
6. Check semantic invariants (per-cycle)
until
Context unchanged (convergence) OR
Budget exhausted OR
Invariant failed
finally
Check acceptance invariants (convergence gate)
Testing
# Run all convergence axiom tests
# Run all tests
# Run property-based tests
Test Categories
| Test File | What It Tests |
|---|---|
engine_convergence_axioms |
Core convergence guarantees |
convergence |
Basic convergence behavior |
parallel_execution |
Parallel agent execution |
transparent_determinism |
Determinism guarantees |
hitl_pause_resume_axioms |
Human-in-the-loop flows |
property_tests |
Property-based testing |
Documentation
See docs/ for detailed documentation:
- docs/ARCHITECTURE.md — Layering and contracts
- docs/architecture/ — Core concepts and execution model
- docs/agents/ — Agent lifecycle and patterns
- docs/governance/ — Design tenets and terminology
- docs/testing/ — Invariant and validation testing
Repository
This crate is part of the Converge project.
Standalone repo: github.com/kpernyer/converge-core
License
Proprietary (Aprio One AB)