Plugin Model
This page defines the plugin boundary for Toolang runtime integrations.
Toolang currently treats these areas as pluggable:
memorychannelsandbox
Design goal
Plugins make Toolang open to:
- local implementations
- remote managed implementations
- first-party integrations
- third-party integrations
The boundary should remain:
- small
- explicit
- easy to diagnose
- easy to replace
Core principle
Toolang core owns:
- execution lifecycle
- scheduling
- local truth-layer state
- prompt and run traces
- shared bus projection
Plugins own only their domain-specific input and output operations.
Rules:
- plugins return structured data
- plugins do not mutate Toolang core state directly
- plugins do not decide scheduling policy
- plugins do not become the primary execution truth
Plugin families
Memory
Memory plugins provide:
recallrememberhealth
Channel
Channel plugins handle message ingress and egress. They may support:
- polling
- hook decoding
- outbound delivery
- health checks
Sandbox
Sandbox plugins provide execution environments. They may support:
- one-shot invoke execution
- long-lived runtime spawning
- liveness probing
- stop and cleanup
Loading model
Plugins should be selected by explicit config and loaded by name.
Recommended discovery mechanism:
- Python package entry points
toolang.memorytoolang.channeltoolang.sandbox
Recommended loading flow:
- read source config
- resolve environment variables and relative paths at the call site
- build an explicit plugin spec
- load the named plugin factory
- construct the plugin instance with explicit config
Configuration
Each plugin family should use one plugin name and one config object.
Examples:
[memory]
plugin = "sqlite"
[memory.config]
path = ".toolang/agents/alice/memory.db"[channels.telegram]
plugin = "telegram"
[channels.telegram.config]
token_env = "TELEGRAM_BOT_TOKEN"
chat_id = "12345678"
owner_chat_id = "87654321"[sandbox]
plugin = "docker"
[sandbox.config]
image = "python:3.13"
network = "bridge"Runtime boundary
Responsibility split:
- runtime loop receives or generates input
- runtime converts that input into
Messageand turn requests - scheduler admits work
- execution strategy completes the turn
- runtime persists local state
- runtime appends bus events
- plugins perform only their domain-specific operations
Diagnostics and replaceability
Every plugin interaction should be traceable. Useful fields include:
- plugin family
- plugin name
- request summary
- provider response summary
- degraded mode details
- error details
Replaceability should happen by selecting another plugin or config, not by adding a new runtime architecture mode.
Read next
- Read Memory Model for the memory-specific contract.
- Read Execution Model for the runtime behavior surrounding these plugins.