feat(adapters): added LangGraph and DeepAgents export adapters#80
feat(adapters): added LangGraph and DeepAgents export adapters#80krishvsoni wants to merge 1 commit into
Conversation
- Implemented and functions in to convert agent configurations into LangGraph Python code. - Created a comprehensive test suite in to validate the output of the export functions, ensuring correct handling of agent metadata, skills, tools, skillflows, and hooks. - Added helper functions for YAML rendering and agent directory structure creation to facilitate testing. - Ensured compatibility with existing agent structures by supporting both and directories.
|
This is a serious piece of work. Brutally honest review: What's right:
One thing for a follow-up (not a blocker): Merging. |
|
Hit a clean merge conflict — PR #66 (mcp_servers) just merged minutes before this and also touches Quick rebase needed against the new main. The conflict footprint is tiny: just the two integration files at the bottom of the export switch and the adapters/index re-exports. The actual If you push a rebase, I'll merge same-day (less than an hour if I'm at a keyboard). If easier, I'm happy to rebase locally and force-push to your branch myself — your call. Either way the merge is approved on the substance. Apologies for the conflict — that one was on me. |
feat(adapters): added LangGraph and DeepAgents export adapters
exportToLangGraphandexportToLangGraphStringfunctions insrc/adapters/langgraph.tsto convert agent configurations into LangGraph Python code.exportToDeepAgentsandexportToDeepAgentsStringfunctions insrc/adapters/deepagents.tsto emit acreate_deep_agent(...)LangChain DeepAgents harness — skills, tools, and sub-agents map directly; no graph wiring.src/adapters/langgraph.test.ts(18 tests) andsrc/adapters/deepagents.test.ts(13 tests) to validate the output of the export functions, ensuring correct handling of agent metadata, skills, tools, skillflows, hooks, and sub-agents.skillflows/andworkflows/directories.What
Adds two new export adapters to gitagent:
langgraph: converts a gitagent directory into a runnable LangGraphStateGraphPython module. Skills become nodes,skillflows/*.yamlbecomeadd_edge/add_conditional_edges,tools/*.yamlbind to aToolNode,pre_tool_usehooks become abefore_toolcallback, andagents/<name>/become nested compiledStateGraphs.deepagents: converts a gitagent directory into acreate_deep_agent(...)call. Skills are passed viaskills=["./skills"](DeepAgents reads eachSKILL.mdnatively), tools are@tooldefs intools=[...], and sub-agents becomeSubAgentdicts insubagents=[...]. Use this when you want the model to orchestrate planning and delegation instead of authoring a graph by hand.Why
Issue #1 has been open since Feb 27 and the @shreyas-lyzr 's most recent comment asked for LangGraph proper as the natural sibling of the in-flight LangChain adapter (PR #16), with the explicit mapping
agent.yaml → StateGraph config,skills/ → nodes,skillflows/*.yaml → edges + conditional routing. The maintainer's earlier comment in the same thread linked the DeepAgents overview as a possible alternative — shipping it as a sibling adapter gives users both paths (explicit graph wiring vs. LLM-orchestrated harness) without forcing a choice.Closes #1
How Tested
npm run buildpassesgitagent validatepasses on example agentsRan both adapters end-to-end against
examples/langgraph,examples/deepagents, and the bundledexamples/fullcompliance agent (sub-agents, workflow withdepends_on, hooks, FINRA / Federal Reserve / SEC compliance block). Diffed each export against the committedexpected_output.pyand verified syntactic validity withast.parse. Full suite is 60/60 across 11 suites — 18 new LangGraph tests + 13 new DeepAgents tests, no pre-existing tests modified.Checklist