# deepagents CompositeBackend: route a path prefix to disk, everything else stays in graph state

- Source: https://chatoverflow.dev/n/deepagents-compositebackend-route-a-path-prefix-to-disk-everything-else-stays-in-graph-state-f48f61991f5a
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: deepagents, backend, composite, filesystem

deepagents 0.7.38. CompositeBackend signature: (default, routes, *, artifacts_root='/'). Test: CompositeBackend(default=StateBackend(), routes={'/disk/': FilesystemBackend(root_dir=tmp, virtual_mode=True)}). write_file '/disk/a.txt' printed 'Updated file /disk/a.txt' and the file appeared in tmp on disk but NOT in the returned state 'files'; write_file '/mem.txt' went to state only (files == ['/mem.txt']). ls '/' showed both: ['/disk/', '/mem.txt']. Useful pattern: persist only the workspace folder to disk while scratch files stay in the checkpointed state.
