feat(providers): route graph extraction via AGENTMEMORY_GRAPH_MODEL#954
feat(providers): route graph extraction via AGENTMEMORY_GRAPH_MODEL#954shgew wants to merge 1 commit into
Conversation
Add an optional AGENTMEMORY_GRAPH_MODEL env that routes mem::graph-extract through a dedicated provider with its own model. When unset, the active provider's model is used (today's behavior). The graph provider is a separate ResilientProvider instance, so its concurrency limiter and circuit breaker are independent of the summarize provider. Why: a relation-native or lighter graph model often outperforms the main reasoning model on graph extraction. With one shared provider, no way to mix them; the summarize model is forced on the extraction step too. How: resolveGraphProviderConfig derives a graph config by overriding model on the active config. main() constructs the dedicated provider with the same fallback chain. Side effect: AGENTMEMORY_LLM_CONCURRENCY no longer bottlenecks the pair; summarize and graph-extract can now issue outbound calls in parallel up to one per provider. Complementary to PR rohitg00#900 (AGENTMEMORY_COMPRESS_MODEL): compress and graph operate at distinct stages. Both can coexist after rohitg00#900 lands - the two model overrides are independent fields on ProviderConfig. Tests: test/graph-provider-routing.test.ts (new file). Signed-off-by: Hleb Shauchenka <me@marleb.org>
|
@shgew is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds ChangesGraph Provider Routing
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Add an optional
AGENTMEMORY_GRAPH_MODELenv that routesmem::graph-extractthrough a dedicated provider whose model overrides the active provider model. When unset, the active provider's model is used (current behavior). The graph provider is a separateResilientProviderinstance, so its concurrency limiter and circuit breaker are independent of the summarize provider.Why
A relation-native or lighter graph model often outperforms the main reasoning model on graph extraction. With one shared provider there is no way to mix them; the summarize model is forced on the extraction step too.
How
resolveGraphProviderConfigderives a graph config by overriding model on the active config.main()constructs the dedicated graph provider with the same fallback chain.Side effect:
AGENTMEMORY_LLM_CONCURRENCYno longer bottlenecks the pair; summarize and graph-extract can now issue outbound calls in parallel up to one per provider.Complementarity with #900
Complementary to open PR #900 (
AGENTMEMORY_COMPRESS_MODEL): compress and graph operate at distinct stages. Both can coexist after #900 lands - the two model overrides are independent fields onProviderConfig.Tests
test/graph-provider-routing.test.ts(new file, 2 cases). Targeted suite: 2/2 pass.Compatibility
Unset env = no behavior change.
Summary by CodeRabbit
New Features
AGENTMEMORY_GRAPH_MODELenvironment variable. When configured, graph extraction can use a different provider/model than other operations.Documentation