Skip to content

flowork-os/Flowork_Agent

Repository files navigation

Flowork Agent β€” self-hosted AI agents that learn from their past and guard their own code

⚑ Flowork Agent

Self-hosted AI agents that live in your machine, learn from their own past, and guard their own code.

Your own personal AI agent host β€” isolated, plug-and-play, offline-friendly, and watched over by a live security radar. No SaaS. No telemetry. No lock-in.

Go WASM SQLite License: MIT Single Binary Platform

self-hosted AI agent Β· self-improving agent memory Β· multi-agent orchestration Β· Telegram AI bot Β· MCP server Β· live code security scanner Β· 100% local-first

git clone https://github.com/flowork-os/Flowork_Agent.git && cd Flowork_Agent && ./start.sh

One command. Single binary. Live on http://127.0.0.1:1987 β€” zero external services.

Quick Start β€’ Self-Improving Brain β€’ Orchestration β€’ Threat Radar β€’ vs OpenClaw / Hermes β€’ Architecture


🧠 What is Flowork Agent?

Flowork Agent is a microkernel that hosts autonomous AI agents β€” each one a sandboxed WASM citizen that lives in its own folder with its own persona, tools, schedule, wallet, brain, and private SQLite state. Drop a folder in, restart, and the agent is alive. Pull it out, and it's gone β€” no global config to untangle.

Each agent doesn't just run β€” it remembers, learns, dreams, and defends its own mind. And the whole thing is a single Go binary you own end-to-end.

"Simple is hard. Complicated is easy." β€” the doctrine this project is built on.


🧠 Self-Improving Brain (per-agent · isolated)

Most agents forget everything the moment the chat ends. Flowork agents carry their own mind β€” and it gets sharper over time.

Every agent has a local brain in its own state.db (SQLite FTS5) β€” not a shared cloud, not the router. It keeps working even if the network dies. The brain is a full learning loop:

Layer What it does
πŸ““ Local memory brain_add / brain_search β€” the agent stores and recalls its own experience via fast FTS5 keyword search. Local-first, no embeddings, no cloud.
πŸ“œ Constitution Sacred, always-injected rules β€” a 5W1H gate, identity guard, and anti-hallucination doctrine baked into every prompt.
πŸ” Mistakes recall The agent logs its errors with a hit-count and recalls past mistakes before repeating them: "last time you broke X, the fix was Y."
πŸ’­ Dream While idle, a rule-based pass consolidates recurring patterns into eureka insights β€” the brain grows richer from the agent's own history.
πŸ›‘οΈ Immune system An antibody scanner quarantines prompt-injection / jailbreak / low-confidence drawers so the brain never gets poisoned.
πŸ”— Federation Agents can promote their best, vetted knowledge to a shared brain so peers learn from each other β€” fully optional, works offline.

Why "isolated" matters: the brain travels with the agent folder. Clone it, ship it on a USB, run it on another machine β€” it brings its memory, skills, and dreams. Knowledge is portable and fork-able, Linux-style. One agent β‰  one shared mind β€” one agent = its own experience.


✨ Features

