An open source framework for building and chaining multi-agent workflows in TypeScript.
Install
npm i @runeltd/hugrFeatures
Multi-agent workflows
Define agents, wire them together, and let the framework handle routing, retries, and state.
Provider agnostic
Swap between OpenAI, Anthropic, local models, or your own endpoints without changing your workflow logic.
Streaming by default
Every agent step streams output in real-time. No polling, no waiting for full completions.
Built-in guardrails
Autonomy controls, rate limit detection, and an interrupt system to keep agents in check during execution.
Tool system
Give agents access to functions, APIs, file systems, or custom tools with a simple interface.
Stateful workflows
Persist conversation history, share context between agents, and resume workflows where they left off.
Workflow presets
Choose from built-in pipelines like fast, balanced, or thorough — or define your own in YAML with per-step agent configuration.
Error recovery
Automatic retries, crash-safe persistence, and auto-resume after rate limits. Jobs pick up where they left off.
Interrupt control
Stop, redirect, or modify running agents mid-task. Built into the base agent class for human-in-the-loop workflows.
Visual agent
Give agents eyes. Let them launch browsers, take screenshots, and iterate on UI with vision-based feedback loops.
Plugin system
Publish and install reusable agent packages — custom tools, skills, and pipelines.
Observability dashboard
Trace every decision and tool call across your pipeline. Debug agent behavior with full execution timelines.
Parallel execution
Run multiple agents simultaneously across branches of a pipeline. Fan out work and merge results.
Memory layer
Give agents long-term memory that persists across sessions. Semantic search over past interactions, decisions, and outputs.
Webhooks & triggers
Kick off pipelines from external events — git pushes, API calls, cron schedules, or file changes.
Cost controls
Set token budgets per agent, per pipeline, or per run. Get alerts before spending thresholds are hit.
Custom agent SDK
Define your own agents with a simple base class, lifecycle hooks, and automatic integration into the pipeline system.
Multi-model routing
Route different pipeline steps to different models based on complexity, cost, or latency. Use a fast model for triage, a strong one for implementation.
Quick start
import {
Manager,
Joblog,
JsonlStorage,
ClaudeCodeProvider,
loadConfig,
} from '@runeltd/hugr';
const projectPath = process.cwd();
const config = await loadConfig({ projectPath, preset: 'balanced' });
const storage = new JsonlStorage('/tmp/hugr-demo');
const joblog = new Joblog({ storage });
const llm = new ClaudeCodeProvider({
projectPath,
timeout: config.provider.timeout,
maxRetries: config.provider.maxRetries,
});
const manager = new Manager({ joblog, llm, config, projectPath });
manager.on('activity', ({ type, message, agentName }) => {
console.log(`[${agentName ?? type}] ${message}`);
});
await manager.runSession({
task: 'Research the top 5 competitors and summarise their pricing models',
sessionId: 'demo-001',
});
Dashboard
Hugr includes a web-based dashboard for managing everything visually:
npx hugr-dashboardOverview
Active sessions, total sessions, registered workers, saved workflows at a glance.
Workflows
Build pipelines visually from templates or from scratch. Drag and drop workers, configure iterations, and enable/disable steps.
Sessions
Pick a workflow, describe a task, and run it. Watch live activity as workers hand off to each other. Respond to clarification questions in real time. Stop sessions mid-run.
Workers
Browse the built-in library and preset workers, or create your own with a custom name, description, system prompt, tool selection, and skill files from anywhere on your filesystem.
Triggers
Automate workflows with cron schedules, webhooks, HTTP polling, and file system watchers. 20+ built-in templates to get started.
Settings
Configure API keys for all supported providers (OpenAI, Anthropic, Gemini, Mistral, xAI, Groq, AWS Bedrock), manage your data storage path, check runtime status, and set your theme.