opengap icon indicating copy to clipboard operation
opengap copied to clipboard

[Adapter] LangChain export/runner

Open shreyas-lyzr opened this issue 9 months ago • 3 comments

Summary

Add a LangChain adapter to gitagent, enabling export and run support for the LangChain framework.

Details

LangChain is one of the most widely adopted LLM frameworks. A gitagent adapter would allow users to:

  • Export: Convert a gitagent agent definition to LangChain agent configuration
  • Run: Execute a gitagent-defined agent using the LangChain runtime

Acceptance Criteria

  • [ ] gitagent export --format langchain generates valid LangChain Python code
  • [ ] gitagent run ./agent --adapter langchain executes the agent
  • [ ] Documentation added to README adapter table
  • [ ] Example added to examples/

Resources

shreyas-lyzr avatar Feb 26 '26 23:02 shreyas-lyzr

Apologies for the long silence — PR #16 by @AJAmit17 implements LangChain export + runner with multi-provider support. I've left a detailed review there asking for a rebase against current main (the PR predates several command refactors, the rebrand to @open-gitagent/gapman, and the new kiro/gitclaw adapters). Once that lands I'll close this issue.

shreyas-lyzr avatar May 04 '26 15:05 shreyas-lyzr

PR #81 addresses this issue with a clean rebase of the original #16. It is currently in review. A quick status note:

  • The adapter (src/adapters/langchain.ts) and runner (src/runners/langchain.ts) are both present
  • Provider detection covers OpenAI (gpt-, o1/o2/o3/o4-) and Anthropic (claude-*)
  • Unit tests are included (langchain.test.ts)
  • Documentation is in docs/adapters/langchain.md

Two blocking issues flagged in the PR review: (1) the venv bootstrap on first run gives no user-visible progress, and (2) unsupported models hard-error with no fallback. Once those are addressed the PR should be mergeable.

Tracking here — will close this issue when #81 merges.

shreyas-lyzr avatar May 24 '26 09:05 shreyas-lyzr

PR #81 (feat/langchain-rebased by @AJAmit17) directly addresses this issue and is currently open for review. The implementation covers export to standalone LangChain Python scripts with multi-provider support (OpenAI + Anthropic), tool integration, sub-agent delegation, and memory handling.

A few items from the PR review that need resolution before close:

  • The export.ts caller has no try/catch around the langchain case — unhandled exceptions will crash the CLI on unsupported models
  • The detectProvider export widens the public API surface for an internal function
  • Naming convention: exportToLangChain vs the established exportTo*String pattern

Once those are addressed in PR #81, this issue can be closed. Assigning @shreyas-lyzr to track the PR to merge.

shreyas-lyzr avatar May 25 '26 09:05 shreyas-lyzr