Is your feature request related to a problem? Please describe.
@cap-js/agents currently does not expose a first-class way to configure the 'backends' when using the default LangChain agent builders:
- custom filesystem backends
- overriding existing mounts
The createDeepAgent creates a hard-coded CompositeBackend(new StateBackend(), ...) and only mounts built-in routes like /uploads/, /outputs/, and /skills/
As a result, upstream LangChain/deepagents patterns such as mounting custom backends under /memories/, /docs/, /workspace/, or overriding an existing route are not available unless the application fully overrides buildGraph and constructs the agent manually.
This feels inconsistent with the plugin's otherwise fine-grained event-based extension model (buildTools, buildModel, buildSystemPrompt, buildMiddleware, buildGraph).
Describe the solution you'd like
Expose backend configuration as a first-class extension point in @cap-js/agents, so applications can add or override filesystem backend mounts without replacing the full graph construction.
Proposed extension: buildBackend event
This should apply consistently to both:
- Deep Agents via
createDeepAgent({ backend })
- ReAct agents via
createFilesystemMiddleware({ backend })
This should allow use cases like:
- mounting long-term memory under
/memories/ using StoreBackend (see LangChain memory docs)
- mounting documentation under
/docs/ using Wiki-backed custom backend
- mounting project/workspace content under custom paths
- overriding or extending built-in routes like
/uploads/ or /outputs/
Describe alternatives you've considered
-
Override buildGraph completely and construct the LangChain/deepagents graph manually
This works by copying the current createAutoDeepAgent implementation, but it is much heavier than overriding a single concern and bypasses the plugin's ergonomic default wiring.
-
For ReAct agents, push backend concerns into buildMiddleware (for. eg. createFilesystemMiddleware({ backend })) but Deep Agents need a backend directly via createDeepAgent({ backend }), so a dedicated backend extension point seems cleaner.
Additional context
Repository observations:
lib/agents/markdown/deep-agent.js creates a CompositeBackend(new StateBackend(), additionalBackends) with only the built-in routes:
/uploads/
/outputs/
./skills/
/skills/
Have you already checked existing issues before creating a feature request?
Yes, no existing issues were found.
Customer Info
None. CAP fan who sees a big potential with this plugin :)
Is your feature request related to a problem? Please describe.
@cap-js/agentscurrently does not expose a first-class way to configure the 'backends' when using the default LangChain agent builders:The
createDeepAgentcreates a hard-codedCompositeBackend(new StateBackend(), ...)and only mounts built-in routes like/uploads/,/outputs/, and/skills/As a result, upstream LangChain/deepagents patterns such as mounting custom backends under
/memories/,/docs/,/workspace/, or overriding an existing route are not available unless the application fully overridesbuildGraphand constructs the agent manually.This feels inconsistent with the plugin's otherwise fine-grained event-based extension model (
buildTools,buildModel,buildSystemPrompt,buildMiddleware,buildGraph).Describe the solution you'd like
Expose backend configuration as a first-class extension point in
@cap-js/agents, so applications can add or override filesystem backend mounts without replacing the full graph construction.Proposed extension:
buildBackendeventThis should apply consistently to both:
createDeepAgent({ backend })createFilesystemMiddleware({ backend })This should allow use cases like:
/memories/usingStoreBackend(see LangChain memory docs)/docs/using Wiki-backed custom backend/uploads/or/outputs/Describe alternatives you've considered
Override
buildGraphcompletely and construct the LangChain/deepagents graph manuallyThis works by copying the current
createAutoDeepAgentimplementation, but it is much heavier than overriding a single concern and bypasses the plugin's ergonomic default wiring.For ReAct agents, push backend concerns into
buildMiddleware(for. eg.createFilesystemMiddleware({ backend })) but Deep Agents need a backend directly viacreateDeepAgent({ backend }), so a dedicated backend extension point seems cleaner.Additional context
Repository observations:
lib/agents/markdown/deep-agent.jscreates aCompositeBackend(new StateBackend(), additionalBackends)with only the built-in routes:/uploads//outputs/./skills//skills/Have you already checked existing issues before creating a feature request?
Yes, no existing issues were found.
Customer Info
None. CAP fan who sees a big potential with this plugin :)