-
Notifications
You must be signed in to change notification settings - Fork 35
Quick Start
rUv edited this page Jul 31, 2025
·
1 revision
Get up and running with FACT in 5 minutes! This guide covers the fastest path to using FACT across different platforms.
- Python Quick Start - Financial data analysis
- Rust Quick Start - High-performance processing
- JavaScript Quick Start - Browser/Node.js integration
# Install with pip
pip install fact-system
# Or clone and install
git clone https://github.com/ruvnet/FACT.git
cd FACT
pip install -r requirements.txt# Create .env file
cp .env.template .env
# Edit .env and add your keys
ANTHROPIC_API_KEY=your-anthropic-key
ARCADE_API_KEY=your-arcade-key# Initialize the system
python main.py init
# Start interactive mode
python main.py
# Try your first query
💬 > What companies are in the technology sector?from src.core.driver import get_driver
import asyncio
async def main():
# Initialize FACT
driver = await get_driver()
# Process a query
response = await driver.process_query("What is TechCorp's revenue?")
print(response)
asyncio.run(main())# Install from crates.io
cargo install fact-tools
# Verify installation
fact --version# Initialize config
fact init
# This creates fact.json
{
"cache": {
"max_size": 10000,
"ttl_seconds": 3600
},
"templates": {
"default": "analysis-basic"
}
}# Create sample data
echo '{"values": [1, 2, 3, 4, 5], "operation": "analyze"}' > data.json
# Process with FACT
fact process data.json --template analysis-basic
# Output shows statistical analysis
{
"sum": 15,
"average": 3.0,
"min": 1,
"max": 5,
"count": 5
}use fact_tools::{Fact, Template};
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create FACT instance
let fact = Fact::new();
// Process data with template
let data = json!({
"values": vec![10, 20, 30, 40, 50],
"operation": "analyze"
});
let result = fact.process(data, "analysis-basic").await?;
println!("Result: {:?}", result);
Ok(())
}# Coming soon - NPM package
npm install fact-wasm
# Or use CDN
<script src="https://unpkg.com/fact-wasm/fact.js"></script><!DOCTYPE html>
<html>
<head>
<title>FACT Quick Start</title>
</head>
<body>
<h1>FACT Demo</h1>
<button id="process">Process Data</button>
<div id="result"></div>
<script type="module">
import init, { FastCache, QueryProcessor } from './fact_wasm.js';
async function main() {
// Initialize WASM
await init();
// Create cache
const cache = new FastCache(1000);
// Create processor
const processor = new QueryProcessor();
// Process on button click
document.getElementById('process').addEventListener('click', () => {
const data = { values: [1, 2, 3, 4, 5] };
const result = processor.analyze(JSON.stringify(data));
document.getElementById('result').textContent = result;
});
}
main();
</script>
</body>
</html>// fact-demo.js
const { FastCache, QueryProcessor } = require('fact-wasm');
async function main() {
// Create cache instance
const cache = new FastCache(1000);
// Cache some data
cache.set('key1', 'value1', 300); // TTL: 300 seconds
// Retrieve data
const value = cache.get('key1');
console.log('Cached value:', value);
// Process query
const processor = new QueryProcessor();
const result = processor.process(
JSON.stringify({ query: "analyze data" })
);
console.log('Result:', result);
}
main();# Analyze quarterly revenue
response = await driver.process_query(
"Compare Q1 2025 revenue across all technology companies"
)
# Get specific metrics
response = await driver.process_query(
"What is the average profit margin in the healthcare sector?"
)# Batch process financial records
fact process financial-data.json \
--template data-aggregation \
--output summary.json
# Benchmark performance
fact benchmark --operations 10000// Real-time data processing
const processor = new QueryProcessor();
const cache = new FastCache(5000);
// Process streaming data
websocket.on('data', (data) => {
const cached = cache.get(data.id);
if (!cached) {
const result = processor.process(data);
cache.set(data.id, result, 600);
updateUI(result);
}
});📊 Response:
Found 3 technology companies:
1. TechCorp - Revenue: $5.2B (Q1 2025)
2. DataSoft - Revenue: $2.8B (Q1 2025)
3. CloudNet - Revenue: $3.1B (Q1 2025)
Average Q1 Revenue: $3.7B
Growth vs Q4 2024: +12.5%
{
"status": "success",
"processing_time_ms": 25,
"cache_hit": true,
"result": {
"aggregation": {
"total": 150000,
"average": 3000,
"count": 50
},
"patterns": ["increasing_trend", "seasonal_variation"],
"confidence": 0.95
}
}{
hits: 8523,
misses: 1477,
hitRate: 0.852,
evictions: 234,
memoryUsage: "2.3 MB",
avgResponseTime: "0.5 ms"
}- Installation Guide - Detailed setup instructions
- CLI Reference - Command-line options
- API Reference - Complete API documentation
- Examples - More code examples
- GitHub Issues - Report bugs or request features
- Discussions - Ask questions and share ideas
- Contributing - Help improve FACT
- Enable Caching - Dramatically improves response times
- Use Templates - Pre-optimized for common operations
- Batch Operations - Process multiple items together
- Monitor Metrics - Track cache hit rates and response times
You're now ready to use FACT for high-performance data processing. Choose your platform and start building amazing applications!
Need help? Check the troubleshooting guide or open an issue.