Reflex

A payment fails, a reply lands on a ticket, an order sits unshipped: Reflex wakes an AI agent that handles the safe part and sends the rest to a person. A reflex bundles a trigger, Markdown instructions, MCP connections, and a policy for every tool. Triggers include signed webhooks from GitHub, Stripe, or any source, MCP resource subscriptions, polls, cron schedules, and X without Y, which fires when an order is paid but not shipped within minutes. Automatic tools run, approval tools wait, and forbidden tools do not exist for the agent. People decide in a Decisions inbox that shows the agent's reason and the exact call, and approving runs that call without asking the model again. Some actions can require two approvers. Reflex recalls up to three similar past decisions, so the agent stops repeating proposals people already rejected. Each reflex has a daily token budget and caps on tool calls and run time, and three failed runs in a row switch it off. Runs resume from stored steps after a crash. Pick Claude or an open model through Hugging Face for each reflex, and without a key the demo replays recorded answers. Reflex is an MCP server too, behind OAuth, so Claude Code can read runs and approve or reject decisions as you. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. MIT licensed.

Reflex
Reflex
Reflex
Reflex
Reflex

Benefits

  • Policies enforced in code, not prompts
  • Forbidden tools are hidden from the agent and approval tools only record proposals, so no prompt can trigger an action the policy blocks, and events reach the model marked as data.
  • People approve the exact call
  • Each decision shows the agent's reason and the precise tool and arguments, and approving runs exactly that call without asking the model again, with optional notes passed back on rejection.
  • Memory of past decisions
  • Every approved, rejected, answered, or declined decision is stored as a precedent, and similar future events recall it so the agent follows what people decided before.
  • Budgets, limits, and crash recovery
  • Daily token budgets, tool-call and time caps, and automatic shutdown after three failed runs keep spend in check, while stored steps let a run resume after a crash without repeating calls.

Features

  • Symfony 8.1 and FrankenPHP
  • A Symfony 8.1 application on FrankenPHP in worker mode with PHP 8.5, using Messenger for queued runs, Scheduler for ticks, and Workflow for decision states.
  • Symfony AI Agent Loop
  • Symfony AI's Agent and Toolbox run each reflex, an MCP bridge turns every connection's tools into agent tools, and a custom toolbox applies the tool policy.
  • MCP Client and Server
  • The MCP PHP SDK client speaks Streamable HTTP with OAuth and elicitation, a fork adds subscriptions/listen for resource changes, and Reflex's own server uses OAuth 2.1 with PKCE.
  • pgvector Decision Memory
  • Decisions are embedded by a local Text Embeddings Inference server with intfloat/multilingual-e5-small and stored in PostgreSQL 18 with pgvector through Symfony AI's Store.
  • Claude and Hugging Face Models
  • Anthropic Claude models or openai/gpt-oss-120b through Hugging Face Inference Providers are picked per reflex, and recorded answers replay without a key through a ResultSerializer.
  • Docker Compose Stack
  • docker compose up --wait starts the app on port 8088 with a worker, an MCP listener, PostgreSQL, an embeddings server, and the Polar Coffee Store demo MCP servers.

Apps Similar to Reflex