brain_kernel
Headless system kernel for knowledge-grounded multi-agent systems.
brain_kernel bundles project / canonical / patch / validate / build /
MCP / chat / RAG over mcp_bundle
and flowbrain_core, and
exposes them as a single Dart library that products (builders, industrial
HMIs, medical / education tools, B2B platforms, personal apps) can wire
into their own UI and domain workflow without writing the integration
plumbing themselves.
What's inside
- Core — project / canonical / patch pipeline / asset validator / undo-redo stack / sidecar logs (prefs, chat, history, undo).
- Feature — BM25 index, gold-question runner, asset extractor + reviewer queue, asset-touch observer.
- Infra — bundle reader / knowledge writer / mcpb packager, embedding runner, BM25 query engine + bundle registry, domain storage, FlowBrain wiring (KvStoragePort adapter, runtime probe, LLM port adapter, FlowDefinitionWorkflow), MCP server bootstrap (tool scope + transport picker), LLM session manager, chat controller + system-prompt composer.
- System —
BundleActivation+BundleActivationRegistry: the single standard API every host (AppPlayer Studio · AppPlayer · future hosts) uses to activate a bundle, register its assets, and tear it down. Per-bundle isolation via<bundleId>.<asset.id>prefixing.
Quick start
import 'package:brain_kernel/brain_kernel.dart' as bk;
// Boot the kernel.
final wiring = bk.FlowBrainWiring(
workspaceId: 'my_workspace',
kvStoragePort: bk.InMemoryKvStoragePort(),
);
await wiring.boot();
// Activate a bundle.
final activation = bk.BundleActivation(
system: wiring.system,
bundleId: 'my.bundle',
);
await activation.activate(myBundle); // McpBundle
Hosts (AppPlayer Core, AppPlayer Studio, ...) drive this lifecycle from their own session-management code.
Re-exports
The barrel re-exports the upstream packages so consumers can stay on a
single MCP surface (per FR-CMP-002):
flowbrain_core—KnowledgeSystem, the five facades, the agent runtime types, infrastructure ports.mcp_bundle— bundle schema, validators, ports.mcp_server— MCP server primitives.mcp_client— selected client types (Client, transport configs).
Products do not need to depend on these packages directly; depending on
brain_kernel is enough.
Status
brain_kernel is the canonical kernel for the MakeMind ecosystem and
the foundation that AppPlayer Core, AppPlayer Studio, and the FlowBrain
products build on. The API surface is stable enough for early adopters
but still evolves with the upstream mcp_bundle / flowbrain_core
spec — pin caret versions.
License
MIT
Libraries
- brain_kernel
- Public barrel for the brain_kernel system kernel (carbon copy of brain_kernel for vibe-side iteration).
- mcp_client
- Kernel sub-barrel for outbound MCP client usage.
- mcp_host
- Kernel sub-barrel for the reference MCP host adapters.