https://github.com/legionio/lex-agentic-inference
LegionIO agentic domain gem: inference cognition extensions
https://github.com/legionio/lex-agentic-inference
Last synced: about 2 months ago
JSON representation
LegionIO agentic domain gem: inference cognition extensions
- Host: GitHub
- URL: https://github.com/legionio/lex-agentic-inference
- Owner: LegionIO
- License: apache-2.0
- Created: 2026-03-18T05:26:17.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-15T16:59:21.000Z (2 months ago)
- Last Synced: 2026-04-15T18:36:01.532Z (2 months ago)
- Language: Ruby
- Size: 299 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# lex-agentic-inference
Domain consolidation gem for reasoning, inference, and belief management. Bundles 27 source extensions into one loadable unit under `Legion::Extensions::Agentic::Inference`.
## Overview
**Gem**: `lex-agentic-inference`
**Version**: 0.1.8
**Namespace**: `Legion::Extensions::Agentic::Inference`
## Sub-Modules
| Sub-Module | Source Gem | Purpose |
|---|---|---|
| `Inference::Abductive` | `lex-abductive-reasoning` | Best-explanation inference — hypothesis generation and ranking |
| `Inference::Analogical` | `lex-analogical-reasoning` | Structural analogy mapping between domains |
| `Inference::ArgumentMapping` | `lex-argument-mapping` | Argument tree — premises, conclusions, objections, rebuttals |
| `Inference::Bayesian` | `lex-bayesian-belief` | Bayesian belief updating with likelihood ratios |
| `Inference::BeliefRevision` | `lex-belief-revision` | AGM-model contraction, expansion, and revision |
| `Inference::CausalAttribution` | `lex-causal-attribution` | Weiner's attribution model — internal/external, stable/unstable |
| `Inference::CausalReasoning` | `lex-causal-reasoning` | Causal graph inference, do-calculus |
| `Inference::Counterfactual` | `lex-counterfactual` | Nearest-world counterfactual simulation |
| `Inference::HypothesisTesting` | `lex-hypothesis-testing` | Scientific reasoning loop — generate, predict, test, evaluate |
| `Inference::Prediction` | `lex-prediction` | Forward-model prediction — four modes, rolling accuracy tracking |
| `Inference::PredictiveCoding` | `lex-predictive-coding` | Hierarchical predictive coding with precision-weighted error |
| `Inference::PredictiveProcessing` | `lex-predictive-processing` | Unified perception/action loop |
| `Inference::FreeEnergy` | `lex-free-energy` | Friston Free Energy Principle — minimize prediction error |
| `Inference::Intuition` | `lex-intuition` | Fast heuristic-based inference |
| `Inference::Schema` | `lex-schema` | Organized knowledge structures — schema activation |
| `Inference::ExpectationViolation` | `lex-expectation-violation` | Surprise from violated predictions |
| `Inference::UncertaintyTolerance` | `lex-uncertainty-tolerance` | Tolerance for ambiguity and incomplete information |
| `Inference::RealityTesting` | `lex-reality-testing` | Tests whether beliefs match available evidence |
| `Inference::Affordance` | `lex-affordance` | Gibson affordance theory — action possibilities from environment |
| `Inference::EnactiveCognition` | `lex-enactive-cognition` | Varela/Maturana enactivism — sensorimotor loops as meaning |
| `Inference::PerceptualInference` | `lex-perceptual-inference` | Bayesian perception — sensory likelihoods + priors |
| `Inference::Coherence` | `lex-cognitive-coherence` | Belief coherence assessment and maintenance |
| `Inference::Debugging` | `lex-cognitive-debugging` | Systematic diagnosis of cognitive errors |
| `Inference::Horizon` | `lex-cognitive-horizon` | Reasoning boundary and scope management |
| `Inference::Gravity` | `lex-cognitive-gravity` | Attractor patterns in belief space |
| `Inference::Momentum` | `lex-cognitive-momentum` | Inference momentum — continuation bias in reasoning chains |
| `Inference::Magnet` | `lex-cognitive-magnet` | Magnetic pull of salient attractors |
## Actors
| Actor | Interval | What It Does |
|-------|----------|--------------|
| `Abductive::Actor::UpdateAbductiveReasoning` | Every 60s | Prunes low-probability hypotheses |
| `Affordance::Actors::Scan` | interval | Scans for available affordances in current context |
| `BeliefRevision::Actor::UpdateBeliefRevision` | Every 120s | AGM contraction on low-confidence beliefs |
| `Coherence::Actor::UpdateCognitiveCoherence` | Every 120s | Recomputes coherence scores across belief graph |
| `ExpectationViolation::Actor::DecayViolations` | Every 300s | Decays stale expectation violation records |
| `FreeEnergy::Actor::UpdateFreeEnergy` | Every 30s | Minimizes free energy — updates variational estimates |
| `Horizon::Actors::Adjust` | interval | Adjusts reasoning horizon bounds |
| `Momentum::Actor::UpdateCognitiveMomentum` | Every 60s | Decays inference momentum, updates continuation bias |
| `Prediction::Actors::ExpirePredictions` | Every 300s | Expires stale predictions |
| `PredictiveCoding::Actors::Decay` | interval | Decays precision weights in predictive coding hierarchy |
| `RealityTesting::Actor::DecayBeliefs` | Every 300s | Decays beliefs that are no longer supported by evidence |
## Installation
```ruby
gem 'lex-agentic-inference'
```
## Development
```bash
bundle install
bundle exec rspec # 2293 examples, 0 failures
bundle exec rubocop # 0 offenses
```
## License
MIT