FlowScript logo

FlowScript

Community
phillipclapham

Queryable reasoning memory for AI agents. Six typed queries (why, tensions, blocked, whatIf, alternatives, counterfactual) over reasoning graphs. Vector stores remember what. FlowScript remembers why. TypeScript SDK + MCP server.

Publisherphillipclapham
Repositoryflowscript
LanguageTypeScript
Forks
2
Stars
10
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    FlowScript exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    10 stars and 2 forks from the linked repository.


Evolution note: FlowScript explored typed reasoning representation for AI agents — compression-as-cognition, temporal graduation, citation-validated patterns, immune system. These core concepts evolved into anneal-memory, a two-layer memory system for AI agents. The notation remains in active daily use for reasoning compression and knowledge encoding. This repo is maintained as a reference implementation and notation playground.


The Notation

FlowScript is a 21-marker semantic notation that both humans and AI parse natively. It sits between natural language (ambiguous, verbose) and formal logic (precise, unreadable). Start with three markers — ->, ><, { } — and add more as you need them.

{database_decision:
  ? which_database_for_sessions
  || Redis -> sub-ms reads, proven at scale
  || PostgreSQL -> rich queries, $15/month, ACID

  speed ><[performance vs cost] infrastructure budget

  [decided(rationale: "budget constraint eliminated Redis", on: "2026-03-30")]
  ! [blocked(reason: "data export tool needed", since: "2026-03-28")]
}

Every marker has computational semantics. ? creates a question node. || creates alternatives. >< creates a tension with a named axis. [decided] records a commitment with rationale and date. The parser turns this into the same IR that the query engine traverses.

Learn the full notation: flowscript.org/learn | Formal spec: spec/ directory (757 lines, v2.1)


What This Repo Contains

TypeScript SDK (flowscript-core on npm)

779 tests. Memory class with typed node construction, six graph traversal queries, 15 agent tools in OpenAI function calling format, hash-chained audit trail, and four token budgeting strategies.

typescript
import { Memory } from 'flowscript-core';

const mem = Memory.loadOrCreate('./agent-memory.json');

// Build reasoning — typed nodes with explicit relationships
const q = mem.question("Which database for agent memory?");
mem.alternative(q, "Redis").decide({ rationale: "speed critical" });
mem.alternative(q, "SQLite").block({ reason: "no concurrent writes" });
mem.tension(mem.thought("sub-ms reads"), mem.thought("$200/mo cluster"), "performance vs cost");

// Six typed queries over the reasoning graph
mem.query.tensions();             // tradeoffs with named axes
mem.query.blocked();              // what's stuck + downstream impact
mem.query.why(nodeId);            // causal chain backward
mem.query.whatIf(nodeId);         // what breaks if this changes
mem.query.alternatives(nodeId);   // what was considered + decided
mem.query.counterfactual(nodeId); // what would need to change

// Human-readable serialization
console.log(mem.toFlowScript());

Sub-millisecond graph traversal. No embeddings, no LLM calls, no network dependency.

Web Editor (flowscript.org)

  • CodeMirror 6 with custom FlowScript language mode and syntax highlighting
  • D3 force-directed graph visualization of reasoning nodes and relationships
  • Live query panel — run tensions(), blocked(), why() against your graph in the browser
  • WCAG AA accessible, responsive design

Source code in web/.

Notation Spec

The full FlowScript v2.1 specification in spec/:

  • semantics.md — all 21 markers formally defined
  • grammar.md — EBNF formal grammar
  • ir.schema.json — JSON schema for the intermediate representation
  • linter-rules.md — semantic validation rules (6 errors, 3 warnings)

Teaching Materials


What Evolved into anneal-memory

Through building FlowScript, we discovered that the core insights were more powerful than the syntax:

FlowScript exploredanneal-memory delivers
Temporal graduation (1x → 2x → 3x → proven)Citation-validated graduation with immune system
Compression-as-cognitionEpisodes compress into identity through consolidation
Hash-chained audit trailTamper-evident compliance layer (EU AI Act)
Anti-inbreeding defenseGraduation gate + principle demotion through citation decay
Transport-layer wrapperCompliance proxy vision (MCP transport interception)
Six typed reasoning queriesPlanned for anneal-memory CLI

The notation barrier was real — developers won't learn a new syntax for memory. anneal-memory delivers the same cognitive architecture as a zero-dependency MCP server where agents use natural language.

anneal-memory on GitHub | anneal-memory on PyPI


Related


Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "phillipclapham-flowscript": {
      "command": "npx",
      "args": [
        "-y",
        "flowscript-core"
      ]
    }
  }
}

Use FlowScript MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once FlowScript is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add FlowScript as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the FlowScript MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "phillipclapham-flowscript": {
      "command": "npx",
      "args": [
        "-y",
        "flowscript-core"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the FlowScript MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the FlowScript MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use FlowScript to help me with this task?
FlowScript
Sure. I read it.
Here is what I found using FlowScript.

Frequently asked questions

What is the FlowScript MCP server used for?

FlowScript is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use FlowScript MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use FlowScript with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use FlowScript MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With FlowScript connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect FlowScript MCP to TypingMind?

FlowScript runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does FlowScript MCP provide in TypingMind?

FlowScript exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use FlowScript MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If FlowScript requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