LangGraph component for CodeAct architecture
Top 57.4% on sourcepulse
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
pip install langgraph-codeact
pip install langchain langchain-anthropic
Highlighted Details
.invoke()
for final results and .stream()
for token-by-token output.Maintenance & Community
Licensing & Compatibility
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.
2 months ago
1 week