Proposal: Extensible hooks and plugin support#414
Draft
araujof wants to merge 6 commits intogenerative-computing:mainfrom
Draft
Proposal: Extensible hooks and plugin support#414araujof wants to merge 6 commits intogenerative-computing:mainfrom
araujof wants to merge 6 commits intogenerative-computing:mainfrom
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 Enforce conventional commitThis rule is failing.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
…esign drifts Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
…onal suggestions by maintainers Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
5f5adeb to
0aee2a0
Compare
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
Author
|
@nrfulton I added an implementation plan document to detail the relevant components of the ContextForge Plugin Framework and required changes to Mellea to introduce the hook system. |
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a design specification for an extensible hook system and plugin framework for Mellea. The hook system provides extension points across the framework's execution lifecycle — from session initialization through component execution, LLM generation, validation, sampling, and cleanup — enabling policy enforcement, observability, customization, and integrations without modifying core library code.
Specification Outline
on_<hook_name>), programmatic registration, or YAML configuration.Specification document
Implementation Plan
The implementation plan defines how Mellea's extensibility hook system will be built on top of the ContextForge plugin framework as an optional dependency. It introduces a new
mellea/plugins/subpackage containing aMelleaHookTypeenum along with Pydantic-based payload models, aMelleaPluginbase class with typed context accessors, and a lazy singletonPluginManagerwrapper with a centralinvoke_hook()helper guarded by three layers of no-op checks for zero overhead when plugins aren't configured. The plan details call sites across Mellea modules, specifying where each hook fires, what payload fields it carries, and whether it supports payload modification (e.g., rewriting model options or requirements) or is observability-only. Session-level configuration is exposed through new optional parameters onstart_session(), and the plugin framework dependency is gated behind try/except ImportError with an optional [plugins] install extra.Implementation plan
Review plan