-
Notifications
You must be signed in to change notification settings - Fork 112
feat(docs): add thinking in langgraph #792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Preview ID generated: preview-wayofl-1759950434-e82b2d5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive tutorial document titled "Thinking in LangGraph" that guides developers through the thought process and methodology for building agents with LangGraph. The tutorial uses a customer support email agent as a practical example to demonstrate the framework's concepts and best practices.
Key changes:
- New tutorial document covering the 5-step process for building LangGraph agents
- Integration of the new document into the documentation navigation structure
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/oss/langgraph/thinking-in-langgraph.mdx | New comprehensive tutorial document explaining LangGraph agent development methodology with practical examples |
src/docs.json | Added navigation entry for the new thinking-in-langgraph tutorial in the LangGraph section |
|
||
llm = ChatOpenAI(model="gpt-4") | ||
|
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API key configuration is exposed in the code example. Consider showing environment variable usage or configuration patterns instead of direct instantiation to avoid exposing credentials.
llm = ChatOpenAI(model="gpt-4") | |
import os | |
# Read API key from environment variable for security | |
openai_api_key = os.environ.get("OPENAI_API_KEY") | |
if not openai_api_key: | |
raise RuntimeError("OPENAI_API_KEY environment variable not set") | |
llm = ChatOpenAI(model="gpt-4", api_key=openai_api_key) |
Copilot uses AI. Check for mistakes.
└─────────────┘ | ||
``` | ||
|
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Mermaid diagram appears to duplicate the ASCII diagram above it (lines 35-72). The node names in the Mermaid diagram don't match the ASCII version (e.g., 'write_response' vs 'Draft Reply'). Consider removing one diagram or ensuring they show complementary information with consistent naming.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
|
||
llm = ChatOpenAI(model="gpt-4") |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coded model configuration without API key management. Consider using environment variables or configuration files for API credentials and model settings.
llm = ChatOpenAI(model="gpt-4") | |
import os | |
llm = ChatOpenAI(model=os.environ.get("OPENAI_MODEL", "gpt-4")) |
Copilot uses AI. Check for mistakes.
Preview ID generated: preview-wayofl-1760037402-d2562fa |
@@ -0,0 +1,568 @@ | |||
--- | |||
title: Thinking in LangGraph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: Thinking in LangGraph | |
title: LangGraph design patterns |
What about something like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like thinking in langgraph more (I think it's clearer that it's more of a conceptual walk through than design patterns). We can poll more folks?
Preview ID generated: preview-wayofl-1760197058-0726af2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/oss/langgraph/thinking-in-langgraph.mdx:1
- The navigation path references 'oss/python/langgraph/thinking-in-langgraph' but the actual file is located at 'oss/langgraph/thinking-in-langgraph.mdx'. This path mismatch will result in a broken navigation link.
---
from langchain_openai import ChatOpenAI | ||
from langchain_core.messages import HumanMessage | ||
|
||
llm = ChatOpenAI(model="gpt-4") |
Copilot
AI
Oct 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API key configuration is exposed in the code example. Consider using environment variables or configuration patterns to avoid exposing API keys in documentation.
Copilot uses AI. Check for mistakes.
## Step 1: Map out your workflow as discrete steps | ||
|
||
Start by identifying the distinct steps in your process. Each step will become a **node** (a function that does one specific thing). Then sketch how these steps connect to each other. | ||
|
Copilot
AI
Oct 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two different diagram formats (Mermaid and ASCII) show the same workflow. This duplication could lead to inconsistencies if one is updated but not the other. Consider using only the Mermaid diagram for consistency and maintainability.
Copilot uses AI. Check for mistakes.
Preview ID generated: preview-wayofl-1760235528-c17017c |
Preview ID generated: preview-wayofl-1760274417-6afd996 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
from langgraph.pregel import RetryPolicy | ||
from langchain_openai import ChatOpenAI | ||
from langchain_core.messages import HumanMessage | ||
|
Copilot
AI
Oct 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code contains a hardcoded LLM initialization without an API key parameter, but API keys should not be present in documentation examples. Consider adding a comment about environment variable configuration or use a placeholder pattern.
# Assumes OPENAI_API_KEY is set in your environment variables |
Copilot uses AI. Check for mistakes.
from langgraph.graph import StateGraph, START, END | ||
from langgraph.types import interrupt, Command | ||
from langgraph.pregel import RetryPolicy | ||
from langchain_openai import ChatOpenAI |
Copilot
AI
Oct 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import suggests OpenAI API usage but there's no guidance about API key management. Documentation should include a note about setting up environment variables like OPENAI_API_KEY
for security.
Copilot uses AI. Check for mistakes.
Preview ID generated: preview-wayofl-1760274552-e155104 |
Preview ID generated: preview-wayofl-1760274792-764d063 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
|
||
```python | ||
from langgraph.checkpoint.memory import MemorySaver | ||
from langgraph.pregel import RetryPolicy |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import from langgraph.pregel import RetryPolicy
is incorrect. RetryPolicy should be imported from langgraph.types
not langgraph.pregel
.
from langgraph.pregel import RetryPolicy | |
from langgraph.types import RetryPolicy |
Copilot uses AI. Check for mistakes.
|
||
```typescript | ||
import { MemorySaver } from "@langchain/langgraph"; | ||
import { RetryPolicy } from "@langchain/langgraph"; |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RetryPolicy import appears twice in this code block. Line 902 has a duplicate import that should be removed since it's already imported on line 312.
import { RetryPolicy } from "@langchain/langgraph"; |
Copilot uses AI. Check for mistakes.
Preview ID generated: preview-wayofl-1760406375-52ff3fe |
Preview ID generated: preview-wayofl-1760408456-482b16a |
Adding thinking in langgraph --------- Co-authored-by: Hunter Lovell <hunter@hntrl.io>
Adding thinking in langgraph