.use(...). Plugins add behavior without modifying core code.
Plugin Protocol
A plugin is any Python class implementing optional methods (no base class required):
Plugins use best-effort isolation: any plugin exception will never crash the core pipeline.
Registering Plugins
Example: External RAG Plugin
A complete example that retrieves context from an external service and injects it into the chatbot prompt:Common Use Cases
- External RAG retrieval — call your own service, inject retrieved context
- Logging / metrics — track build and chat operations
- Safety filters / policy checks — validate inputs and outputs