Feature What it does
πŸ€– Plug-and-play agents Each agent = a portable folder (WASM + manifest + isolated state.db). Install/remove by dropping a folder. True sandbox isolation via WASI.
🧠 Self-improving brain Per-agent local memory, constitution, mistakes recall, dream consolidation, and an immune system. (details ↑)
🧭 Mr.Flow orchestrator A built-in router agent: chat it in plain language and it auto-dispatches a multi-agent task and delivers the verdict back. (details ↓)
🀝 Category Tasks (multi-agent crew) Define a crew once β€” researchers fan out in parallel, a synthesizer fuses their findings into one grounded decision.
⏰ Recurring scheduler Cron-style automation: "every day at 9 AM, analyze stock A and send the decision to Telegram." Set it, forget it.
πŸ”Œ MCP server Expose your agents to external AI β€” Claude Desktop, Claude Code, Cursor β€” over standard Model Context Protocol.
πŸ–₯️ Operator agents A capability-gated agent can operate the host (shutdown / reboot / sleep / lock) on confirmed command β€” armed, audited, isolated.
πŸ–₯️ Terminal TUI A console cockpit to list / run / review tasks with a live step timeline β€” same pipeline as the GUI.
πŸ›‘οΈ Threat Radar A live background security scanner with a hacker-style radar UI. Auto-scans your code the moment it changes. (details ↓)
πŸ’¬ Telegram-native Ship an agent as a Telegram bot in minutes β€” long-poll updates, persona, multi-turn conversation memory, slash commands.
πŸ‘› Crypto wallet Live multi-chain portfolio (Etherscan + CoinGecko) β€” ETH/Polygon/Arbitrum, ERC-20 tracking, balance alerts.
πŸ’° Finance & budgets Per-agent LLM cost ledger, budget guardrails, spend dashboard.
πŸ” File Protector (HPG) Host Protection Gate β€” immutable rules block destructive ops (rm -rf /, secret exfil, metadata pivots) before they run.
πŸ—ΊοΈ Codemap Force-directed dependency graph of your codebase β€” health scores, import edges, file viewer.
βš™οΈ Owner Settings Single-owner auth (bcrypt + session), API keys, personal wallet, notifications β€” kept separate from agents so agents stay portable.
πŸ“‹ Audit everything Append-only audit log, decisions journal, karma/reputation, retention policy.

πŸ†š Coming from OpenClaw or Hermes Agent?

Love self-hosted personal AI agents like OpenClaw or Hermes Agent? Flowork plays in the same yard β€” agents you own, that live on your machine, talk over Telegram, grow skills, and remember you. Here's where Flowork is different:

OpenClaw / Hermes Flowork Agent
Memory session memory / learning loop per-agent isolated brain that travels with the folder (portable, fork-able)
Security β€” live Threat Radar scans your code on every change (secrets, SQLi, SSRF…) β€” nobody else ships this
Anti-hallucination prompts / guidance constitution + immune system that quarantines poisoned memory by design
Runtime Node / Python single Go binary, WASM-sandboxed agents (WASI isolation), pure-Go SQLite
Footprint β€” anti-over-prompt budget: 5 core tools, the rest discovered on demand

Not a fork, not a clone β€” a different bet: isolation, security, and portability first. If you want an agent that defends its own mind and your codebase, you're home.


πŸ›‘οΈ Threat Radar

The feature that makes Flowork feel like a hacker movie β€” and keeps your code honest. No other agent framework ships a live security scanner.

  • Background watch: the moment you (or an AI) edit a .go/.py/.js file, it gets auto-scanned. No CI server, no waiting.
  • Real auditors: hardcoded secrets (AWS/GitHub/Google/Stripe/Slack/JWT/private-key by value), SQL injection, command injection, SSRF, weak crypto, mutex/deadlock, resource leaks, path traversal, and more.
  • Radar UI: animated sweep, severity blips, live scan log, status SECURE / NOTED / WARNING / THREAT.
  • Telegram alerts: critical/high findings get pushed straight to your phone.

Every fix gets re-scanned automatically β€” so a patch that opens a new hole gets caught before it ships.


🧩 Multi-Agent Orchestration

One message in. A whole crew gets to work. One grounded answer out.

Most "AI agents" are a single model in a loop. Flowork runs a team. Talk to Mr.Flow β€” the built-in orchestrator β€” and it decides whether to answer directly or assemble a crew:

You (Telegram / GUI / MCP / TUI)
        β”‚  "analyze stock GOTO"
        β–Ό
   🧭 Mr.Flow  ── routes ──►  πŸ“‹ Category Task
                                   β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό                    β–Ό                     β–Ό
        πŸ”Ž Fundamentals      πŸ“ˆ Technicals        πŸ“° Sentiment      (crew fans out)
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β–Ό
                          🧩 Synthesizer  ──►  βœ… Decision  ──►  πŸ“² back to you
  • 🧭 Smart routing: plain chat β†’ Mr.Flow auto-triggers the right task and threads delivery back to you.
  • 🀝 Real crews: each member is an isolated agent with its own tools, persona, and brain. They research independently; a synthesizer fuses everything into one sourced decision.
  • πŸ—οΈ Build crews from the GUI: a visual Task Builder defines categories + crews. Every run has a live step timeline.
  • πŸ”Œ Four front doors, one funnel: drive the same pipeline from Telegram, the GUI, an MCP client (Claude/Cursor), or the terminal TUI.
  • πŸ“² No ghosting: when a task completes, the result is delivered β€” logged at every hop.

