Pattern library for agent experience accumulation — reusable "spells" with confidence tracking and curriculum-based learning.
flux-grimoire is a Rust crate providing a spell book for FLUX agents — a structured library of reusable behavioral, cognitive, social, debugging, and optimization patterns ("spells") with confidence tracking, outcome recording, search, and curriculum-based learning with confidence gates.
The grimoire is how fleet knowledge persists and propagates:
flux-necropolisharvests lessons from dead vessels; grimoire teaches them to the livingflux-evolvediscovers successful mutations; grimoire codifies them as spellsflux-trustidentifies reliable agents; grimoire captures their strategiesflux-socialdefines mentor relationships; grimoire is the curriculumflux-dream-cycleschedules learning tasks from the grimoire curriculumflux-skillsdefines runnable skills; grimoire defines the meta-patterns behind them
| Concept | Description |
|---|---|
| Spell | A reusable pattern with trigger, action, and outcome tracking |
| PatternType | Behavioral, Cognitive, Social, Debugging, Optimization |
| Grimoire | Collection of spells with search, prune, publish/import |
| Curriculum | Ordered study plan with confidence gates (Novice → Adept → Master) |
| Feature | Description |
|---|---|
| Spell Learning | learn() records a spell with trigger/action/outcome metadata |
| Outcome Tracking | record_outcome() updates confidence on success/failure |
| Confidence Scoring | Automatic confidence calculation from success rate |
| Search & Prune | Find spells by name/pattern; remove low-confidence spells |
| Curriculum System | 3-level learning path with confidence gates |
| Publish/Import | Share spells between grimoires (inter-agent knowledge transfer) |
use flux_grimoire::{spell::{Spell, PatternType}, grimoire::Grimoire, curriculum::{Curriculum, Level}};
let mut g = Grimoire::new();
// Learn a spell from experience
g.learn("panic-1", "Don't panic", PatternType::Behavioral,
"error", "breathe", "always", "me");
// Record outcome to build confidence
g.record_outcome("panic-1", true); // success
assert_eq!(g.find("panic-1").unwrap().confidence(), 1.0);
// Build curriculum
let mut curriculum = Curriculum::new();
curriculum.add("panic-1", Level::Novice);
curriculum.add("async-debug", Level::Adept);
curriculum.add("fleet-coord", Level::Master);cargo build
cargo testflux-necropolis— Posthumous lesson harvestingflux-evolve— Behavioral evolutionflux-trust— Trust-based spell validationflux-social— Mentorship relationshipsflux-skills— Runnable FLUX skillsflux-dream-cycle— Learning task scheduling
Part of the SuperInstance FLUX fleet.