LangGraph is an OSS library for building stateful, multi-actor applications with LLMs, specifically designed for agent and multi-agent workflows. The framework supports critical agent architecture features including persistent memory across conversations and human-in-the-loop capabilities through checkpointed states.
In this simple example we augment an LLM with a calculator tool!
Copy
Ask AI
import osfrom langchain_together import ChatTogetherllm = ChatTogether(model="meta-llama/Llama-3.3-70B-Instruct-Turbo", api_key=os.getenv("TOGETHER_API_KEY"))# Define a tooldef multiply(a: int, b: int) -> int: return a * b# Augment the LLM with toolsllm_with_tools = llm.bind_tools([multiply])# Invoke the LLM with input that triggers the tool callmsg = llm_with_tools.invoke("What is 2 times 3?")# Get the tool callmsg.tool_calls