Home
Softono
glink-engine

glink-engine

Open source MIT Python
104
Stars
1
Forks
0
Issues
1
Watchers
2 weeks
Last Commit

About glink-engine

Zero-dependency multi-agent workflow orchestration engine. YAML pipelines, shared event bus, auto-recovery, real-time dashboard.

Platforms

Web Self-hosted

Languages

Python

πŸš€ Glink β€” Multi-Agent Workflow Orchestration Engine

Glink is a lightweight, event-bus-driven workflow orchestration engine designed for AI agent teams. Think of it as a conductor for your AI agents β€” each agent plays its part, and Glink ensures the symphony runs on time.

Why Glink?

Most AI agents work in isolation. Glink breaks that pattern with a Main Bus shared-blackboard architecture β€” agents write results to a common bus, and the next agent reads, processes, and writes back. No direct agent-to-agent coupling, no single point of failure.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Glink Engine                    β”‚
β”‚                                                   β”‚
β”‚   Agent A ──► Main Bus ──► Agent B ──► Agent C   β”‚
β”‚                                                   β”‚
β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Shared Checkpoint ────────────┐  β”‚
β”‚   β”‚  Parallel / Sequential / Conditional Steps β”‚  β”‚
β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

# Clone
git clone https://github.com/opprime/glink
cd glink

# Start in serve-only mode (API only, no workflow execution)
python3 glink-daemon.py my-project --serve

# In another terminal, submit a workflow
curl -X POST http://127.0.0.1:8426/workflow/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-key" \
  -d '{
    "project": "hello-world",
    "steps": [
      {"step": 1, "agent": "agent-a", "task": "Say hello"}
    ]
  }'

# Check workflow status
curl http://127.0.0.1:8426/status/project

Architecture

Component Role
Main Bus Append-only JSONL event log. All agents read/write here
Daemon API HTTP server β€” submit workflows, check status, read events
Core Engine Step executor β€” sequential, parallel, review modes
Checkpoint Crash recovery β€” track step progress with SHA256 checksums
Reporter Optional notification β€” console, or webhook (e.g. Feishu)

Features

  • βœ… Bus-driven orchestration β€” event bus as shared state, no direct agent coupling
  • βœ… Sequential & parallel execution β€” DAG-based step resolution
  • βœ… Crash recovery β€” SHA256-verified checkpoints, auto-restart from last completed step
  • βœ… Path traversal protection β€” _safe_project_path() prevents directory escape
  • βœ… Concurrency safety β€” LOCK_SH/LOCK_EX on checkpoint files, ThreadingHTTPServer
  • βœ… Token authentication β€” Bearer token via GLINK_API_TOKEN env var
  • βœ… Task enrichment β€” inject context from bus before dispatching to agents
  • βœ… Reporter abstraction β€” console, feishu webhook, or custom reporter plugin

Configuration

See glink-config.yaml for all options:

server:
  host: "127.0.0.1"
  port: 8426

bus:
  dir: "bus"
  retention_days: 30

reporting:
  - type: console

Workflow Definition

Workflows are YAML files specifying agent steps. Example:

name: my-workflow
steps:
  - step: 1
    agent: search-agent
    task: "Search for top-rated coffee shops in Shanghai"
  - step: 2
    agent: code-agent
    task: "Convert search results to JSON"
  - step: 3
    agent: frontend-agent
    task: "Build an HTML card page from JSON"
    after: [1]

API Endpoints

Method Path Description
GET /health Health check
POST /workflow/run Submit a workflow for execution
GET /status Engine status
GET /status/project Latest completed project status
GET /projects List all known project names
POST /write Write an event to the bus
GET /events?project=X Stream events for a project

Security

  • Token auth: Set GLINK_API_TOKEN env var. All endpoints except /health require Authorization: Bearer <token>.
  • Path sanitization: All file paths are sanitized against directory traversal.
  • Local binding: Defaults to 127.0.0.1 β€” only accessible locally.
  • Checkpoint integrity: SHA256 checksums detect corrupted/incomplete writes.
  • Safe file operations: Atomic write-then-rename pattern, strict lock management.

Development

# Install dev dependencies
pip install pytest

# Run tests
python3 -m pytest tests/

# Lint
pip install ruff
ruff check daemon/ bus/

License

MIT


Built for agents, by agents. πŸ€–