| Crates.io | fact-tools |
| lib.rs | fact-tools |
| version | 1.0.0 |
| created_at | 2025-07-31 20:18:20.18326+00 |
| updated_at | 2025-07-31 20:18:20.18326+00 |
| description | FACT (Fast Augmented Context Tools) - High-performance context processing engine for AI applications |
| homepage | https://github.com/ruvnet/FACT |
| repository | https://github.com/ruvnet/FACT |
| max_upload_size | |
| id | 1775672 |
| size | 135,855 |
FACT (Fast Augmented Context Tools) is a high-performance context processing engine for Rust, designed for AI applications that require intelligent caching, cognitive templates, and blazing-fast data transformation.
Add FACT to your Cargo.toml:
[dependencies]
fact-tools = "1.0.0"
Or install the CLI tool:
cargo install fact-tools
use fact_tools::{Fact, Template};
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new FACT engine
let fact = Fact::new();
// Process data with a built-in template
let data = json!({
"values": [1, 2, 3, 4, 5],
"operation": "analyze"
});
let result = fact.process("analysis-basic", data).await?;
println!("Result: {}", result);
// Check cache performance
let stats = fact.cache_stats();
println!("Cache hit rate: {:.2}%", stats.hit_rate * 100.0);
Ok(())
}
# Initialize FACT configuration
fact-tools init
# Process data with a template
fact-tools process --template analysis-basic --input data.json
# List available templates
fact-tools templates --detailed
# Run performance benchmark
fact-tools benchmark --iterations 1000 --template quick-transform
# Show cache statistics
fact-tools cache
FACT comes with several pre-configured templates:
use fact_tools::{TemplateBuilder, ProcessingStep, Operation, Transform};
let template = TemplateBuilder::new("my-template")
.name("My Custom Template")
.description("Processes data in a custom way")
.add_tag("custom")
.add_step(ProcessingStep {
name: "normalize".to_string(),
operation: Operation::Transform(Transform::Normalize),
})
.build();
FACT is designed for high-performance scenarios:
Run benchmarks to test on your system:
fact benchmark --iterations 10000
use fact_tools::{Fact, FactConfig};
use std::time::Duration;
let config = FactConfig {
cache_size: 200 * 1024 * 1024, // 200MB cache
timeout: Some(Duration::from_secs(60)),
enable_monitoring: true,
..Default::default()
};
let fact = Fact::with_config(config);
use futures::stream::{self, StreamExt};
let items = vec![data1, data2, data3];
let results: Vec<_> = stream::iter(items)
.map(|data| fact.process("analysis-basic", data))
.buffer_unordered(4)
.collect()
.await;
FACT is designed to work seamlessly with AI and LLM applications:
// Use FACT as a preprocessing layer for LLM input
let processed = fact.process("pattern-detection", raw_data).await?;
let llm_input = format!("Analyze this processed data: {}", processed);
// Cache LLM responses with FACT
let cache_key = "llm_response_xyz";
if let Some(cached) = fact.get_cached(cache_key) {
return Ok(cached);
}
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
FACT (Fast Augmented Context Tools) is designed to revolutionize how AI applications handle context and caching, providing a fast, efficient alternative to traditional RAG systems.