Skip to content

dairdr/react-agent-with-tools

Repository files navigation

New LangGraph Project

CI Integration Tests

This template demonstrates a simple application implemented using LangGraph, designed for showing how to get started with LangGraph Server and using LangGraph Studio, a visual debugging IDE.

Graph view in LangGraph studio UI

The core logic defined in src/agent/graph.py, showcases an single-step application that responds with a fixed string and the configuration provided.

You can extend this graph to orchestrate more complex agentic workflows that can be visualized and debugged in LangGraph Studio.

Getting Started

This project uses Python 3.12 and uv for dependency management and virtual environment handling.

Prerequisites

  • Python 3.12
  • uv (install with curl -LsSf https://astral.sh/uv/install.sh | sh)

Setup

  1. Clone the repository and navigate to the project directory:
cd path/to/your/app
  1. Create a virtual environment and install dependencies using uv:
uv sync

This will:

  • Create a virtual environment with Python 3.12 in .venv/
  • Install all project dependencies
  • Install development dependencies
  1. (Optional) Customize the code and project as needed. Create a .env file if you need to use secrets.
cp .env.example .env

If you want to enable LangSmith tracing, add your LangSmith API key to the .env file.

# .env
LANGSMITH_API_KEY=lsv2...
  1. Start the LangGraph Server:
uv run langgraph dev

Development Commands

All commands should be run with uv run to ensure you're using the correct Python environment:

# Run tests
uv run python -m pytest

# Run linting
uv run python -m ruff check .

# Format code
uv run ruff format .

# Type checking
uv run python -m mypy src/

# Or use the Makefile targets
make test
make lint
make format

For more information on getting started with LangGraph Server, see here.

How to customize

  1. Define configurable parameters: Modify the Configuration class in the graph.py file to expose the arguments you want to configure. For example, in a chatbot application you may want to define a dynamic system prompt or LLM to use. For more information on configurations in LangGraph, see here.

  2. Extend the graph: The core logic of the application is defined in graph.py. You can modify this file to add new nodes, edges, or change the flow of information.

Development

While iterating on your graph in LangGraph Studio, you can edit past state and rerun your app from previous states to debug specific nodes. Local changes will be automatically applied via hot reload.

Follow-up requests extend the same thread. You can create an entirely new thread, clearing previous history, using the + button in the top right.

For more advanced features and examples, refer to the LangGraph documentation. These resources can help you adapt this template for your specific use case and build more sophisticated conversational agents.

LangGraph Studio also integrates with LangSmith for more in-depth tracing and collaboration with teammates, allowing you to analyze and optimize your chatbot's performance.

About

A ReAct agent with tools access

Resources

License

Stars

Watchers

Forks

Packages

No packages published