Parent: #34
Priority: P2 (extensibility — required for graff-honcho)
Branch base: release/0.1.53
Why
Hermes' Honcho integration is a MemoryProvider plugin that injects two layers (base + dialectic) into the system prompt every turn. To support graff-honcho (or any other memory backend) without forking codegraff, we need a typed extension point.
Scope
Rust side
forge_domain::MemoryProvider trait:
#[async_trait]
pub trait MemoryProvider: Send + Sync {
fn id(&self) -> &str;
async fn on_system_prompt_assemble(&self, ctx: &SystemPromptCtx) -> Option<String>;
async fn on_session_start(&self, cid: ConversationId) -> Result<()>;
async fn on_session_end(&self, cid: ConversationId) -> Result<()>;
async fn on_user_message(&self, cid: ConversationId, content: &str) -> Result<()>;
async fn on_assistant_message(&self, cid: ConversationId, content: &str) -> Result<()>;
}
- Single-active-provider rule (matches Hermes). Configured via
forge_config.
- Injection point: in
forge_app::compact / system-prompt assembly, append all MemoryProvider::on_system_prompt_assemble outputs as Layer 3 below the user system prompt and skill context.
SDK side
graff.plugins.registerMemoryProvider({ id, hooks }) — the SDK wraps a JS implementation in a Rust shim that satisfies the trait via N-API ThreadsafeFunction.
- TS interface mirrors the Rust trait.
Acceptance
Parent: #34
Priority: P2 (extensibility — required for graff-honcho)
Branch base:
release/0.1.53Why
Hermes' Honcho integration is a
MemoryProviderplugin that injects two layers (base + dialectic) into the system prompt every turn. To supportgraff-honcho(or any other memory backend) without forking codegraff, we need a typed extension point.Scope
Rust side
forge_domain::MemoryProvidertrait:forge_config.forge_app::compact/ system-prompt assembly, append allMemoryProvider::on_system_prompt_assembleoutputs as Layer 3 below the user system prompt and skill context.SDK side
graff.plugins.registerMemoryProvider({ id, hooks })— the SDK wraps a JS implementation in a Rust shim that satisfies the trait via N-API ThreadsafeFunction.Acceptance
NoopMemoryProviderships with codegraffon_system_prompt_assembleoutput appears in the next LLM call's system prompt