Persistent Project Context for Rust. cargo add faf and you're in.
FAF defines. MD instructs. AI codes.
One crate, full ecosystem. Parse, validate, compile, and broadcast .faf files in Rust.
FAF (Foundational AI-context Format) is the IANA-registered format for persistent AI project context (application/vnd.faf+yaml). This meta-crate re-exports everything you need.
cargo add fafWith Radio Protocol + Axum middleware:
cargo add faf --features radio,axumuse faf::{parse, binary};
let yaml = std::fs::read_to_string("project.faf")?;
// Parse
let doc = parse(&yaml)?;
println!("{} — {}% AI-ready", doc.project_name(), doc.score().unwrap_or(0));
// Compile to FAFb binary
let fafb = binary::compile(&yaml)?;
println!("{} bytes YAML → {} bytes FAFb", yaml.len(), fafb.len());| Feature | Default | Crate | What you get |
|---|---|---|---|
sdk |
yes | faf-rust-sdk | Parse, validate, compile, FAFb binary format |
radio |
no | faf-radio-rust | Radio Protocol — broadcast AI context via WebSocket |
axum |
no | faf-rust-sdk/axum | FafContext extractor + FafLayer middleware |
Broadcast AI context once, every tool receives:
use faf::faf_radio_rust::{RadioClient, RadioConfig};
let mut client = RadioClient::new(RadioConfig::grok());
client.connect().await?;
client.tune(vec!["91.0".into()]).await?;
// Broadcast metadata on a frequency
client.broadcast("91.0", serde_json::json!({
"type": "fafb",
"project": "my-app",
"size": 220,
})).await?;Inject .faf project context into every request:
use faf::{FafLayer, FafContext};
let app = Router::new()
.route("/", get(handler))
.layer(FafLayer::discover());
async fn handler(faf: FafContext) -> String {
format!("Project: {}", faf.project_name())
}| Crate | Version | What |
|---|---|---|
faf |
0.3.0 | This meta-crate |
faf-rust-sdk |
1.3.0 | Core SDK — parse, validate, compile, FAFb |
faf-radio-rust |
0.2.0 | Radio Protocol client |
rust-faf-mcp |
0.1.0 | MCP server for .faf |
Also available in TypeScript, Python, and Zig.
- Website: faf.one
- IANA: application/vnd.faf+yaml
- Docs: docs.rs/faf
- Platform: mcpaas.live
MIT
Built by Wolfe James | faf.one