langchain - ✅(Solved) Fix Expose Deep Agent Harness as Composable LangGraph Primitives [1 pull requests, 4 comments, 5 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langchain-ai/langchain#36310Fetched 2026-04-08 01:41:00
View on GitHub
Comments
4
Participants
5
Timeline
11
Reactions
3
Timeline (top)
commented ×4labeled ×3cross-referenced ×2issue_type_added ×1

PR fix notes

PR #7415: feat(langgraph) - Deep Agent middleware feature as reusable components

Description (problem / solution / changelog)

Fixes #36310 https://github.com/langchain-ai/langchain/issues/36310

<!-- Replace everything above this line with a 1-2 sentence description of your change. Keep the "Fixes #xx" keyword and update the issue number. -->

Read the full contributing guidelines: https://docs.langchain.com/oss/python/contributing/overview

All contributions must be in English. See the language policy.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

  1. PR description: This branch introduces two new public functions to libs/prebuilt:
  • create_agent_node: a lower-level counterpart to create_react_agent that returns just the LLM-calling node (rather than a full compiled graph), giving users full control over graph topology, custom pre/post-LLM nodes, and multi-graph reuse. It supports dynamic model selection, tool binding, prompt injection, remaining_steps safety, and a llm_input_messages convention for pre-model-hook nodes.
  • get_prompt_runnable: exposes the previously private _get_prompt_runnable helper so users can apply the same prompt-wrapping logic when building their own custom nodes.
  1. Run make format, make lint and make test from the root of the package(s) you've modified.
  • We will not consider a PR unless these three are passing in CI.
  1. How did you verify your code works? Added test_agent_node.py to make sure the code works as expected Additional guidelines:
  • All external PRs must link to an issue or discussion where a solution has been approved by a maintainer, and you must be assigned to that issue. PRs without prior approval will be closed.
  • PRs should not touch more than one package unless absolutely necessary.
  • Do not update the uv.lock files or add dependencies to pyproject.toml files (even optional ones) unless you have explicit permission to do so by a maintainer.

Social handles (optional)

<!-- If you'd like a shoutout on release, add your socials below -->

Twitter: @ LinkedIn: https://www.linkedin.com/in/ninaadrrao/

Changed files

  • libs/prebuilt/langgraph/prebuilt/__init__.py (modified, +7/-1)
  • libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py (modified, +295/-1)
  • libs/prebuilt/tests/test_agent_node.py (added, +261/-0)
RAW_BUFFERClick to expand / collapse

Checked other resources

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Feature Description

Currently, create_deep_agent provides a powerful agent harness with features like planning, memory, sub-agents, and filesystem tools. However, these capabilities are bundled inside a higher-level abstraction that hides the underlying LangGraph.

This makes it difficult to:

  • Inspect and understand the execution graph
  • Customize behavior with custom nodes
  • Extend or override specific parts of the system

I would like LangChain to expose these harness features as standalone, composable primitives that can be used directly within LangGraph.

This would allow users to:

  • Retain full control and visibility of their graphs
  • Reuse powerful built-in components
  • Avoid being locked into higher-level abstractions

Use Case

I'm building production-grade agent workflows using LangGraph, where I need:

  • Fine-grained control over execution
  • The ability to insert custom nodes
  • Clear mental models for debugging and reasoning

Currently, I have to:

  • Either use create_deep_agent and lose flexibility
  • Or rebuild similar functionality manually in LangGraph

This feature would allow me (and others) to:

  • Compose advanced agent systems directly in LangGraph
  • Reuse official LangChain components without abstraction overhead
  • Scale systems cleanly from simple to complex use cases

Proposed Solution

Expose Deep Agent (including create_agent middleware) features as modular, reusable components.

Additionally:

  • Provide reference implementations of deep agents built directly in LangGraph
  • Document how to compose these primitives into full systems

Alternatives Considered

I've tried:

  • Using create_deep_agent directly
  • Rebuilding features manually in LangGraph

Alternative approaches:

  1. Use abstraction → fast but limiting
  2. Build everything manually → flexible but time-consuming

Additional Context

This request reflects a broader need for a "middle layer" between:

  • Low-level LangGraph primitives
  • High-level abstractions like Deep Agents

Providing composable primitives would make LangGraph the primary interface, while still offering convenience.

extent analysis

Fix Plan

To address the feature request, we will expose the Deep Agent features as modular, reusable components in LangGraph. Here are the steps:

  • Step 1: Refactor create_deep_agent
    • Break down the create_deep_agent function into smaller, independent functions, each responsible for a specific feature (e.g., planning, memory, sub-agents, filesystem tools).
    • Example:

def create_planner(): # planner implementation pass

def create_memory(): # memory implementation pass

def create_sub_agents(): # sub-agents implementation pass

def create_filesystem_tools(): # filesystem tools implementation pass

* **Step 2: Create Composable Primitives**
  * Create a new module that exports the refactored functions as composable primitives.
  * Example:
  ```python
from langchain import Planner, Memory, SubAgents, FilesystemTools

class ComposableDeepAgent:
    def __init__(self, planner, memory, sub_agents, filesystem_tools):
        self.planner = planner
        self.memory = memory
        self.sub_agents = sub_agents
        self.filesystem_tools = filesystem_tools

    def execute(self):
        # execute the composable deep agent
        pass
  • Step 3: Provide Reference Implementations
    • Create reference implementations of deep agents built directly in LangGraph using the composable primitives.
    • Example:

from langchain import ComposableDeepAgent, Planner, Memory, SubAgents, FilesystemTools

class MyDeepAgent(ComposableDeepAgent): def init(self): planner = Planner() memory = Memory() sub_agents = SubAgents() filesystem_tools = FilesystemTools() super().init(planner, memory, sub_agents, filesystem_tools)

def execute(self):
    # custom execution logic
    pass
* **Step 4: Document Composable Primitives**
  * Document how to compose the primitives into full systems, including examples and use cases.

### Verification
To verify that the fix worked, test the composable primitives and reference implementations in LangGraph. Ensure that the primitives can be composed to create custom deep agents with fine-grained control over execution and the ability to insert custom nodes.

### Extra Tips
* Consider adding a tutorial or guide on how to use the composable primitives to build custom deep agents.
* Provide examples of how to extend or override specific parts of the system using the composable primitives.
* Ensure that the composable primitives are well-documented and follow standard naming conventions and coding practices.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

langchain - ✅(Solved) Fix Expose Deep Agent Harness as Composable LangGraph Primitives [1 pull requests, 4 comments, 5 participants]