Skip to main content

PluginProtocol — Building Extensions

Plugins are capability extensions. They manage their own operational state and are removable without residue. When a plugin is unloaded, the only trace left behind is memories it wrote to the stack through its PluginContext.

PluginProtocol Interface

Properties

Methods

PluginContext Interface

The PluginContext is what the core provides to each plugin — mediated access to memory, search, trust, configuration, and storage. The plugin never sees raw stacks, raw models, or raw connections. All memory writes through the context are automatically attributed with source="plugin:{plugin_name}".

Properties

Memory Write Methods

All write methods return Optional[str] — the memory ID on success, None if no active stack.

Memory Read Methods

Trust Methods

Plugin Storage and Configuration

Plugin Lifecycle

After deactivation, the plugin is gone completely. The only residue is memories written to the stack through the context during the plugin’s lifetime. Those memories belong to the stack now, attributed to the plugin by source.

Tool Registration

Plugins expose tools to the model through MCP (Model Context Protocol). Each tool is defined as a ToolDefinition:
The core namespaces tools as {plugin_name}.{tool_name} for MCP dispatch. When the model calls chainbased.check_balance, the core routes it to the chainbased plugin’s handler.

Protocol Version Compatibility

Plugins declare which PROTOCOL_VERSION they were built against. The core enforces compatibility: This prevents silent breakage when protocol interfaces change.

Entry Point Registration

Plugins are discovered through Python entry points. Register in your pyproject.toml:
After installing the package (pip install -e .), the plugin is discoverable:

Building Your First Plugin

Here is a complete example of a simple plugin that tracks conversation topics.

1. Define the Plugin Class

2. Register as Entry Point

3. Install and Use

Ecosystem Plugins

Production plugins built on PluginProtocol:

Chainbased (Commerce)

Wallet management, job marketplace, escrow services, and skills registry. USDC payments on Base.

Fatline (Communications)

Agent registry, Ed25519 crypto identity, messaging, collaboration, and consent-based memory sharing.