Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt

Use this file to discover all available pages before exploring further.

deepagents is LangChain’s framework for long-horizon coding agents. It accepts a pluggable backend for filesystem and shell operations, Mirage ships one.
Node only. The Mirage adapter is runtime-agnostic, but deepagents and the LangChain runtime depend on Node APIs.

Install

pnpm add @struktoai/mirage-agents @struktoai/mirage-node deepagents @langchain/anthropic

Usage

import { MountMode, OpsRegistry, RAMResource, Workspace } from '@struktoai/mirage-node'
import { ChatAnthropic } from '@langchain/anthropic'
import { createDeepAgent } from 'deepagents'
import {
  LangchainWorkspace,
  buildSystemPrompt,
  extractText,
} from '@struktoai/mirage-agents/langchain'

const ram = new RAMResource()
const ops = new OpsRegistry()
for (const op of ram.ops()) ops.register(op)
const ws = new Workspace({ '/': ram }, { mode: MountMode.WRITE, ops })

const agent = createDeepAgent({
  model: new ChatAnthropic({ model: 'claude-sonnet-4-6' }),
  systemPrompt: buildSystemPrompt({
    mountInfo: { '/': 'In-memory filesystem (read/write)' },
  }),
  backend: new LangchainWorkspace(ws),
})

const result = await agent.invoke({
  messages: [{ role: 'user', content: 'Create /report.md and summarize.' }],
})
for (const text of extractText(result.messages)) {
  console.log(text)
}

Exports

SymbolPurpose
LangchainWorkspaceBackend implementation for deepagents, wires reads, writes, edits, and shell.
extractTextReturns string[] of text blocks from an array of LangChain messages.
buildSystemPromptGenerates a system prompt that describes mounted paths to the model.

Examples