Bridges
A bridge is the thing the body calls when local layers cannot answer. All bridges extendSCPBridge and implement call(prompt, tools).
OllamaBridge
Free, local, no API key. Default for getting started.OllamaBridge.isAvailable() is a quick health check that returns a boolean and never throws.
BedrockBridge
Wraps the AWS SDK Converse API.@aws-sdk/client-bedrock-runtime is an optional peer dep.
OpenAIBridge
Rawnode:https. No SDK dependency.
Writing a custom bridge
SubclassSCPBridge. Implement call(prompt, tools). Return whatever shape your body expects.
callCount, errorCount, totalDurationMs, and lastCallMs. Read them via bridge.stats().
Cost comparison
Sample run: 100 brain calls during a 10-minute session, ~400 tokens per call.
After the cache learns the typical situations, brain calls drop to a handful per minute and the numbers above shrink proportionally.