Frags Runtime

The OSS runtime for AI-powered backend services.

Frags turns AI-powered automations into real backend services. It executes FML blueprints as typed, multi-session workflows — coordinating tools, scoped context, deterministic prework, and schema validation so a prompt becomes a service you can call.

frags · runtime

$ frags run revenue-brief.fml --llm claude
▸ loading blueprint ................. ok
▸ required tools .............. apicp:salesforce, mcp:slack
▸ session collect_accounts
    queryAccounts → 38 records
    accounts[] schema validated
▸ session identify_risk
    scoped context → accounts only
    riskFindings[] schema validated
▸ session notify_team
    chat_postMessage → #revenue
✓ complete · typed output ready for the caller
Runtime engine

Built for workflows that need more than one prompt.

Frags treats an AI workflow as a blueprint with explicit inputs, tool requirements, sessions, dependencies, and output ownership. That makes it possible to compose agentic work without giving every step the same oversized context. Where an agent framework hands you an autonomous black box and asks you to trust it, Frags hands you a typed, inspectable blueprint you can read, diff, and version — the difference between hoping it worked and knowing it did.

Multi-session orchestration

Break a complex output into focused sessions. Each session owns a slice of the schema, can depend on earlier work, and can run only when its gate passes.

Scoped context by design

Frags controls what each model sees, so downstream sessions get the useful prior output without dragging the whole workflow into every prompt.

Schema-first output

Blueprints produce machine-consumable JSON that is validated against the declared schema. The runtime is built for services, not loose chat transcripts.

Bring the tools you need

Declare MCP servers, APICP-backed APIs, collections, or custom functions. Tool use stays explicit and local to the sessions that need it.

Deterministic work outside the model

Pre-calls, lightweight transforms, and output filters handle mechanical work before and after LLM calls to reduce cost and improve reliability.

CLI and Go library

Use Frags directly from the command line while prototyping, then embed the runtime into your own services when the workflow becomes production code.

Plot twist

Does building reliable AI automations make you want to say FML?

Good news — that’s just the name of the language. FML is a programming language for instructing LLMs, running on the Frags runtime. We own the whole vertical stack — language, runtime, and tooling — so the web editor and your IDE have no limits.

FML contract

Blueprints are executable specifications.

FML is the blueprint language Frags interprets. It describes the workflow shape, not just a prompt: caller parameters, declared tools, deterministic preparation, session order, context boundaries, and the final JSON Schema.

system(...)

The shared system prompt for the blueprint

parameter(...)

Typed inputs supplied by the caller

require mcp

Declare the MCP servers, APICP APIs, and functions a blueprint may use

session(...)

A scoped LLM work unit with its own context and dependencies

use / call(...)

Tool use and deterministic pre-calls inside a session

schema { }

The typed output each session assembles

{{ ... }}

Templating across parameters and prior sessions

revenue-brief.fml

Copy
system(`You brief the revenue team before a renewal call.`)

parameter("account_id", type=string) # Salesforce account to brief.

require mcp Salesforce

session("collect_accounts") {
    use mcp Salesforce {
        allowlist = ["query"]
    }
    + Pull recent activity and open opportunities for account {{ .params.account_id }}.
    - Extract the facts that matter for a renewal conversation.
    schema {
        accounts: {
            name: string   # Account name
            stage: string  # Current opportunity stage
        }[]
    }
}

session("identify_risk", after="collect_accounts") {
    context "Accounts: {{ .context.collect_accounts.accounts }}"
    + Identify renewal-risk signals from the account facts.
    - Return the concrete risk findings for the call.
    schema {
        riskFindings: string[]
    }
}
In action

The EMA Pipeline

Whether you upload a skill or write from scratch, every Diaphora blueprint runs through three deterministic stages. Each fires a scoped LLM session with exactly the context it needs — no context rot, no bloat, typed output every time.

Blueprint Input

meetingQuery: "Acme Corp"

E

fetch-signals

prompt

Pull raw data from Calendar, Slack, and Salesforce in parallel preCalls.

GCal

Slack

Salesforce

M

build-prep

prompt

LLM session with only the signals in context. Builds structured meeting prep.

A

publish-to-notion

prompt

Final session writes the result to Notion and returns a typed schema.

Notion

Typed Schema Output

meeting_details · signals · prep_summary · notion_publish

diaphora · fetch-signals

RUNNING

E · Extract

fetch-signals

LLM Session · extract_signals

Scoped prompt: given raw data, extract only relevant signals for the meeting.

schema output →

{

title: "Acme Corp Call Prep

participants: [...]

opportunity: { stage: "Proposal" }

slack_msgs: 20 results

}

Open source

Install Frags Locally.

Frags is AGPL-licensed and fair-code distributed — the source is always visible, you can self-host it anywhere, and you can extend it with your own tools. No account required to get started.

Quick start

macOS · Homebrew

Copy
brew tap fragshq/tools
brew install fragshq/tools/frags

Windows · Scoop

Copy
scoop bucket add fragshq https://github.com/fragshq/scoop-bucket.git
scoop install frags

Prefer a raw binary? Grab the latest CLI release from GitHub, or read the full local setup guide.

License & community

Source available

The full runtime source is always visible on GitHub — read it, audit it, fork it.

Self-hostable

Run the CLI or embed the Go library on your own infrastructure — no hosted dependency required.

Extensible

Add your own nodes, tools, and MCP servers to fit blueprints to the systems you already run.

Frags is distributed under the AGPL. Need role-based access, audit trails, or support for sensitive data at scale? See Enterprise licenses.

Get support on GitHub Issues

Frags and APICP work together.

APICP narrows external APIs into clean MCP tools. Frags runs the blueprint that decides when those tools are used, how their results are transformed, and which session owns each output field.

Explore APICP