Tonic commited on
Commit
89b0f96
·
verified ·
1 Parent(s): 229c4e4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +86 -1
README.md CHANGED
@@ -1,12 +1,97 @@
1
  ---
2
  title: README
3
- emoji: 🏆
4
  colorFrom: blue
5
  colorTo: yellow
6
  sdk: static
7
  pinned: false
8
  ---
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  # LangGraph Agent Chat UI
11
 
12
  This project provides a simple, intuitive user interface (UI) for interacting with LangGraph agents. It's built with React and Vite, offering a responsive chat-like experience for testing and demonstrating your LangGraph deployments. It's designed to work seamlessly with LangGraph's core concepts, including checkpoints, thread management, and human-in-the-loop capabilities.
 
1
  ---
2
  title: README
3
+ emoji: 🦜💹
4
  colorFrom: blue
5
  colorTo: yellow
6
  sdk: static
7
  pinned: false
8
  ---
9
 
10
+
11
+ # 🙋🏻‍♂️Welcome to the 🦜LangGraph User Group! 🚀
12
+
13
+ Welcome to the LangGraph User Group! We're a community of developers and researchers exploring and building with LangGraph, LangChain's powerful framework for creating stateful, multi-actor applications with LLMs. This organization is hosted on Hugging Face to facilitate collaboration, sharing, and learning within the LangGraph community.
14
+
15
+ This page showcases the **LangGraph Agent Chat UI**, a key project developed by the user group. It's a ready-to-use, intuitive interface that makes it easy to interact with your LangGraph agents. Whether you're just getting started with LangGraph or building complex multi-agent systems, this UI will streamline your development and experimentation.
16
+
17
+ **Why Join the LangGraph User Group?**
18
+
19
+ * **Collaborate:** Connect with other LangGraph users, share your projects, and get help from the community.
20
+ * **Learn:** Access tutorials, examples, and best practices for building with LangGraph.
21
+ * **Contribute:** Help shape the future of LangGraph by contributing to open-source projects like the Agent Chat UI.
22
+ * **Stay Up-to-Date:** Get the latest news and updates on LangGraph development.
23
+ * **Showcase:** You can share your Agent Chat UI projects, and graphs with other user group members.
24
+
25
+ ## LangGraph Agent Chat UI: Your Gateway to Agent Interaction
26
+
27
+ The Agent Chat UI, built by the community *for* the community, is a React/Vite application that provides a clean, chat-based interface for interacting with your LangGraph agents. Here's why it's a valuable tool:
28
+
29
+ * **Easy Connection:** Connect to local or deployed LangGraph agents with a simple URL and graph ID.
30
+ * **Intuitive Chat:** Interact naturally with your agents, sending and receiving messages in a familiar chat format.
31
+ * **Visualize Agent Actions:** See tool calls and their results rendered directly in the UI.
32
+ * **Human-in-the-Loop Made Easy:** Seamlessly integrate human input using LangGraph's `interrupt` feature. The UI handles the presentation and interaction, allowing for approvals, edits, and responses.
33
+ * **Explore Execution Paths:** Use the UI to travel through time, inspect checkpoints, and fork conversations, all powered by LangGraph's state management.
34
+ * **Debug and Understand:** Inspect the full state of your LangGraph thread at any point.
35
+
36
+ ## Get Started with the Agent Chat UI (and LangGraph!)
37
+
38
+ You have several options to start using the UI:
39
+
40
+ ### 1. Try the Deployed Version (No Setup Required!)
41
+
42
+ * **Visit:** [agentchat.vercel.app](https://agentchat.vercel.app/)
43
+ * **Connect:** Enter your LangGraph deployment URL and graph ID (the `path` you set with `langserve.add_routes`). If using a production deployment, also include your LangSmith API key.
44
+ * **Chat!** You're ready to interact with your agent.
45
+
46
+ ### 2. Run Locally (for Development and Customization)
47
+
48
+ * **Option A: Clone the Repository:**
49
+ ```bash
50
+ git clone https://github.com/langchain-ai/agent-chat-ui.git
51
+ cd agent-chat-ui
52
+ pnpm install # Or npm install/yarn install
53
+ pnpm dev # Or npm run dev/yarn dev
54
+ ```
55
+ * **Option B: Quickstart with `npx`:**
56
+ ```bash
57
+ npx create-agent-chat-app
58
+ cd agent-chat-app
59
+ pnpm install # Or npm install/yarn install
60
+ pnpm dev # Or npm run dev/yarn dev
61
+ ```
62
+
63
+ Open your browser to `http://localhost:5173` (or the port indicated in your terminal).
64
+
65
+ ## LangGraph Code Examples
66
+
67
+ To use the Agent Chat UI, you'll need a running LangGraph agent served via LangServe. Here are two Python examples (basic and with human-in-the-loop):
68
+
69
+ **Basic LangGraph Agent (Summary):**
70
+
71
+ * Uses `langchain_openai`, `langgraph`, `fastapi`, and `langserve`.
72
+ * Defines a simple `get_weather` tool.
73
+ * Creates a basic agent chain using `ChatPromptTemplate`, `MessagesPlaceholder`, `ChatOpenAI`, and `create_agent_executor`.
74
+ * Serves the graph using `FastAPI` and `add_routes` from `langserve`. The `path` argument to `add_routes` is the "Graph ID".
75
+
76
+ **LangGraph Agent with Human-in-the-Loop (Summary):**
77
+
78
+ * Builds on the basic example.
79
+ * Adds a `write_email` tool.
80
+ * Includes a `handle_interrupt` function that uses `langgraph.prebuilt.interrupt` to pause execution and request human input when the `write_email` tool is called. The `interrupt` function uses a specific schema that the UI understands.
81
+ * The schema includes `"type": "interrupt"`, and an `args` dictionary with `"type"` (response, accept, ignore) and data for the human to review/edit.
82
+
83
+ **Key LangGraph Concepts (Illustrated by the UI):**
84
+
85
+ * **State Management:** LangGraph uses a state object (often a dictionary) to track the conversation and agent's internal state. The UI displays this state.
86
+ * **Checkpoints:** LangGraph automatically saves checkpoints, allowing you to resume conversations or explore different paths. The UI leverages this for time travel.
87
+ * **`add_routes` and `path`:** The `path` you use with `langserve.add_routes` is *essential*. It's the "Graph ID" you enter in the UI to connect.
88
+ * **Tool Calling:** The UI renders tool calls and results if your agent uses tools (via `bind_tools`).
89
+ * **Human Interrupts:** The `interrupt` function, with its specific schema, is how you trigger human-in-the-loop interactions.
90
+
91
+ ## Join the Community!
92
+
93
+ We encourage you to join the LangGraph User Group to connect with fellow developers, ask questions, share your projects, and contribute to the LangGraph ecosystem. Click the "Join Group" button to become a member! We look forward to seeing what you build with LangGraph!
94
+
95
  # LangGraph Agent Chat UI
96
 
97
  This project provides a simple, intuitive user interface (UI) for interacting with LangGraph agents. It's built with React and Vite, offering a responsive chat-like experience for testing and demonstrating your LangGraph deployments. It's designed to work seamlessly with LangGraph's core concepts, including checkpoints, thread management, and human-in-the-loop capabilities.