Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building AI Agents with LangGraph - End-to-End Guide

Overview

This repository demonstrates how to build agentic AI applications using LangGraph framework - a library for building stateful, multi-agent applications with LangChain.

Prerequisites

  • Python 3.8+
  • pip
  • Basic understanding of LangChain
  • OpenAI API key

Installation

pip install langgraph langchain openai

Project Structure

.
├── README.md
├── agents/
│   ├── planner.py
│   └── executor.py
├── main.py
└── config.py

Key Components

  1. Agent Types

    • Planner Agent: Breaks down tasks into subtasks
    • Executor Agent: Performs specific actions
    • Supervisor Agent: Monitors and coordinates
  2. Graph Structure

    • Defines agent interactions
    • Manages state transitions
    • Handles message passing

Basic Implementation

from langgraph.graph import StateGraph
from langchain_core.messages import HumanMessage

# Define graph structure
graph = StateGraph()

# Add nodes and edges
graph.add_node("planner")
graph.add_node("executor")

# Configure state transitions
graph.set_entry_point("planner")

Running the Application

python main.py

Best Practices

  • Use environment variables for API keys
  • Implement error handling
  • Add logging for debugging
  • Test agent interactions thoroughly

Contributing

Pull requests are welcome. For major changes, please open an issue first.

License

MIT

About

Seamless agentic ai framework !

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages