Skip to content

Repository files navigation

🧠 brain

Your AI agents have a brain. Now you can watch it think.

brain turns a FLUJO workspace into a living neural network β€” every flow a glowing neuron, every connection a synapse with signals pulsing along it. Then it goes further: it grows autonomous brains that learn, act, and evolve on their own, while you watch every thought fire in real time.

Docker WebGL TypeScript License: MIT

git clone https://github.com/flujo-app/brain.git
cd brain
docker compose up
image

A real FLUJO workspace, live: 25 behaviours, 177 connections, organised into provider galaxies.


✨ What is this?

Agent workflows are graphs. Graphs are boring rectangles on a canvas β€” until you realise what they actually are: behaviours wired into a mind.

brain renders that mind. It connects to a running FLUJO instance and builds a 3D universe out of it:

  • 🌟 Every flow becomes a neuron β€” sized by complexity, coloured by the model provider it thinks with
  • ⚑ Subflow calls become axons with signals pulsing from caller to callee
  • πŸ”— Shared MCP servers and shared models become synapses stretching between neurons
  • 🌌 Flows cluster into galaxies β€” by provider, folder, or model β€” each with its own nebula and hue
  • πŸ” Click any neuron and the camera flies inside it, revealing its internal nodes, prompts, and tool belt
image

Inside a neuron: an orchestrator behaviour with its process nodes, three connected abilities, and the three behaviours it calls.

πŸ‘οΈ Watch it think β€” live

This is not a static picture. While a flow runs in FLUJO, brain rides its server-sent event stream and animates the execution as it happens:

  • The running behaviour's neuron wakes up β€” brighter, whiter, swollen, pulsing
  • Subflow calls flash along their axons the instant they fire
  • Flip on follow mode and the camera chases the thought β€” flying to whatever behaviour is executing right now
  • A "now thinking" strip names the running behaviour, its current node or tool call, and how many runs are live

New flow saved? New MCP server installed? A server drops its connection? The brain rebuilds itself in seconds β€” it polls FLUJO continuously and reflects every change. Nothing is cached to disk; what you see is what's running.

And when you want a word with it: hit ⏸ pause. The heartbeat stops, every running flow freezes mid-thought, and an AI input window opens β€” talk directly to any behaviour, with all the others offered to it as tools it can call (each call runs live in the visualization). Type as fast as you like; messages queue and dispatch in order. Press resume and the mind picks up right where it left off.

🌱 Grow a brain β€” the wizard

Beyond visualizing one workspace, brain has a lobby where you grow entire autonomous minds β€” and the wizard is deliberately non-technical. Three questions, zero jargon:

The grow-a-brain wizard: choose where your brain thinks β€” on your computer, in your network, or online
  1. Where should your brain think? On your computer (free, private, via Ollama), on another machine in your network, or online with a paid provider (Anthropic, OpenAI, OpenRouter, …) β€” curated model picks with plain-language tiers, no model-ID archaeology.
  2. What is its life goal? One sentence. This becomes the brain's reason to exist.
  3. How often should its heart beat? A schedule that wakes the brain to pursue its goal.

Press grow, and the manager provisions everything: a fresh, fully isolated FLUJO instance, the model (pulled into Ollama if local), the brain-stem, the heartbeat β€” and the brain appears in the lobby, ready to open and watch.

🧬 The self-evolving brain

Every brain is born with a brain-stem: a root flow whose prompt is its life goal and whose mind is the model you chose. On every heartbeat it wakes up and thinks β€” using seven tools that brain itself serves to it over MCP:

it can… which means…
πŸ“‹ list_behaviours / list_skills introspect what it already knows
🧠 learn_behaviour write new flows for itself β€” LLM-generated, with its own model
⚑ perform_behaviour execute anything it has learned
πŸ”§ learn_skill install new MCP servers from the registry β€” acquiring real-world tools at runtime
πŸ—‘οΈ forget_behaviour / forget_skill prune what no longer serves the goal

So a brain doesn't just run a workflow β€” it grows its own. It learns behaviours, acquires skills, performs them, and forgets what fails. And because the brain-stem runs inside FLUJO's own engine, every act of self-modification animates live in the viewer. You literally watch it learn.

Guardrails are enforced at a single choke point β€” brain's MCP server β€” not left to the model's good manners: a brain can never delete or overwrite its own brain-stem, perform_behaviour refuses recursion into the stem and carries a depth budget, and destructive verbs can require your approval.

🐳 One command to life

You need two things installed first β€” that's the entire prerequisite list:

Prerequisite Why Where to get it
Git clones this repository git-scm.com/downloads
Docker Desktop (Windows / macOS) or Docker Engine + Compose plugin (Linux) runs the stack and isolates every brain docker.com/products/docker-desktop Β· Engine install docs

πŸ’‘ On Windows, Docker Desktop runs on the WSL 2 backend β€” its installer sets that up for you. Before continuing, make sure Docker is actually running: docker info should print without errors (on Windows/macOS that means the Docker Desktop app is open).

