Skip to content

Add LangGraph framework starter #84

@justinmadison

Description

@justinmadison

Summary

Add a LangGraph framework starter that teaches developers how to use LangGraph by building an agent that plays Agent Arena scenarios. This is Phase 2 of the framework adapter system.

Key framing: "Want to learn LangGraph? Build an AI agent that plays a game." This starter is a tutorial for LangGraph, not just a template.

Prerequisites

Deliverables

LangGraph Starter (starters/langgraph/)

File Purpose
agent.py LangGraph adapter + agent graph with tutorial comments
run.py One-command startup
requirements.txt agent-arena-sdk, langgraph, langchain-anthropic (or langchain-openai)
README.md Learning goals, setup, how to modify, debugging

What It Teaches

  • Graph construction — StateGraph, nodes, edges, conditional routing
  • Tool nodesStructuredTool.from_function(), ToolNode
  • State management — LangGraph state schema, message passing
  • ReAct pattern — tool calling loop with action detection
  • Checkpointing — LangGraph memory (optional section)

Architecture

The LangGraph starter uses the adapter base from #74:

class LangGraphAdapter(FrameworkAdapter):
    def decide(self, observation: Observation) -> Decision:
        # 1. Format observation as context (inherited from base)
        context = self.format_observation(observation)
        
        # 2. Convert action tools to LangChain StructuredTools
        tools = [StructuredTool.from_function(...) for t in self.get_action_tools()]
        
        # 3. Build and invoke LangGraph agent
        result = self.graph.invoke({"messages": [HumanMessage(context)]})
        
        # 4. Extract action tool call from result, return as Decision
        return self._extract_decision(result)

Tests

  • Unit tests for LangGraph adapter (mock LLM responses)
  • Verify tool schema conversion to LangChain format
  • Integration test with hand-built Observations

Success Criteria

Context

See docs/framework_integration_strategy.md for the full strategic discussion. This is Phase 2 of the framework integration roadmap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions