Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

naaf - Not Another Agent Framework

naaf is a strongly typed Rust library for building asynchronous LLM workflows out of retrying steps. It provides composable, type-safe building blocks for workflows that plan, validate, repair, and rerun.

Core Philosophy

Every workflow follows the core loop: run a task, validate the output, and if validation fails, repair the input and try again. Steps compose sequentially, in parallel, or as dynamic graphs — all with full tracing support.

Status

naaf is early-stage. APIs may change between releases.

Features

  • Type-safe workflows — Your Rust types flow through the entire pipeline. No stringly-typed dictionaries.
  • Composable steps — Sequential, parallel, and dynamic graph composition.
  • Built-in retry — Task-check-repair loop with configurable retry policies.
  • Observability — Full tracing support for debugging and monitoring.
  • Multiple backends — LLM integration (OpenAI, Anthropic), shell commands, and vector databases.

Crates

CrateDescription
naaf-coreCore traits, Step builder, Workflow runtime
naaf-llmLLM-backed adapters, tool calling
naaf-processShell-command adapters
naaf-qdrantQdrant vector database integration
naaf-knowledgeKnowledge orchestration
naaf-tuiTerminal UI for workflow observation
naaf-persistence-fsFilesystem checkpoint persistence
naaf-persistence-sqliteSQLite checkpoint persistence
naaf-cliCLI for knowledge base operations

Quick Example

#![allow(unused)]
fn main() {
use naaf_core::{Check, RetryPolicy, Step, Task};

// Define your domain types
struct GeneratePatch;
struct CargoTest;
struct RepairPatch;

// Build a step with validation and automatic repair
let step = Step::builder(GeneratePatch)
    .validate(CargoTest)
    .repair_with(RepairPatch)
    .retry_policy(RetryPolicy::new(3))
    .build();

// Run the step
let result = step.run(&runtime, prompt).await?;
}

Next Steps