Skip to content

docs: add LangChain and LangGraph integration guide#326

Open
deepak0x wants to merge 1 commit into
openkruise:masterfrom
deepak0x:fix/langchain-langgraph-doc
Open

docs: add LangChain and LangGraph integration guide#326
deepak0x wants to merge 1 commit into
openkruise:masterfrom
deepak0x:fix/langchain-langgraph-doc

Conversation

@deepak0x
Copy link
Copy Markdown

@deepak0x deepak0x commented May 2, 2026

Ⅰ. Describe what this PR does

Adds docs/best-practices/use-langchain-langgraph.md, a how-to guide for using OpenKruise Agents' E2B-compatible API from LangChain and LangGraph agents. It mirrors the layout of the existing use-e2b.md and links to the runnable examples/code_interpreter template and the sdk/customized_e2b shim.

The guide covers:

  • SDK configuration, including the patch_e2b shim for the private protocol
  • A LangChain @tool example that claims a fresh sandbox per call (create_react_agent)
  • A LangGraph workflow that keeps a single sandbox alive across tool calls (shared file / variable state)
  • Operational notes on pool sizing, the OpenKruise e2b.agents.kruise.io/csi-* metadata keys, and timeout configuration

Ⅱ. Does this pull request fix one issue?

fixes #62

Ⅲ. Describe how to verify it

Render the markdown locally (or via the GitHub PR preview) and confirm:

  • All internal links resolve (./use-e2b.md, ../../examples/code_interpreter/sandboxset.yaml, ../../sdk/customized_e2b/README.md).
  • Code blocks parse without syntax errors.
  • The metadata keys and --e2b-max-timeout flag referenced in the doc match examples/code_interpreter/README.md and cmd/sandbox-manager/main.go:82 respectively.

Ⅳ. Special notes for reviews

Pure docs change — no code touched. The location under docs/best-practices/ follows the existing use-e2b.md precedent and answers the open scoping question @Daiwik-1901 raised in the issue thread.

Adds docs/best-practices/use-langchain-langgraph.md walking through how
to use OpenKruise Agents' E2B-compatible API from LangChain and LangGraph
agents. Covers SDK configuration (including the customized_e2b
patch_e2b shim for the private protocol), a one-shot LangChain @tool
example, and a LangGraph workflow that keeps a single sandbox alive
across multiple tool calls.
@kruise-bot kruise-bot requested review from furykerry and zmberg May 2, 2026 16:12
@kruise-bot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign furykerry for approval by writing /assign @furykerry in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot
Copy link
Copy Markdown

Welcome @deepak0x! It looks like this is your first PR to openkruise/agents 🎉

@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.69%. Comparing base (edaad73) to head (88f166c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #326      +/-   ##
==========================================
+ Coverage   74.65%   74.69%   +0.04%     
==========================================
  Files         141      141              
  Lines        9836     9836              
==========================================
+ Hits         7343     7347       +4     
+ Misses       2183     2181       -2     
+ Partials      310      308       -2     
Flag Coverage Δ
unittests 74.69% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc] add langchain/langgraph integration guide

2 participants