Deterministic Core with Selective Augmentation
Intent
Ensure system correctness and reliability by using deterministic components for core execution paths while selectively applying LLM augmentation only where appropriate.
Context
Applies when: - Building systems that use LLM components - Reliability and predictability are required for core functionality - System correctness cannot depend on probabilistic outputs - Agent-based architectures risk compounding uncertainty
This pattern emerged from invalidation of the assumption: "LLM-driven components are reliable for core execution paths"
Problem
When LLM components are used for core execution: - System correctness becomes probabilistic rather than deterministic - Failures are subtle and hard to reproduce - Error propagation compounds across multiple LLM calls - Testing becomes difficult due to non-determinism - Users experience unpredictable behavior in critical paths
Forces
- Capability vs reliability
- Flexibility vs predictability
- Development speed vs correctness guarantees
- LLM power vs deterministic control
Solution
Separate system into layers based on reliability requirements:
- Deterministic Core: Core execution paths use rule-based, non-LLM components
- Data processing pipelines
- State management
- Orchestration logic
-
Safety-critical decisions
-
LLM Augmentation Layer: LLMs used only for appropriate concerns
- Content generation
- Insight extraction
- Natural language interfaces
-
Creative tasks
-
Clear Boundaries: Explicit interfaces between deterministic and probabilistic layers
-
Fallback Strategy: When LLM augmentation fails, system degrades gracefully to deterministic behavior
Implementation approach:
- Implement guardrail agents as deterministic rule-based components
- Use LLMs for generation tasks, not control flow decisions
- Validate LLM outputs before using in deterministic paths
- Design system to function correctly even when LLM augmentation is unavailable
Implementation Signals
- Core orchestration logic is non-LLM code
- Guardrail and safety components use explicit rules, not LLM judgment
- LLM calls are wrapped with validation and fallback logic
- System passes tests deterministically without LLM mocking
- Critical paths have no LLM dependencies
- LLM outputs are treated as suggestions, not directives
Evidence
- threads/architecture-signals-retrospective.v7: "LLM-centric execution → deterministic core with selective augmentation"
- Invalidated assumption: "LLM-driven components are reliable for core execution paths"
- Pattern observed: "Deterministic guardrail agents for safety-critical decisions"
- System evolution: Post-hoc validation → preventive + reactive governance
Consequences
Benefits: - Core system behavior is predictable and testable - Failures are observable and debuggable - LLM issues don't cascade through system - System remains functional during LLM outages - Safety guarantees can be made for critical paths
Trade-offs / Limitations: - Deterministic components require explicit implementation - Some capabilities may be harder without LLM flexibility - Boundary between deterministic and probabilistic must be carefully designed - May limit "agentic" autonomy in some architectures
Failure Modes: - Deterministic core becomes too rigid for valid use cases - LLM augmentation leaks into critical paths over time - Over-reliance on LLM for "non-critical" features that become critical - Validation of LLM outputs is insufficient
Anti-Patterns
- LLM agents making safety-critical decisions
- Core execution flow depending on LLM outputs
- Assuming LLM reliability for correctness guarantees
- No fallback when LLM augmentation fails
- Mixing deterministic and probabilistic logic without clear boundaries
Reuse Notes
Applies to: - runner-agentic-intelligence: Training plan system with deterministic guardrails - ideas-to-life: Experiment execution with rule-based validation - Any system where reliability matters alongside LLM capabilities
Expected reusability: High
This pattern is essential for production systems using LLM components.
Agentic Profile
- Deterministic guardrail agents
- LLM agents constrained to appropriate domains
- Orchestration agents with deterministic control flow
- Validation layers between probabilistic and deterministic components
Related Patterns
- Deterministic Guardrail: Specific implementation of deterministic components for safety
- Graceful Fallback: Provides degradation strategy when augmentation fails