langgraph-codeact  by langchain-ai

LangGraph component for CodeAct architecture

Created 6 months ago
609 stars

Top 53.9% on SourcePulse

GitHubView on GitHub
Project Summary

This library implements the CodeAct architecture for complex task solving using LangGraph, offering an alternative to JSON function calling. It enables agents to leverage a Turing-complete language like Python for tool output transformation and combination, benefiting users who need to solve multi-step problems with greater flexibility.

How It Works

The CodeAct architecture utilizes a Python code sandbox to execute tool outputs and intermediate results. It maintains message history and saves Python variables between turns, allowing for more sophisticated follow-up questions and complex computations. This approach allows agents to use the full power of Python to combine and transform outputs from multiple tools, rather than being limited to structured JSON outputs.

Quick Start & Requirements

  • Install: pip install langgraph-codeact
  • Example dependencies: pip install langchain langchain-anthropic
  • Requires a LangChain-compatible model (tested with Claude 3.7).
  • Official example: here

Highlighted Details

  • Implements the CodeAct architecture, used by Manus.im.
  • Supports custom tools, LangChain tools, and MCP tools.
  • Allows customization of the system message and the code sandbox.
  • Offers .invoke() for final results and .stream() for token-by-token output.

Maintenance & Community

  • Project maintained by langchain-ai.
  • No specific community links (Discord/Slack) or roadmap mentioned in the README.

Licensing & Compatibility

  • The README does not explicitly state a license.

Limitations & Caveats

The provided eval function for the code sandbox is for demonstration purposes only and is not safe for production use. A warning advises using a secure LangChain Sandbox for production environments.

Health Check
Last Commit

4 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
2
Star History
25 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.