Fabro Documentation

repository·main·Indexed 23 days ago

https://github.com/fabro-sh/fabro

An open-source 'dark software factory' for expert engineers to manage AI coding agents. Fabro enables the definition of complex, multi-step agentic processes as deterministic workflow graphs with human-in-the-loop gates, multi-model routing, and sandboxed execution. The project includes the fabro-agent crate for programmable agentic loops and a Split Web Compose PoC architecture featuring a Rust API server (fabro-api) and a React SPA (fabro-web).

Tokens
487.3K
Snippets
814
Records
2.7K
Agent score
80%

What's inside Fabro

  1. Overview of Fabro CLI subcommands

    main

    The fabro CLI is the primary interface for managing workflow runs, interacting with agents, and managing authentication. Key categories of commands include:

    • Workflow Lifecycle: create, run, start, resume, rewind, fork, rm, wait.
    • Inspection & Debugging: inspect, logs, events, artifact, graph, doctor, dump, ask.
    • Human-in-the-loop: approve, deny, steer.
    • System & Auth: auth, install, upgrade, version, settings, completion.
    • Environment & Sandbox: sandbox, secret, variable, provider.
  2. What is Fabro?

    main

    Fabro is an open-source software factory designed for small teams of expert engineers. It replaces the traditional 'prompt-wait-review' loop with version-controlled workflow graphs. These graphs orchestrate AI agents, shell commands, and human decisions into repeatable, long-horizon coding processes.

    Key capabilities include:

    • Orchestration: Combining AI agents, shell commands, and human gates into automated workflows.
    • Ensemble Intelligence: Using multiple models from different vendors within a single workflow (e.g., one for implementation, one for critique).
    • Verification: Layering deterministic checks like test suites, linters, and type checkers into the workflow to trigger automatic fix loops on failure.
    • Scalability: Running agents 24/7 in cloud sandboxes via an API server that queues and executes runs continuously.
    • Security: Executing untrusted code in isolated cloud sandboxes with network and filesystem isolation.
    • Observability: Inspecting runs through durable event streams, checkpoints, and stage outputs.
  3. Overview of Fabro Rust SDK entry points

    main

    Fabro provides two primary Rust crates for building AI-driven applications:

    • fabro-agent: A full AI coding agent. It includes tool use (shell, file I/O, web search, etc.), sandboxed execution, event streaming, and context management. Use this to build agents that interact with codebases and run commands.
    • fabro-llm: A standalone LLM client. It provides direct control over multi-provider completions, streaming, and tool execution loops without the higher-level agent orchestration.

    Both crates can be used independently of the Fabro workflow engine.

  4. What is fabro-workflow?

    main

    fabro-workflow is a DOT-based pipeline runner designed for multi-stage AI workflows. It allows you to define complex workflows using Graphviz digraph syntax.

    Key features include:

    • Pluggable Handlers: Execute different types of nodes (agents, prompts, human gates, etc.).
    • Conditional Routing: Use edge attributes to control workflow flow based on node outcomes.
    • Human-in-the-Loop: Pause execution for human input using specific node shapes.
    • Parallel Execution: Fan out tasks concurrently with isolated context forks.
    • Checkpointing: Save state after every node to allow for crash recovery and resuming.
    • Model Stylesheets: Use CSS-like selectors to assign specific LLM models to different parts of the graph.
  5. Overview of fabro-llm

    main

    fabro-llm is an asynchronous Rust client library that provides a unified interface for multiple LLM providers like Anthropic, OpenAI, and Google Gemini. It allows you to write LLM integration code once and switch providers without changing application logic.

    Core Abstractions

    • Client: The main entry point that routes requests to registered provider adapters. It can be initialized using a CredentialSource or explicit credentials.
    • ProviderAdapter: A trait implemented by each provider (e.g., AnthropicAdapter, OpenAiAdapter, GeminiAdapter, OpenAiCompatibleAdapter) to handle specific API implementations.
    • Middleware: Components that intercept requests and responses for tasks like logging, caching, or transformation. They support both blocking and streaming paths.
    • generate(): A high-level function that wraps Client.complete() and manages automatic tool execution loops, retries, timeouts, and cancellation.
    • Tool: Can be Active (includes an execution handler that runs automatically in the tool loop) or Passive (no handler, surfaces tool calls back to the caller).
  6. Understand the Fabro product surface

    main

    Fabro is an open-source, self-hosted workflow orchestration layer designed for expert engineers. The product consists of several key components that work together to define, execute, and monitor workflows:

    • CLI: Used for defining and running workflows.
    • API Server: Started via fabro server start to provide programmatic access.
    • React Web App: A monitoring interface for inspecting workflows and observing runs.
    • Documentation & Examples: A site containing documentation and example workflows for implementation guidance.
  7. Project Architecture: Refactored Engineering Patterns

    main

    The project is organized into several specialized crates to support high-reliability engineering patterns:

    CratePurpose
    fabro-staticCentralized EnvVars registry for all FABRO_* and upstream constants.
    fabro-redactRedaction utilities, including DisplaySafeUrl for credential protection.
    fabro-testTesting utilities, including fabro_json_snapshot! for JSON value snapshots.
    fabro-options-metadataRuntime metadata for command-line options and arguments.
    fabro-macrosProcedural macros like #[derive(OptionsMetadata)].
    fabro-devA unified developer CLI (via clap) containing commands like check_boundary, docker_build, and release.
  8. Overview of the Fabro MCP Server Architecture

    main

    The Fabro MCP server is implemented as a dedicated Rust crate (fabro-mcp-server) and is exposed through the fabro-cli.

    Key architectural details:

    • Transport: Uses rmcp 1.3 with stdio transport for protocol correctness.
    • Connectivity: Connects lazily to the Fabro API using settings derived from the same CLI auth/config inputs used by standard Fabro commands.
    • Tooling: Provides first-class tools for managing Fabro runs (create/start, search, interact, gather, and events).
    • Output: Returns structured MCP tool results with text fallbacks for error handling.
    • Separation of Concerns: The fabro-mcp-server crate handles the MCP service and tool semantics, while fabro-cli handles command-line parsing and dispatch.
  9. Use ServerTarget for canonical HTTP URLs

    main

    When specifying a server target, ServerTarget::from_url automatically applies HTTP canonicalization to ensure consistent addressing. This prevents duplicate entries in the AuthStore caused by minor URL variations.

    Canonicalization includes:

    • Lowercasing the scheme (e.g., HTTPS -> https)
    • Lowercasing the host
    • Stripping default ports (e.g., :443 for https, :80 for http)
    • Stripping trailing slashes
    • Stripping the /api/v1 suffix
    • Rebuilding the authority as {scheme}://{host}[:{port}]