//! # VAPORA RLM (Recursive Language Models)
//!
//! RLM integration for VAPORA providing:
//! - Chunking strategies (Fixed, Semantic, Code-aware)
//! - Hybrid search (BM25 + Semantic + RRF fusion)
//! - Distributed sub-LLM calls for long contexts
//! - Knowledge Graph integration for learning from history
//! - Hybrid sandbox execution (WASM + Docker)
//!
//! ## Architecture
//!
//! RLM is the foundational approach for handling long contexts and distributed
//! reasoning:
//! 1. **Chunking**: Break large documents into semantic chunks
//! 2. **Storage**: Persist chunks in SurrealDB with embeddings
//! 3. **Search**: Hybrid search (semantic + BM25) via RRF fusion
//! 4. **Dispatch**: Send relevant chunks to LLM providers via vapora-llm-router
//! 5. **Execute**: Run sub-tasks in sandboxed environments (WASM/Docker)
//! 6. **Learn**: Store execution history in Knowledge Graph
//!
//! ## Usage
//!
//! ```rust,no_run
//! use vapora_rlm::{RLMEngine, storage::SurrealDBStorage, search::bm25::BM25Index};
//! use surrealdb::engine::remote::ws::Client;
//! use surrealdb::Surreal;
//! use std::sync::Arc;
//!
//! # async fn example() -> anyhow::Result<()> {
//! // Connect to SurrealDB
//! let db = Surreal::<Client>::new::<surrealdb::engine::remote::ws::Ws>("127.0.0.1:8000").await?;
//! db.use_ns("vapora").use_db("main").await?;
//!
//! // Create storage and BM25 index
//! let storage = Arc::new(SurrealDBStorage::new(db));
//! let bm25_index = Arc::new(BM25Index::new()?);
//!
//! // Create RLM engine
//! let engine = RLMEngine::new(storage, bm25_index)?;
//!
//! // Load and chunk a document
//! let chunk_count = engine.load_document("doc-1", "Large document content...", None).await?;
//! println!("Created {} chunks", chunk_count);
//!
//! // Query with hybrid search (BM25 only, no embedding yet)
//! let results = engine.query("doc-1", "find error handling patterns", None, 5).await?;
//! println!("Found {} results", results.len());
//! # Ok(())
//! # }
//! ```

pub mod chunking;
pub mod dispatch;
pub mod embeddings;
pub mod engine;
pub mod error;
pub mod metrics;
pub mod provider;
pub mod sandbox;
pub mod search;
pub mod storage;

// Re-export key types
pub use engine::{RLMEngine, RLMEngineConfig};
pub use error::{RLMError, Result};
pub use provider::{RLMProvider, RLMProviderConfig};

// Version info
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
