Flue: Headless, Programmable AI Agent Framework from the Astro Team
Flue is an open-source TypeScript framework for building AI agents, developed by the Astro team. It was originally built to automate AI workflows inside Astro's own GitHub repositories. Its design is headless and programmable: agents can run without a human present, triggered by API calls, webhooks, or cron jobs, and deployable to Node.js or Cloudflare Workers.
The harness concept
Flue's documentation defines an AI agent as an LLM running inside a harness. The LLM provides reasoning capability; the harness provides the tools, context, memory, and environment the LLM needs to interact with external systems and complete tasks.
Without a harness, an LLM responds to individual API calls with no persistent state and no tool access. Flue is the programmable harness layer: it provides session management, tool and skill execution, sandbox environments, and a structured output format.
Installation and setup
Create a .env file with your LLM provider API key:
Initialize the project configuration:
This creates flue.config.ts:
target can be 'node' (Node.js server using Hono) or 'cloudflare' (Cloudflare Worker with Durable Objects for persistence).
Creating an agent
Flue looks for agent definitions in an agents/ directory. The filename becomes the agent's ID.
Connect to the agent interactively:
local-session is the instance ID. It identifies this conversation and enables session persistence across interactions.
After the agent responds, Flue prints a JSON summary:
The output includes text (full response), usage (input and output token counts), cost (estimated API cost broken down by input, output, and cache), and model (the model ID used).
Building a workflow with a skill
Workflows perform a finite unit of work from input to result. They live in a workflows/ directory and export a run function.
A skill is a Markdown file containing instructions for the LLM on how to perform a specific reusable task. Flue imports it as structured context.
Sandboxes
The default sandbox is just-bash: an in-memory TypeScript reimplementation of a Bash shell. It requires no Docker container or virtual machine, making it fast and cheap for agents that do not need filesystem access.
For workflows that need to read local files or run external scripts, the local sandbox provides direct filesystem access:
sandbox: local() replaces the in-memory sandbox with the local machine's filesystem. This is less isolated but necessary when the agent needs to read files or execute local scripts.
Exposing a workflow as an HTTP endpoint
Add a route handler to the workflow file:
Build the server:
This produces dist/server.mjs.
Trigger the workflow:
The server responds immediately with a runId:
Poll for the result:
Final thoughts
Flue's sandbox design is its most practically useful feature for cost management. The default just-bash in-memory sandbox means most agents incur no infrastructure cost beyond the API call itself. The local() sandbox is an explicit opt-in for cases that require it, keeping the default path cheap and fast.
The createAgent + SKILL.md + run function pattern is low-ceremony. Most of the agent's behavior is defined in Markdown rather than code, which makes it easy to adjust instructions without restructuring the application.
For teams using Astro who want headless AI agent capabilities without building their own orchestration layer, Flue is a natural fit. For teams on other stacks, the same principles apply; the main consideration is whether deploying to Node.js or Cloudflare Workers fits the existing infrastructure.
Documentation and source code are at github.com/floatplane/flue.