Open SWE includes support for LangGraph development through the LangGraph Engineer toggle. This feature adds framework-specific prompts and MCP tools for building LangGraph agents and workflows. You can use a similar approach to build your own customization.

LangGraph Engineer Configuration

Setting Configuration in the UI

Enabling the LangGraph Engineer toggle in the main input area adds specific LangGraph prompts and allows LangGraph documentation access. This sets the following configuration:
const config = {
  configurable: {
    customFramework: true
  }
}

How Custom Framework Configuration Works

The configuration is passed to all agent nodes and used to conditionally include specialized prompts:
// In prompt formatting functions
.replace(
  "{CUSTOM_FRAMEWORK_PROMPT}",
  shouldUseCustomFramework(config) ? CUSTOM_FRAMEWORK_PROMPT : "",
)
The shouldUseCustomFramework(config) function checks if config.configurable?.customFramework === true.

Custom Framework Files

When customFramework is true, we inject a series of custom prompts and tools into the agent. The table below shows every place in the codebase that needs updating if you’re customizing it for a framework other than LangGraph.

Prompt Files

ComponentFilePrompt ConstantDescription
Plannerprompt.tsEXTERNAL_FRAMEWORK_DOCUMENTATION_PROMPTAdds framework documentation access instructions
Plannerprompt.tsEXTERNAL_FRAMEWORK_PLAN_PROMPTProvides framework-specific planning requirements
Programmerprompt.tsCUSTOM_FRAMEWORK_PROMPTComprehensive framework implementation patterns and best practices
Reviewerprompt.tsCUSTOM_FRAMEWORK_PROMPTFramework validation and testing requirements

Agent & UI Configuration Files

ComponentFileDescription
Toggle Buttondefault-view.tsxContains the LangGraph Engineer toggle button - modify this to add your own button or change the existing one
Framework Logicshould-use-custom-framework.tsLogic function that determines when to enable custom framework features. Currently a boolean based on the UI toggle
Documentationconstants.tsMCP server configuration for framework documentation access

Customizing for Your Own Framework

Follow these steps to adapt Open SWE for your own framework:

Modify Prompt Constants

  1. Update prompt files from the table above to replace LangGraph-specific content:
    • Replace CUSTOM_FRAMEWORK_PROMPT with your framework’s patterns
    • Update EXTERNAL_FRAMEWORK_DOCUMENTATION_PROMPT with your docs access instructions
    • Modify EXTERNAL_FRAMEWORK_PLAN_PROMPT with your planning requirements

Update UI Configuration

  1. Modify the toggle button in default-view.tsx:
    • Change button text from “LangGraph Engineer” to your framework name
    • Update tooltip text and descriptions
  2. Optional: Create a new toggle button for your framework while keeping the LangGraph one

Configure Framework Logic

You can either:
  • Reuse the existing customFramework: true configuration and modify the prompts to match your framework instead of LangGraph (no additional code changes needed)
  • Create a separate config variable by adding a new field in your graph configuration (e.g., yourFramework: true) and adding the detection logic similar to should-use-custom-framework.ts

Add Documentation Access

  1. Configure MCP servers in constants.ts:
    export const DEFAULT_MCP_SERVERS = {
      "your-framework-docs-mcp": {
        command: "uvx",
        args: ["your-framework-docs-mcp"],
      },
    };
    

Build and Test

  1. Rebuild the application:
    cd apps/open-swe
    yarn build
    
  2. Test your customization by enabling the toggle and verifying framework-specific prompts are used