Then:

git clone https://github.com/flujo-app/brain.git
cd brain
docker compose up

β˜• The first start takes a few minutes β€” Docker builds the brain image and builds FLUJO from its GitHub repo. Skip the FLUJO build by pulling the prebuilt image first: docker compose pull flujo. Every start after the first takes seconds. When the log settles, open:

🧠 brain β€” lobby + viewer http://localhost:8080
🌊 FLUJO β€” flow editor http://localhost:4200

Stop it with docker compose down β€” your brains survive in Docker volumes and wake up on the next up. And here's what you get:

        your browser ── localhost only ──┐
                                         β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ brain-net (internal) ────────────────────────────┐
   β”‚                                                                              β”‚
   β”‚   🧠 brain  :8080 ──────► lobby + viewer + manager (the only door in)        β”‚
   β”‚        β”‚ /flujo proxy            β”‚ provisions via Docker socket              β”‚
   β”‚        β–Ό                         β–Ό                                           β”‚
   β”‚   🌊 FLUJO :4200          🧠 brain #1     🧠 brain #2     🧠 brain #3 …      β”‚
   β”‚   (default instance)      own FLUJO       own FLUJO       own FLUJO         β”‚
   β”‚                           own volumes     own volumes     own volumes        β”‚
   β”‚                           NO ports        NO ports        NO ports           β”‚
   β”‚        └──────────────────────┴─────── πŸ¦™ Ollama (local models) ─────────────│
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Isolation is the architecture, not an option. Every brain you grow gets its own FLUJO container with its own named volumes β€” its own flows, its own MCP servers, its own memory. Spawned brains publish zero ports: they live on an internal Docker network and are reachable only through the manager's authenticated per-brain proxy. One brain cannot see, touch, or break another. Delete a brain and its container vanishes; its volumes survive unless you purge them.

⚠️ Localhost only, by design. FLUJO has no auth layer, and the manager holds the Docker socket. Every published port binds to 127.0.0.1. Never expose this stack without your own authenticating reverse proxy β€” details in the technical docs.

⚑ Zero prerequisites? Use the installer

One line checks for Git and Docker (or Node.js), installs what's missing, clones brain, registers a global brain command, and starts everything:

Windows (PowerShell):

irm https://raw.githubusercontent.com/flujo-app/brain/main/scripts/install.ps1 | iex

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/flujo-app/brain/main/scripts/install.sh | bash

The installer asks a handful of questions β€” Docker or standalone mode, where to install, desktop shortcut, start now? β€” and from then on, typing brain in any terminal brings the whole stack up. Re-running the installer updates an existing install. For unattended installs, drive it with environment variables (BRAIN_MODE=docker|standalone, BRAIN_DIR, BRAIN_BRANCH, BRAIN_START=1) β€” see scripts/install.ps1 / scripts/install.sh.

Prefer a classic setup.exe? Grab brain-setup.exe from the latest release β€” the same installer wrapped in a graphical wizard: it checks for Git and Docker Desktop (or Node.js), auto-installs whatever is missing, and asks the same questions as wizard pages. Re-running it updates the install too. Built from installer/brain-setup.iss by CI on every release tag.

πŸš€ Try it in 30 seconds

Already running FLUJO? No Docker needed β€” brain is a static site. All it takes is Node.js β‰₯ 20 (and Git for the clone):

git clone https://github.com/flujo-app/brain.git
cd brain
npm install && npm run dev

Open the URL, and if FLUJO is at localhost:4200, the brain boots itself the moment it finds it. Not on 4200? Point it anywhere with ?flujo=<url>. Weak GPU? There's a full 2D map renderer (Canvas 2D, no shaders) that low-end machines get automatically.

🧍 Standalone mode (no Docker, one brain)

Want the full experience β€” same-origin proxy, live execution animation, brain-stem tools β€” without Docker? Same prerequisites as above (Node.js β‰₯ 20 + Git), then:

npm install && npm run standalone

One command, one brain, http://localhost:8080. (The installer above sets this mode up for you too β€” pick standalone when it asks, or set BRAIN_MODE=standalone.) The front door decides for you: if a FLUJO is already running on localhost:4200, you land straight in the viewer β€” no lobby detour. No FLUJO and no Docker? You get the lobby in adopt mode, where you can point brain at any FLUJO you start by hand. (Docker installed? Then the lobby stays the front door and can spawn brains as usual.)

πŸ—ΊοΈ Where this is going

Birth and death animations for neurons, a timeline scrubber ("this brain at day 3"), approval gates rendered inside the visualization so a brain can ask permission before acting, and a multi-brain constellation view. The full plan β€” verified against FLUJO's actual API surface β€” is in ROADMAP.md.

πŸ“š Documentation

Technical documentation The full reference: visual language, data pipeline, execution watcher internals, Docker & network architecture, brain-stem protocol and guardrails, dev workflow
ROADMAP.md Phases, design decisions, and what FLUJO's API makes possible

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages