vex_core/
lib.rs

1//! # VEX Core
2//!
3//! Core types for the VEX protocol — adversarial, temporal, cryptographically-verified AI agents.
4//!
5//! ## Key Types
6//!
7//! - [`Agent`] — Fractal agent with evolutionary capabilities
8//! - [`ContextPacket`] — Time-aware, hashable context unit
9//! - [`MerkleTree`] — Cryptographic verification of context hierarchies
10//! - [`Genome`] — Evolutionary traits that map to LLM parameters
11//!
12//! ## Quick Start
13//!
14//! ```rust
15//! use vex_core::{Agent, AgentConfig};
16//!
17//! // Create an agent
18//! let agent = Agent::new(AgentConfig {
19//!     name: "Researcher".to_string(),
20//!     role: "You are a helpful research assistant".to_string(),
21//!     max_depth: 3,
22//!     spawn_shadow: true,
23//! });
24//!
25//! // Spawn a child agent
26//! let child = agent.spawn_child(AgentConfig {
27//!     name: "Specialist".to_string(),
28//!     role: "You analyze data".to_string(),
29//!     max_depth: 2,
30//!     spawn_shadow: false,
31//! });
32//! ```
33//!
34//! ## Merkle Verification
35//!
36//! ```rust
37//! use vex_core::{MerkleTree, Hash};
38//!
39//! // Build a Merkle tree from context hashes
40//! let leaves = vec![
41//!     ("ctx1".to_string(), Hash::digest(b"context 1")),
42//!     ("ctx2".to_string(), Hash::digest(b"context 2")),
43//! ];
44//! let tree = MerkleTree::from_leaves(leaves);
45//!
46//! // Verify integrity
47//! assert!(tree.root_hash().is_some());
48//! ```
49
50pub mod agent;
51pub mod context;
52pub mod evolution;
53pub mod evolution_memory;
54pub mod fitness;
55pub mod genome_experiment;
56pub mod merkle;
57pub mod rule;
58
59pub use agent::{Agent, AgentConfig, AgentHandle, AgentId};
60pub use context::{CompressionLevel, ContextPacket};
61pub use evolution::{
62    tournament_select, Fitness, GeneticOperator, Genome, LlmParams, StandardOperator,
63};
64pub use evolution_memory::{EvolutionMemory, TraitAdjustment};
65pub use fitness::{EvaluationContext, FitnessEvaluator, FitnessReport, HeuristicEvaluator};
66pub use genome_experiment::GenomeExperiment;
67pub use merkle::{Hash, MerkleNode, MerkleTree};
68pub use rule::OptimizationRule;