This directory contains working examples showing how to use SuperInstance ecosystem tools together.
These examples demonstrate real-world integrations of the 8 ecosystem tools:
- privox - Privacy redaction
- tripartite-rs - Multi-agent consensus
- knowledge-vault - Vector RAG system
- hwscan - Hardware detection
- model-registry - ML model version management
- token-vault - Secure token storage
- quicunnel - QUIC tunnel
- usemeter - Usage tracking & billing
integration-examples/
├── cli/ # Command-line tools
├── web/ # Web service examples
├── lib/ # Library integration examples
├── Cargo.toml # Workspace configuration
└── README.md # This file
- Rust 1.75 or later
- All 8 ecosystem crates available (local path or crates.io)
# From workspace root
cd integration-examples
cargo build --releaseRedact PII from text using privox.
# From stdin
echo "My email is john@example.com" | cargo run --bin basic_redactor
# From file
cargo run --bin basic_redactor -- --file input.txt
# Show what was redacted
cargo run --bin basic_redactor -- --revealExpected output:
My email is [REDACTED]
Run multi-agent consensus on a query.
cargo run --bin consensus_app -- "What is 2 + 2?"Expected output:
🤖 Starting consensus process
📝 Query: What is 2 + 2?
✅ Consensus process completed!
📊 Outcome:
Verdict: CONSENSUS REACHED
Rounds: 1
Duration: 312ms
Intent: Intent analysis of: What is 2 + 2?
Logic: Logical reasoning about: What is 2 + 2?
Truth: Fact check for: What is 2 + 2?
Confidence: 0.95
Semantic search using knowledge-vault.
cargo run --bin knowledge_search -- "async programming"Expected output:
🔍 Searching vault: ./vault.db
📝 Query: async programming
✅ Found 2 results:
1. Async Rust (score: 0.89)
Rust's async/await syntax provides ergonomic asynchronous programming...
2. Vector Search (score: 0.72)
Vector databases enable semantic search...
Display hardware capabilities.
cargo run --bin hw_info
# JSON output
cargo run --bin hw_info -- --format json
# Show recommended model
cargo run --bin hw_info -- --modelExpected output:
🖥️ Scanning hardware...
📊 Hardware Report
══════════════════
CPU:
Model: Intel Core i7-12700K
Cores: 12 physical, 20 logical
Frequency: 3.60 GHz
SIMD: ["AVX2", "AVX512"]
Score: 7
GPU:
Model: NVIDIA GeForce RTX 3080
VRAM: 10.0 GB
Compute: Some(8.6)
Score: 8
RAM:
Total: 32.00 GB
Available: 24.50 GB
Score: 5
══════════════════
📈 Overall Tier: Performance (score: 7)
REST API for PII redaction.
# Start server
cargo run --bin redaction_api
# In another terminal, test it
curl -X POST http://localhost:8080/redact \
-H "Content-Type: application/json" \
-d '{"text": "Contact john@example.com or 555-123-4567"}'Expected response:
{
"original": "Contact john@example.com or 555-123-4567",
"redacted": "Contact [REDACTED] or [REDACTED]",
"patterns_found": ["email", "phone"]
}WebSocket service for consensus.
# Start server
cargo run --bin consensus_ws
# Connect with websocat or websocket client
websocat ws://localhost:8081/wsThen type your query:
What is the capital of France?
Expected response:
Processing: What is the capital of France?
✅ Consensus: true (confidence: 0.90)
Semantic search REST API.
# Start server
cargo run --bin search_api
# Search
curl -X POST http://localhost:8082/search \
-H "Content-Type: application/json" \
-d '{"query": "async rust", "limit": 3}'Expected response:
{
"query": "async rust",
"count": 2,
"results": [
{
"title": "Async Rust",
"content": "Rust's async/await syntax...",
"score": 0.89
}
]
}Combine knowledge-vault + privox for privacy-preserving RAG.
use integration_examples::secure_rag::SecureRagEngine;
async fn example() -> anyhow::Result<()> {
let engine = SecureRagEngine::new("./vault.db").await?;
// Search with automatic PII redaction
let results = engine.search_safe("customer support", 5, 0.7).await?;
for doc in results {
println!("{}: {}", doc.title, doc.content);
// Content has PII already redacted!
}
Ok(())
}Combine tripartite-rs + privox for multi-agent privacy analysis.
use integration_examples::consensus_redact::ConsensusRedactor;
async fn example() -> anyhow::Result<()> {
let redactor = ConsensusRedactor::new();
let text = "Contact John at john@example.com or 555-123-4567";
let analysis = redactor.analyze(text).await?;
if analysis.consensus_reached {
println!("All agents agree on PII detection");
println!("Redacted: {}", analysis.redacted);
}
Ok(())
}Combine hwscan + model-registry.
use integration_examples::hw_model_select::ModelSelector;
fn example() -> anyhow::Result<()> {
let selector = ModelSelector::new();
let recommendation = selector.select_best_model();
println!("Recommended model: {}", recommendation.model);
println!("Reasoning: {}", recommendation.reasoning);
Ok(())
}# Test all examples
cargo test
# Test specific example
cargo test --lib secure_rag
# Run with output
cargo test -- --nocaptureFor more integration guides, see:
- Integration Guide - How to integrate tools
- Integration Patterns - Common patterns
- Workflows - Step-by-step workflows
- Troubleshooting - Common issues
[dependencies]
privox = { path = "../privox" }
knowledge-vault = { path = "../knowledge-vault" }
# Add more as neededuse privox::Redactor;
use knowledge_vault::Vault;async fn my_integration() -> Result<(), Error> {
// Create instances
let mut redactor = Redactor::new();
let vault = Vault::new("./vault.db", config).await?;
// Use them together
let results = vault.search("query", 5, 0.7).await?;
for doc in results {
let safe = redactor.redact(&doc.content);
println!("{}", safe);
}
Ok(())
}// Tool 1 output -> Tool 2 input
let results = tool1.process(input).await?;
let output = tool2.process(results).await?;// Run tools concurrently
let (result1, result2) = tokio::join!(
tool1.process(input),
tool2.process(input)
);// Try tool1, fallback to tool2
match tool1.process(input).await {
Ok(result) => Ok(result),
Err(_) => tool2.process(input).await,
}Solution: Make sure you're running from the workspace root and paths are correct.
Solution: Use separate vault instances per thread/task.
Solution: Lower threshold or increase max_rounds in config.
See troubleshooting guide for more solutions.
To add a new example:
- Create file in appropriate directory (cli/, web/, lib/)
- Add to Cargo.toml [[bin]] or [[lib]] section
- Add documentation
- Test thoroughly
- Update this README
MIT OR Apache-2.0