LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsnodeBackendFactory
Type●Since v1.10Deprecated

BackendFactory

Factory function type for creating backend instances.

Backends receive BackendRuntime which contains the current state and runtime information, extracted from the execution context.

Copy
BackendFactory: (runtime: BackendRuntime) => MaybePromise<AnyBackendProtocol>

Example

Copy
// Using in middleware
const middleware = createFilesystemMiddleware({
  backend: (runtime) => new StateBackend(runtime)
});
View source on GitHub