Skip to content

Commit 6bbb99d

Browse files
author
Daniel
committed
2 parents ecee05b + 871289e commit 6bbb99d

1 file changed

Lines changed: 77 additions & 172 deletions

File tree

README.md

Lines changed: 77 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -1,176 +1,88 @@
11
# edge-agents
22

3-
**The open-source runtime for embedded and edge AI agents.**
3+
**The 15 MB open-source AI agent runtime for edge devices.**
44

55
![edge-agents demo](docs/assets/hero.gif)
66

77
[![CI](https://github.com/ForestHubAI/edge-agents/actions/workflows/ci.yml/badge.svg)](https://github.com/ForestHubAI/edge-agents/actions/workflows/ci.yml)
88
[![Go Reference](https://pkg.go.dev/badge/github.com/ForestHubAI/edge-agents/go.svg)](https://pkg.go.dev/github.com/ForestHubAI/edge-agents/go)
99
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](LICENSE)
1010

11-
`edge-agents` is the open-source core of the [ForestHub](https://foresthub.ai)
12-
platform. It contains the Go runtime engine, a multi-provider LLM proxy with
13-
first-class support for on-device small language models, the OpenAPI contracts
14-
that define every wire format, and the React-based visual workflow builder.
15-
The hosted multi-tenant control plane is a separate commercial product and is
16-
not in this repository.
11+
Offline by default. GPIO, MQTT, OPC-UA as first-class nodes. Local SLMs alongside cloud LLMs in the same workflow.
1712

18-
> Status: `go/v1.0.1`. Runtime is in production use; contract and TypeScript
19-
> APIs may still move. Open an issue before larger changes.
13+
> Today's AI agents live in datacenters. The interesting workloads — sensors, machines, vehicles, gateways — live everywhere else. **edge-agents** brings the agent paradigm to the devices that interact with the real world: small enough to run on a Pi 5, capable enough to drive an industrial controller, with hardware I/O as native primitives instead of REST shims.
2014
21-
## Features
15+
## What you can build
2216

23-
- **Workflow engine** — graph runtime as a state machine; nodes for LLM
24-
calls, hardware I/O, MQTT, web search, memory, control flow, and
25-
expressions.
26-
- **Cloud LLM proxy** — Anthropic, OpenAI, Google Gemini, Mistral. Provider
27-
dispatched implicitly from the model id.
28-
- **Local SLM provider** — typed multi-endpoint registry for on-device small
29-
language models served by `llama.cpp`, `vLLM`, `Ollama`, or any
30-
OpenAI-compatible endpoint, with capability-based routing
31-
(`chat` / `embedding` / `classification` / …).
32-
- **Visual builder** — React Flow canvas with typed nodes, ports, and live
33-
validation, embeddable as a component or runnable via the bundled SPA.
34-
- **Hardware nodes** — GPIO, ADC, DAC, PWM, UART/serial via native Linux
35-
drivers; digital and analog signal types are first-class in the contract.
36-
- **Standalone mode** — engine boots and runs workflows with no backend,
37-
no account, and no outbound calls beyond LLM provider APIs.
38-
- **Contract-typed wire format** — every API generated from `contract/*.yaml`
39-
in both Go and TypeScript; CI fails on drift.
40-
- **Distroless multi-arch container**`linux/amd64` and `linux/arm64`,
41-
nonroot, ~15 MB.
42-
43-
## Contents
17+
- **Voice assistant on a Pi with a local SLM** — wake-word → STT → agent → TTS, no internet required
18+
- **Predictive maintenance on industrial gear** — live OPC-UA vibration stream → LLM decides → MQTT alert
19+
- **Local RAG on a Jetson** — agent answers grounded in live sensor and machine state, not the public web
4420

45-
| Path | What it contains |
46-
| --- | --- |
47-
| [`contract/`](contract) | OpenAPI 3.0.3 schemas — single source of truth for Go and TS. |
48-
| [`go/`](go) | Engine binary, LLM proxy, hardware drivers, MQTT transport. Module `github.com/ForestHubAI/edge-agents/go`, Go 1.25. |
49-
| [`ts/workflow-core`](ts/workflow-core) | `@foresthubai/workflow-core` — headless workflow model, validation, (de)serialization. No React. |
50-
| [`ts/workflow-builder`](ts/workflow-builder) | `@foresthubai/workflow-builder` — React canvas component. |
51-
| [`ts/app`](ts/app) | Reference SPA + `fh-builder` CLI. Not published. |
52-
| [`skills/`](skills) | Claude Code skill wrapping the workflow CLI. |
21+
See [`examples/`](examples) for runnable workflows.
5322

54-
Go and TypeScript are independently buildable. Only `contract/` edits touch
55-
both sides.
23+
## edge-agents vs other agent frameworks
5624

57-
## Quickstart
25+
| | edge-agents | n8n | LangGraph | Dify | OpenClaw |
26+
|---|---|---|---|---|---|
27+
| **Runtime size** | 15 MB container | ~500 MB Docker | Python library | ~500 MB Docker | ~1 GB Docker |
28+
| **Offline by default** ||| depends on host || ❌ datacenter-only |
29+
| **Hardware I/O (GPIO, UART, ADC) as nodes** | ✅ first-class |||||
30+
| **On-device SLM provider** | ✅ typed multi-endpoint || partial via libs |||
31+
| **MQTT as workflow transport** | ✅ first-class | community node ||||
32+
| **Visual builder** ||| ❌ code-only |||
33+
| **Industrial protocols** (OPC-UA, Modbus) | on roadmap | community nodes ||||
5834

59-
### Engine (Docker)
35+
## Quickstart
6036

6137
```sh
6238
docker run --rm -p 8081:8081 \
6339
-e ENGINE_STANDALONE=true \
6440
ghcr.io/foresthubai/edge-agents/engine:latest
6541
```
6642

67-
Standalone mode starts the engine with no control plane, no account, and no
68-
outbound calls beyond LLM provider APIs. HTTP API on `:8081`.
43+
Engine HTTP API on `:8081`. No control plane, no account, no outbound calls beyond LLM provider APIs.
44+
45+
<details>
46+
<summary>From source / visual builder / workflow validation</summary>
6947

70-
### Engine (from source)
48+
**From source:**
7149

7250
```sh
7351
cd go
7452
go build ./cmd/engine
7553
./engine
7654
```
7755

78-
Requires the Go version pinned in `go/go.mod`. Configuration via `ENGINE_*`
79-
environment variables — see `go/cmd/engine/config.go`.
56+
Requires the Go version pinned in `go/go.mod`. Configuration via `ENGINE_*` env vars — see `go/cmd/engine/config.go`.
8057

81-
### Visual builder
58+
**Visual builder:**
8259

8360
```sh
8461
cd ts
8562
npm ci
8663
cd app && npm run dev # http://localhost:5173
8764
```
8865

89-
### Validate a workflow
66+
**Validate a workflow:**
9067

9168
```sh
9269
cd ts/app
9370
npm run validate -- path/to/file.workflow.json
9471
# exit 0 → clean; exit 1 → diagnostics JSON on stdout
9572
```
9673

97-
## Architecture
98-
99-
```
100-
┌────────────────────────────────────────────────────────────────────────┐
101-
│ contract/ (OpenAPI 3.0.3) │
102-
│ SOURCE OF TRUTH — Go and TS │
103-
│ both regenerate from here. │
104-
└────────────────────────┬───────────────────────────────┬───────────────┘
105-
│ │
106-
go generate npm run generate
107-
│ │
108-
▼ ▼
109-
┌────────────────────────────────┐ ┌────────────────────────────────────┐
110-
│ go/ │ │ ts/ │
111-
│ │ │ │
112-
│ cmd/engine binary │ │ workflow-core headless model │
113-
│ engine/ state machine │ │ workflow-builder React canvas │
114-
│ llmproxy/ cloud + local │ │ app reference SPA + │
115-
│ driver/ GPIO/UART/... │ │ fh-builder CLI │
116-
│ transport/ MQTT │ │ │
117-
│ │ │ │
118-
│ → engine binary (distroless) │ │ → @foresthubai/workflow-core │
119-
│ → multi-arch container │ │ → @foresthubai/workflow-builder │
120-
└────────────────────────────────┘ └────────────────────────────────────┘
121-
```
122-
123-
A workflow is a directed graph of typed nodes — LLM call, hardware I/O, MQTT,
124-
web search, memory, control flow, expressions — connected by edges with one
125-
of five types: `control`, `tool`, `agentTask`, `agentChoice`, `agentDelegate`.
126-
127-
The engine interprets the graph as a state machine: wait for event → execute
128-
node → transition. Triggers run as parallel goroutines. The HTTP layer is
129-
generated by `oapi-codegen` from `contract/engine.yaml` as a strict server;
130-
the workflow types are generated from `contract/workflow.yaml` and reused
131-
without modification by the TypeScript model.
132-
133-
Engine ports `Lifecycle`, `Retriever`, and `MemoryStore` have offline default
134-
adapters in `go/engine/local/` (no-op registration, no-op RAG, filesystem-backed
135-
memory). With the Local LLM provider configured, the engine runs entirely
136-
without network access.
137-
138-
## The contract is the source of truth
139-
140-
Schema drift between Go and TypeScript is the highest technical risk in this
141-
repository. The defense is one authoritative contract with codegen on both
142-
sides, committed bindings, and a CI job that fails on drift.
74+
</details>
14375

144-
- Edit `contract/*.yaml`.
145-
- `cd go && go generate ./...` regenerates `go/api/**/*.gen.go`.
146-
- `cd ts && npm run generate` regenerates `ts/workflow-core/src/api/workflow.ts`.
147-
- Generated files are committed; CI diffs them against a fresh regeneration.
148-
149-
See [`CLAUDE.md`](CLAUDE.md), [`go/CLAUDE.md`](go/CLAUDE.md), and
150-
[`ts/CLAUDE.md`](ts/CLAUDE.md) for per-language conventions.
151-
152-
## LLM providers and on-device SLMs
153-
154-
Four cloud providers and one Local provider for on-device inference. Provider
155-
is dispatched implicitly from the model id; switching from a cloud LLM to a
156-
local SLM is a one-line model-id change.
76+
## Features
15777

158-
| Provider | Configuration |
159-
| --- | --- |
160-
| Anthropic | `ANTHROPIC_API_KEY` |
161-
| OpenAI | `OPENAI_API_KEY` |
162-
| Google Gemini | `GEMINI_API_KEY`, or a Vertex AI service account |
163-
| Mistral | `MISTRAL_API_KEY` |
164-
| Local | Typed YAML registry (see below) |
78+
- **Workflow engine** — typed graph runtime; nodes for LLM calls, hardware I/O, MQTT, web search, memory, control flow.
79+
- **Multi-provider LLMs** — Anthropic, OpenAI, Google Gemini, Mistral, plus a local SLM provider for `llama.cpp` / `vLLM` / `Ollama` / any OpenAI-compatible endpoint.
80+
- **Visual React Flow builder** — embeddable component or runnable as bundled SPA, with typed parameters and live validation.
81+
- **Contract-typed wire format** — every API generated from `contract/*.yaml` for both Go and TypeScript; CI fails on schema drift.
16582

166-
### Local provider
83+
## Local SLM provider
16784

168-
The Local provider models the common edge-SLM topology directly: one process
169-
per model — the standard for `llama.cpp` / `llama-server` and `vLLM` — each
170-
declaring its capabilities and, for embedders, its output dimension. The
171-
proxy routes requests to the right model by capability, so a workflow can use
172-
a chat SLM, an embedder, and a classifier in one pass without knowing where
173-
each one is hosted.
85+
One process per model — the standard for `llama.cpp` and `vLLM` — each declaring its capabilities. The proxy routes requests by capability, so a workflow can use a chat SLM, an embedder, and a classifier in one pass without knowing where each one is hosted.
17486

17587
```yaml
17688
# local-models.yaml
@@ -190,72 +102,68 @@ endpoints:
190102
capabilities: [classification]
191103
```
192104
193-
Declarable capabilities: `chat`, `embedding`, `classification`, `reasoning`,
194-
`vision`, `function_call`, `code`, `fine_tuning`. Any OpenAI-compatible HTTP
195-
endpoint works — `llama.cpp`, `vLLM`, `Ollama`, `LM Studio`, custom.
105+
Declarable capabilities: `chat`, `embedding`, `classification`, `reasoning`, `vision`, `function_call`, `code`, `fine_tuning`. Any OpenAI-compatible HTTP endpoint works.
196106

197107
## Hardware and transports
198108

199-
Engine ships with nodes for:
200-
201-
- **GPIO** via `go-gpiocdev` (digital in/out, edge triggers).
202-
- **ADC / DAC / PWM** via Linux character-device interfaces.
203-
- **UART / serial** via `go.bug.st/serial`.
204-
- **MQTT** via Eclipse Paho — topic-scoped channels for device-to-device
205-
messaging.
206-
- **Web search** as a pluggable node.
109+
- **GPIO** via `go-gpiocdev` (digital in/out, edge triggers)
110+
- **ADC / DAC / PWM** via Linux character-device interfaces
111+
- **UART / serial** via `go.bug.st/serial`
112+
- **MQTT** via Eclipse Paho — topic-scoped channels for device-to-device messaging
113+
- **Web search** as a pluggable node
207114

208115
Digital and analog signal types are first-class in the workflow contract.
209116

210-
## Targets
117+
## Tested targets
211118

212119
| Target | Status |
213-
| --- | --- |
214-
| Linux `amd64` / `arm64` server, gateway, SBC | Supported. Multi-arch distroless container. |
215-
| Raspberry Pi 4/5, NVIDIA Jetson Orin | Supported. |
216-
| macOS `arm64` / `amd64` | Supported (development). |
217-
| Bare-metal MCU (Cortex-M) | Not supported by the Go engine. Contract is portable; a dedicated MCU runtime is on the roadmap. |
120+
|---|---|
121+
| Raspberry Pi 5 (8 GB) | ✅ |
122+
| NVIDIA Jetson Orin Nano (8 GB) | ✅ |
123+
| x86 NUC (16 GB) | ✅ |
124+
| STM32MP25 (1 GB, Linux MCU) | ✅ |
125+
| Bosch Rexroth ctrlX CORE | ✅ |
126+
| Other Linux `amd64` / `arm64` | Works, untested |
127+
| macOS `arm64` / `amd64` | Supported (development) |
128+
| Bare-metal MCU (Cortex-M) | Not supported by the Go engine. Contract is portable; dedicated MCU runtime is on the roadmap. |
218129

219-
## Releases
130+
## Architecture
131+
132+
A workflow is a directed graph of typed nodes — LLM call, hardware I/O, MQTT, memory, control flow, expressions — connected by edges with one of five types: `control`, `tool`, `agentTask`, `agentChoice`, `agentDelegate`. The engine interprets the graph as a state machine: wait for event → execute node → transition. The contract (`contract/*.yaml`) is the single source of truth — Go and TypeScript both regenerate from it, CI fails on drift.
220133

221-
- **Go runtime** — tagged `go/vX.Y.Z`. Consumers pin with
222-
`go get github.com/ForestHubAI/edge-agents/go@vX.Y.Z`. Current: `go/v1.0.1`.
223-
- **TypeScript packages** — `@foresthubai/workflow-core` and
224-
`@foresthubai/workflow-builder` ship in lockstep at the same version.
225-
- **Container image** — multi-arch (`linux/amd64`, `linux/arm64`),
226-
distroless, nonroot, published to GitHub Container Registry.
134+
See [`go/CLAUDE.md`](go/CLAUDE.md) and [`ts/CLAUDE.md`](ts/CLAUDE.md) for deeper architecture notes.
227135

228-
Full release mechanics are in [RELEASING.md](RELEASING.md).
136+
## Repository layout
137+
138+
| Path | What it contains |
139+
| --- | --- |
140+
| [`contract/`](contract) | OpenAPI 3.0.3 schemas — single source of truth for Go and TS. |
141+
| [`go/`](go) | Engine binary, LLM proxy, hardware drivers, MQTT transport. Module `github.com/ForestHubAI/edge-agents/go`. |
142+
| [`ts/workflow-core`](ts/workflow-core) | `@foresthubai/workflow-core` — headless workflow model, validation, (de)serialization. No React. |
143+
| [`ts/workflow-builder`](ts/workflow-builder) | `@foresthubai/workflow-builder` — React canvas component. |
144+
| [`ts/app`](ts/app) | Reference SPA + `fh-builder` CLI. |
145+
| [`examples/`](examples) | Runnable workflow examples per use case. |
146+
| [`skills/`](skills) | Claude Code skill wrapping the workflow CLI. |
147+
148+
## Releases
229149

230-
## Documentation
150+
- **Go runtime** — tagged `go/vX.Y.Z`. `go get github.com/ForestHubAI/edge-agents/go@vX.Y.Z`. Current: `go/v1.0.1`.
151+
- **TypeScript packages** — `@foresthubai/workflow-core` and `@foresthubai/workflow-builder` ship in lockstep at the same version.
152+
- **Container image** — multi-arch (`linux/amd64`, `linux/arm64`), distroless, nonroot, published to GitHub Container Registry.
231153

232-
- [`CLAUDE.md`](CLAUDE.md) — repo-wide architecture and the contract rule.
233-
- [`go/CLAUDE.md`](go/CLAUDE.md) — Go conventions and engine architecture.
234-
- [`ts/CLAUDE.md`](ts/CLAUDE.md) — TypeScript workspace conventions.
235-
- [`ts/workflow-core/docs/`](ts/workflow-core/docs) — workflow model,
236-
parameters, persistence, functions.
237-
- [`ts/workflow-builder/docs/`](ts/workflow-builder/docs) — builder
238-
architecture, change tracking, selection.
154+
See [RELEASING.md](RELEASING.md).
239155

240156
## Contributing
241157

242-
See [CONTRIBUTING](.github/CONTRIBUTING.md) and the
243-
[Code of Conduct](.github/CODE_OF_CONDUCT.md). Open an issue before any
244-
non-trivial change. Every contribution is accepted under a Contributor
245-
License Agreement that preserves the dual-licensing model.
158+
See [CONTRIBUTING](.github/CONTRIBUTING.md) and the [Code of Conduct](.github/CODE_OF_CONDUCT.md). Open an issue before any non-trivial change. Every contribution is accepted under a Contributor License Agreement that preserves the dual-licensing model.
246159

247160
## Security
248161

249-
Do not open public issues for security vulnerabilities. Use
250-
[GitHub private vulnerability reporting](https://github.com/ForestHubAI/edge-agents/security/advisories/new)
251-
or email **root@foresthub.ai**. See [SECURITY.md](.github/SECURITY.md) for
252-
scope and process.
162+
Do not open public issues for security vulnerabilities. Use [GitHub private vulnerability reporting](https://github.com/ForestHubAI/edge-agents/security/advisories/new) or email **root@foresthub.ai**. See [SECURITY.md](.github/SECURITY.md) for scope and process.
253163

254164
## License
255165

256-
`edge-agents` uses a **two-tier license model** designed to make the wire
257-
format and the headless workflow model maximally reusable while keeping
258-
the engine and the visual builder protected under copyleft.
166+
`edge-agents` uses a **two-tier license model** designed to make the wire format and the headless workflow model maximally reusable while keeping the engine and the visual builder protected under copyleft.
259167

260168
| Component | License | Why |
261169
| --- | --- | --- |
@@ -265,12 +173,9 @@ the engine and the visual builder protected under copyleft.
265173
| [`ts/workflow-builder`](ts/workflow-builder) (React canvas) | **AGPL-3.0-only** or **commercial** | Same dual-license terms as the engine. |
266174
| [`ts/app`](ts/app) (reference SPA, not published) | **AGPL-3.0-only** | Reference implementation, not for redistribution. |
267175

268-
For the AGPL components, the AGPL network clause applies — providing a
269-
modified version over a network requires making the corresponding source
270-
available to users of that service.
176+
For the AGPL components, the AGPL network clause applies — providing a modified version over a network requires making the corresponding source available to users of that service.
271177

272-
Third-party components retain their own licenses; see
273-
[THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES) and [NOTICE](NOTICE).
178+
Third-party components retain their own licenses; see [THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES) and [NOTICE](NOTICE).
274179

275180
---
276181

0 commit comments

Comments
 (0)