feat(adapter): add LangGraph export and run adapter#26
feat(adapter): add LangGraph export and run adapter#26dahlinomine wants to merge 1 commit intoopen-gitagent:mainfrom
Conversation
|
can we create a adapter for DeepAgents instead? https://docs.langchain.com/oss/python/deepagents/overview |
|
Thanks for the direction! I've replaced the LangGraph adapter with a Deep Agents one: #29 It uses |
|
Closing alongside #27 — this PR adds adapter and runner files but doesn't wire them into |
|
Thanks @shreyas-lyzr — fair points. Standalone adapter and runner files without the core wiring don't really complete the feature. I'll close this and resubmit as a proper PR: full wiring into |
- src/adapters/langgraph.ts: full StateGraph export with SOUL.md/RULES.md/ skills/knowledge/compliance mapping, @tool stubs from tools/*.yaml, and HITL nodes for human_in_the_loop (always/conditional) - src/runners/langgraph.ts: runner that generates agent.py + isolated venv + pip install, executes via python agent.py [--prompt] - src/adapters/langgraph.test.ts: 20 node:test unit tests covering export structure, model routing (Claude/OpenAI/Gemini), HITL wiring, requirements - docs/adapters/langgraph.md: full field mapping, graph diagrams, model resolution table, compliance mapping, usage examples - src/adapters/index.ts: add exportToLangGraphString, exportToLangGraph - src/commands/export.ts: wire langgraph case + update format description - src/commands/run.ts: wire langgraph case + import runWithLangGraph
25f94a0 to
9139369
Compare
|
Update: rather than close and resubmit, I've pushed the complete implementation directly to this branch. Here's what's now included: New files:
Wired into core:
Follows the same patterns as the |
Summary
Adds
langgraphas a new export format and run adapter.Closes #1.
Changes
src/adapters/langgraph.ts— exports a gitagent directory as a LangGraphStateGraphPython script using the ReAct pattern withToolNodeand conditional routingsrc/runners/langgraph.ts— runs the exported graph script viapython3agent.yamlare annotated with guidance for LangGraph supervisor-node patternsSYSTEM_PROMPTconstantgpt-4odefault,claude-*→ChatAnthropic,gemini-*→ChatGoogleGenerativeAIUsage
Generated output example
Given an agent with a
researchskill andclaude-3-5-sonnet-20241022model:Testing
npm run buildpassesgitagent export -f langgraph -d examples/standardproduces valid Pythongitagent export -f langgraph -d examples/fullrenders compliance constraintsChecklist
adapters/index.ts,commands/export.ts,commands/run.ts