Converge Domain
Domain defines meaning. Core defines truth. Providers fetch reality.
Business semantics and converging workflows for the Converge runtime.
Website: converge.zone | Docs: docs.rs | Crates.io: converge-domain
What Is converge-domain?
This crate is where "we can replace/augment business systems" becomes concrete and testable.
converge-domain provides:
- Domain agents — Deterministic + LLM-governed agents for business workflows
- Invariants — Business rules compiled from Gherkin-style specifications
- Use case packs — Complete workflow compositions that converge
What converge-domain IS
| Aspect | Description |
|---|---|
| Business semantics | Typed domain concepts, terminology, schemas |
| Workflow compositions | Agent + invariant bundles that converge on outcomes |
| Policy enforcement | Gherkin-style acceptance criteria and compliance rules |
| Deterministic + governed | Rule-based agents with optional LLM enhancement |
What converge-domain is NOT
| Anti-pattern | Why Not |
|---|---|
| Not an engine | Engine lives in converge-core |
| Not providers | Adapters live in converge-provider |
| Not orchestration | No schedulers, queues, or control flow |
| Not external I/O | Providers handle all vendor calls |
Boundaries
┌─────────────────────────────────────────────────────────────────────────────┐
│ RESPONSIBILITY MATRIX │
├─────────────────────────────────────────────────────────────────────────────┤
│ converge-domain │ converge-core │ converge-provider │
│ ───────────────────── │ ────────────────── │ ──────────────────── │
│ Business semantics │ Execution engine │ External adapters │
│ Workflow compositions │ Convergence loop │ LLM/search/vector │
│ Domain agents │ Agent trait │ Capability ports │
│ Invariants/policies │ Invariant trait │ Observation producers │
│ Gherkin specifications │ Context authority │ Provenance metadata │
└─────────────────────────────────────────────────────────────────────────────┘
Dependency rules:
converge-domaindepends onconverge-core(for traits)converge-domaindepends onconverge-provider(for capability traits, not implementations)- Domain agents call provider traits; they never make direct HTTP calls
Installation
[]
= "0.2"
Related Crates
| Crate | Version | Description |
|---|---|---|
| converge-core | 0.6.1 | Runtime engine, agent traits, capabilities |
| converge-provider | 0.2.3 | 14+ LLM providers, model selection |
| converge-domain | 0.2.3 | 12 business use cases |
Use Cases
Business Strategy
| Use Case | Module | Description |
|---|---|---|
| Growth Strategy | growth_strategy |
Market signal analysis, competitor intelligence, strategy evaluation |
| Strategic Sourcing | strategic_sourcing |
Vendor assessment, risk scoring, negotiation recommendations |
| SDR Sales | sdr_sales |
Sales qualification funnel, lead scoring |
Operations
| Use Case | Module | Description |
|---|---|---|
| Supply Chain | supply_chain |
Multi-warehouse routing, demand forecasting, cost optimization |
| Inventory Rebalancing | inventory_rebalancing |
Cross-region transfers, financial impact analysis |
| Resource Routing | resource_routing |
Task-resource matching, constraint satisfaction |
Enterprise
| Use Case | Module | Description |
|---|---|---|
| Meeting Scheduler | meeting_scheduler |
Multi-participant availability, timezone normalization, conflict resolution |
| Release Readiness | release_readiness |
Quality gates, risk assessment, go/no-go decisions |
| Compliance Monitoring | compliance_monitoring |
Regulation parsing, violation detection, remediation proposals |
| HR Policy Alignment | hr_policy_alignment |
Policy distribution, understanding signals, compliance tracking |
Data & CRM
| Use Case | Module | Description |
|---|---|---|
| Catalog Enrichment | catalog_enrichment |
Product deduplication, schema validation, feed ingestion |
| CRM Account Health | crm_account_health |
Churn risk scoring, upsell identification, action prioritization |
Architecture Patterns
Each use case demonstrates:
- Fan-out/fan-in — Parallel data collection → consolidated analysis
- Pipeline stages — Seeds → Signals → Hypotheses → Strategies → Evaluations
- Invariant enforcement — Domain-specific quality gates (Gherkin-style)
- Idempotency — Context-based deduplication, not hidden state
Deterministic + LLM Variants
Each use case includes two implementations:
| Variant | Module Suffix | Description |
|---|---|---|
| Deterministic | (base) | Rule-based, fully reproducible |
| LLM-governed | _llm |
AI-powered analysis with structured output |
// Deterministic version
use StrategyAgent;
// LLM-governed version (proposals validated before becoming facts)
use StrategyAgentLlm;
Quick Start
Deterministic Mode
use ;
use ;
// Create engine with domain agents
let mut engine = new;
engine.register;
engine.register;
engine.register;
engine.register;
// Register invariants
engine.add_invariant;
engine.add_invariant;
// Seed with market data
let mut ctx = new;
ctx.add_fact?;
// Run to convergence
let result = engine.run?;
// Extract evaluated strategies
for fact in result.context.get
LLM-Governed Mode
use StrategyAgentLlm;
use AnthropicProvider;
// LLM agent emits ProposedFact (untrusted)
// Validators promote to Fact (trusted) after invariant checks
let provider = from_env?;
let llm_agent = new;
engine.register;
Governance Model
LLM outputs are never trusted by default.
Agent (LLM) → ProposedFact → Validator → Invariant Check → Fact
↑ ↓
untrusted authoritative
Every LLM-generated proposal:
- Is wrapped in
ProposedFactwith provenance - Passes through domain validators
- Satisfies all registered invariants
- Only then becomes an authoritative
Fact
Domain Evals
The crate includes a domain-level evaluation framework for testing use case quality:
use ;
use EvalExecutionAgent;
// Create eval agent with domain-specific criteria
let mut eval_agent = new;
eval_agent.register_eval;
eval_agent.register_eval;
engine.register;
Testing
# Run all domain tests
# Run specific use case tests
# Run verbose integration test (cycle-by-cycle trace)
Verbose Test Output
Each use case has a *_verbose.rs test that prints:
- Agent registration
- Cycle-by-cycle execution
- Fact emissions
- Invariant checks
- Final convergence state
Repository
This crate is part of the Converge project.
Standalone repo: github.com/kpernyer/converge-domain
License
MIT