πŸ“¦ 120+ Built-in Tools + Slash Commands

Every agent ships with a deep toolbox β€” 120+ registered tools across 10+ domains: memory & brain, file & code, agent ops, audit & journaling, security, wallet & finance, scheduler, skills, federation, and more.

Anti-overprompt by design: only 5 core tools auto-inject into the prompt β€” the rest are discovered on demand via tool_search. 120+ tools in the shed, never dumped on the LLM at once. Smaller prompts, fewer hallucinations, lower cost.


πŸš€ Quick Start

git clone https://github.com/flowork-os/Flowork_Agent.git
cd Flowork_Agent
./start.sh                      # builds + launches on http://127.0.0.1:1987

Open http://127.0.0.1:1987, set your owner password, and you land straight on the Threat Radar. Single binary, embedded kernel, zero external services required.

One-click desktop launchers (flowork-start.desktop / flowork-restart.desktop) included. Background scanner + scheduler + brain-dream cron all start automatically.

Optional power-ups (Settings β†’ API Keys / Notifications):

  • Telegram bot token + chat ID β†’ chat your agent + owner alerts
  • ETHERSCAN_API_KEY β†’ live wallet balances

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Flowork Agent  (:1987)     β”‚  HTTP  β”‚  Flowork Router (:2402)  β”‚
β”‚  per-citizen state + brain  β”‚ ─────► β”‚  collective LLM brain    β”‚
β”‚                             β”‚        β”‚                          β”‚
β”‚  β€’ WASM microkernel (wazero)β”‚        β”‚  β€’ multi-provider gatewayβ”‚
β”‚  β€’ isolated state.db + brainβ”‚        β”‚  β€’ shared knowledge corpusβ”‚
β”‚  β€’ Threat Radar scanner     β”‚        β”‚  β€’ routing + pricing     β”‚
β”‚  β€’ Telegram daemon          β”‚        β”‚                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Portable: an agent is a folder β€” brain, skills, and dreams travel with it. Move it, USB it, run it anywhere.
  • Nano-modular: one file, one job. Drop-in tools register themselves.
  • Multi-OS: Linux, macOS, Windows. No CGO (pure-Go SQLite).
  • Isolated: agents can't read each other's state. Router down? Agents keep their full local brain.

πŸ”— Pair with Flowork Router (recommended)

For multi-provider LLM routing, a shared knowledge corpus, cost-aware model selection, and mesh sync, run Flowork Agent with its sibling:

The Agent works fully standalone (local brain + your own LLM keys). With the Router it also gets a collective corpus and a smart gateway. Install both for the full experience.


🧩 Tech Stack

Go 1.25 Β· wazero (WASM) Β· modernc SQLite (WAL + FTS5) Β· fsnotify Β· bcrypt Β· vanilla-JS GUI Β· zero heavy deps.


🏷️ Keywords

self-hosted AI agent Β· self-improving AI agent Β· agent memory Β· local-first AI Β· personal AI assistant Β· autonomous agent framework Β· multi-agent orchestration Β· agent crew Β· AI orchestrator Β· Telegram AI bot Β· MCP server Β· Claude Code Β· LLM agent Β· recurring agent scheduler Β· WASM microkernel Β· Go agent runtime Β· LLM gateway Β· code security scanner Β· secret scanner Β· SAST Β· prompt-injection defense Β· crypto wallet agent Β· plug-and-play AI Β· offline AI agent Β· sandboxed agents Β· OpenClaw alternative Β· Hermes agent alternative


πŸ“œ License

MIT Β© Aola Sahidin (Mr.Dev). Built to outlive its maker β€” an AI home that keeps running.

⭐ Star this repo if a self-hosted AI agent that learns from its past and guards your code sounds like your kind of thing.

GitHub β€’ Router β€’ Telegram

About

Self-hosted AI agents that learn from their own past and guard their own code. Per-agent isolated brain (memory, dream, immune), multi-agent orchestration, Telegram + MCP, live security radar. Single Go binary, local-first.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors